Introduction

This data set is from the Wall Street Journal and includes measles vaccination rates in schools across 32 states in the US. The data covers different years: vaccination rates are for the 2017-18 school year for Colorado, Connecticut, Minnesota, Montana, New Jersey, New York, North Dakota, Pennsylvania, South Dakota, Utah and Washington. Rates for other states are 2018-19. I wanted to try the gt package to summarize this data in tables, the output was generated using R Markdown.

The table below shows the vaccination rates for each state, including the percent rate of exemptions for personal, medical, and religious reasons. For some entries zeros appear because the original data either had negative numbers or was missing. The latter mainly affects the exemptions numbers.
Vaccination rate per state
State MMR vaccination rate Overall vaccination rate Religious exemption Medical exemption Personal exemption
Arizona 74.95 1.00 0.00 0.23 4.96
Arkansas 80.49 1.00 0.00 0.00 0.00
California 85.27 84.17 0.00 1.68 0.00
Colorado 94.10 87.61 0.00 0.15 4.87
Connecticut 71.96 1.00 0.00 0.23 0.00
Florida 1.00 92.49 0.00 0.38 0.00
Idaho 1.00 81.07 0.00 0.62 0.00
Illinois 97.39 1.00 0.00 0.14 0.00
Iowa 1.00 81.58 0.00 0.00 0.00
Maine 92.31 1.00 0.00 0.61 7.02
Massachusetts 58.48 1.00 0.00 0.84 0.00
Michigan 1.00 91.81 0.00 5.50 0.00
Minnesota 80.07 1.00 0.00 0.12 3.25
Missouri 87.11 1.00 0.00 0.00 0.00
Montana 76.58 1.00 0.00 0.26 0.00
New Jersey 1.00 88.22 0.01 0.21 0.00
New York 93.50 1.00 0.00 0.27 0.00
North Carolina 1.00 96.78 0.02 0.14 0.00
North Dakota 86.43 1.00 0.00 0.41 3.49
Ohio 84.38 82.27 0.00 2.64 0.00
Oklahoma 1.00 77.17 0.00 2.12 0.00
Oregon 92.83 90.29 0.00 0.12 3.63
Pennsylvania 96.89 1.00 0.00 0.00 0.00
Rhode Island 1.00 88.75 0.00 1.40 0.00
South Dakota 90.96 1.00 0.00 0.00 0.00
Tennessee 1.00 95.02 0.03 0.15 0.00
Texas 93.31 1.00 0.00 0.00 0.00
Utah 95.04 1.00 0.00 0.09 4.27
Vermont 91.63 88.72 0.00 0.00 0.00
Virginia 1.00 90.32 0.00 0.25 0.00
Washington 79.67 75.46 0.00 0.84 4.16
Wisconsin 1.00 82.63 0.00 0.00 7.21
Data Source: Wall Street Journal

The next step is to calculate the vaccination rates per school type for each state. I was curious as to whether there were differences depending on school type.

Vaccination rate per school type
School type Measles vaccination rate
Arizona
Charter 69.4
Private 30.1
Public 87.1
Arkansas
NA 80.5
California
Private 48.3
Public 92.9
Colorado
Kindergarten 94.1
Private 95.1
Connecticut
Nonpublic 10.7
Public 89.0
Florida
NA 1.0
Idaho
NA 1.0
Illinois
NA 97.4
Iowa
NA 1.0
Maine
NA 92.3
Massachusetts
Private 11.3
Public 79.2
Michigan
NA 1.0
Minnesota
NA 80.1
Missouri
NA 87.1
Montana
NA 76.6
New Jersey
NA 1.0
New York
BOCES 98.8
Private 88.9
Public 98.8
North Carolina
NA 1.0
North Dakota
NA 86.4
Ohio
Private 76.4
Public 88.2
Oklahoma
NA 1.0
Oregon
NA 92.8
Pennsylvania
NA 96.9
Rhode Island
NA 1.0
South Dakota
NA 91.0
Tennessee
NA 1.0
Texas
NA 93.3
Utah
Private 92.5
Public 95.2
Vermont
NA 91.6
Virginia
NA 1.0
Washington
NA 79.7
Wisconsin
NA 1.0
Data Source: Wall Street Journal

Unfortunately, the school type i.e. Public, Private, and Charter schools is not included for all states. So the table output from the analysis includes NA values. In addition, some states include additional designations for school type in this data set, e.g. Kindergarten, BOCES etc