As mentioned earlier, Tobacco is one of the top Chronic Disease Indicator of preventable deaths in the US.
db_user <- 'newuser'
db_password <- 'pass'
db_name <- 'uscdi'
db_host <- '127.0.0.1' # for access to SQL Database hosted on Google Cloud
db_port <- 3306
drv <- dbDriver("MySQL")
# creating tbdb connection object with RMysql package
connect <- dbConnect(drv, user = db_user, password = db_password, dbname = db_name, host = db_host, port = db_port)
tblTobacco <- dbGetQuery(connect, "SELECT * FROM USChronicDiseaseIndicators WHERE Topic = 'Tobacco' AND LocationAbbr <> 'US';" )
Tobacco_df <- tblTobacco
dim(Tobacco_df)
## [1] 29106 34
kable(head(Tobacco_df, 20)) %>% kable_styling(bootstrap_options = "striped", full_width = T, font_size = 10) %>% scroll_box(height = "500px")
YearStart | YearEnd | LocationAbbr | LocationDesc | DataSource | Topic | Question | Response | DataValueUnit | DataValueType | DataValue | DataValueAlt | DataValueFootnoteSymbol | DatavalueFootnote | LowConfidenceLimit | HighConfidenceLimit | StratificationCategory1 | Stratification1 | StratificationCategory2 | Stratification2 | StratificationCategory3 | Stratification3 | ResponseID | GeoLocation | LocationID | TopicID | QuestionID | DataValueTypeID | StratificationCategoryID1 | StratificationID1 | StratificationCategoryID2 | StratificationID2 | StratificationCategoryID3 | StratificationID3 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2016 | 2016 | KY | Kentucky | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 24.5 | 24.5 | 23.1 | 25.8 | Overall | Overall | (37.645970271000465, -84.77497104799966) | 21 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | WI | Wisconsin | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 17.1 | 17.1 | 15.6 | 18.6 | Overall | Overall | (44.39319117400049, -89.81637074199966) | 55 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | WY | Wyoming | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 18.9 | 18.9 | 17.1 | 21 | Overall | Overall | (43.23554134300048, -108.10983035299967) | 56 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | LA | Louisiana | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 22.8 | 22.8 | 20.8 | 24.8 | Overall | Overall | (31.31266064400046, -92.44568007099969) | 22 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | GU | Guam | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 25.1 | 25.1 | 21.8 | 28.8 | Overall | Overall | (13.444304, 144.793731) | 66 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | ME | Maine | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 19.8 | 19.8 | 18.5 | 21.1 | Overall | Overall | (45.254228894000505, -68.98503133599962) | 23 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MD | Maryland | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 13.7 | 13.7 | 12.9 | 14.5 | Overall | Overall | (39.29058096400047, -76.60926011099963) | 24 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MA | Massachusetts | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 13.6 | 13.6 | 12.6 | 14.7 | Overall | Overall | (42.27687047000046, -72.08269067499964) | 25 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MI | Michigan | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 20.4 | 20.4 | 19.4 | 21.4 | Overall | Overall | (44.6613195430005, -84.71439026999968) | 26 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MN | Minnesota | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 15.2 | 15.2 | 14.5 | 15.9 | Overall | Overall | (46.35564873600049, -94.79420050299967) | 27 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MS | Mississippi | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 22.7 | 22.7 | 21.1 | 24.5 | Overall | Overall | (32.745510099000455, -89.53803082499968) | 28 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | PR | Puerto Rico | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 10.6 | 10.6 | 9.4 | 11.9 | Overall | Overall | (18.220833, -66.590149) | 72 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MO | Missouri | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 22.1 | 22.1 | 20.6 | 23.8 | Overall | Overall | (38.635790776000476, -92.56630005299968) | 29 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | VI | Virgin Islands | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 6.6 | 6.6 | 4.6 | 9.5 | Overall | Overall | (18.335765, -64.896335) | 78 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | MT | Montana | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 18.5 | 18.5 | 17.1 | 20.1 | Overall | Overall | (47.06652897200047, -109.42442064499971) | 30 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | NE | Nebraska | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 17 | 17 | 16 | 18.1 | Overall | Overall | (41.6410409880005, -99.36572062299967) | 31 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | KY | Kentucky | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 25 | 25 | 23 | 27.1 | Gender | Male | (37.645970271000465, -84.77497104799966) | 21 | TOB | TOB1_2 | CRDPREV | GENDER | GENM | ||||||||||||
2016 | 2016 | NV | Nevada | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 16.5 | 16.5 | 14.9 | 18.2 | Overall | Overall | (39.493240390000494, -117.07184056399967) | 32 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | NH | New Hampshire | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 18 | 18 | 16.5 | 19.7 | Overall | Overall | (43.65595011300047, -71.50036091999965) | 33 | TOB | TOB1_2 | CRDPREV | OVERALL | OVR | ||||||||||||
2016 | 2016 | LA | Louisiana | BRFSS | Tobacco | Current smoking among adults aged >= 18 years | % | Crude Prevalence | 25.5 | 25.5 | 22.6 | 28.8 | Gender | Male | (31.31266064400046, -92.44568007099969) | 22 | TOB | TOB1_2 | CRDPREV | GENDER | GENM |
#remove emply columns
Tobacco_df <- Tobacco_df[!sapply(Tobacco_df, function(t) all(t == ""))]
Tobacco_df <- Tobacco_df %>% select("YearEnd", "LocationAbbr", "Question", "DataValue", "Stratification1", "ResponseID") %>% separate(ResponseID, c("Latitude", "Longitude"), sep = ",")
#remove none digit elements from the observations in both longitude and latitude columns and then convert remaining characters to numeric
Tobacco_df$Latitude <- as.numeric(unlist(str_remove(Tobacco_df$Latitude, "^[(]")))
Tobacco_df$Longitude <- as.numeric(unlist(str_remove(Tobacco_df$Longitude, "[)]$")))
#rename a few columns
names(Tobacco_df)[c(1, 2, 5)] <- c("Year", "State", "Stratification")
#If any cell for the row is empty then remove the row
Tobacco_df <- Tobacco_df[!Tobacco_df$DataValue == "", ]
After making changes to the Tobacco dataframe, here is a preview to a more condensed form
dim(Tobacco_df)
## [1] 19158 7
kable(head(Tobacco_df, 100)) %>% kable_styling(font_size = 10) %>% scroll_box(height = "500px")
Year | State | Question | DataValue | Stratification | Latitude | Longitude | |
---|---|---|---|---|---|---|---|
1 | 2016 | KY | Current smoking among adults aged >= 18 years | 24.5 | Overall | 37.64597 | -84.77497 |
2 | 2016 | WI | Current smoking among adults aged >= 18 years | 17.1 | Overall | 44.39319 | -89.81637 |
3 | 2016 | WY | Current smoking among adults aged >= 18 years | 18.9 | Overall | 43.23554 | -108.10983 |
4 | 2016 | LA | Current smoking among adults aged >= 18 years | 22.8 | Overall | 31.31266 | -92.44568 |
5 | 2016 | GU | Current smoking among adults aged >= 18 years | 25.1 | Overall | 13.44430 | 144.79373 |
6 | 2016 | ME | Current smoking among adults aged >= 18 years | 19.8 | Overall | 45.25423 | -68.98503 |
7 | 2016 | MD | Current smoking among adults aged >= 18 years | 13.7 | Overall | 39.29058 | -76.60926 |
8 | 2016 | MA | Current smoking among adults aged >= 18 years | 13.6 | Overall | 42.27687 | -72.08269 |
9 | 2016 | MI | Current smoking among adults aged >= 18 years | 20.4 | Overall | 44.66132 | -84.71439 |
10 | 2016 | MN | Current smoking among adults aged >= 18 years | 15.2 | Overall | 46.35565 | -94.79420 |
11 | 2016 | MS | Current smoking among adults aged >= 18 years | 22.7 | Overall | 32.74551 | -89.53803 |
12 | 2016 | PR | Current smoking among adults aged >= 18 years | 10.6 | Overall | 18.22083 | -66.59015 |
13 | 2016 | MO | Current smoking among adults aged >= 18 years | 22.1 | Overall | 38.63579 | -92.56630 |
14 | 2016 | VI | Current smoking among adults aged >= 18 years | 6.6 | Overall | 18.33576 | -64.89633 |
15 | 2016 | MT | Current smoking among adults aged >= 18 years | 18.5 | Overall | 47.06653 | -109.42442 |
16 | 2016 | NE | Current smoking among adults aged >= 18 years | 17 | Overall | 41.64104 | -99.36572 |
17 | 2016 | KY | Current smoking among adults aged >= 18 years | 25 | Male | 37.64597 | -84.77497 |
18 | 2016 | NV | Current smoking among adults aged >= 18 years | 16.5 | Overall | 39.49324 | -117.07184 |
19 | 2016 | NH | Current smoking among adults aged >= 18 years | 18 | Overall | 43.65595 | -71.50036 |
20 | 2016 | LA | Current smoking among adults aged >= 18 years | 25.5 | Male | 31.31266 | -92.44568 |
21 | 2016 | NJ | Current smoking among adults aged >= 18 years | 14 | Overall | 40.13057 | -74.27369 |
22 | 2016 | ME | Current smoking among adults aged >= 18 years | 21.6 | Male | 45.25423 | -68.98503 |
23 | 2016 | NM | Current smoking among adults aged >= 18 years | 16.6 | Overall | 34.52088 | -106.24058 |
24 | 2016 | NY | Current smoking among adults aged >= 18 years | 14.2 | Overall | 42.82700 | -75.54397 |
25 | 2016 | PA | Current smoking among adults aged >= 18 years | 18 | Overall | 40.79373 | -77.86070 |
26 | 2016 | RI | Current smoking among adults aged >= 18 years | 14.4 | Overall | 41.70828 | -71.52247 |
27 | 2016 | IA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 22.1 | Overall | 42.46940 | -93.81649 |
28 | 2016 | IN | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 23.3 | Male | 39.76691 | -86.14996 |
29 | 2016 | SC | Current smoking among adults aged >= 18 years | 20 | Overall | 33.99882 | -81.04537 |
30 | 2016 | AL | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.5 | Overall | 32.84057 | -86.63186 |
31 | 2016 | AK | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 29.3 | Overall | 64.84508 | -147.72206 |
32 | 2016 | AZ | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 32.2 | Overall | 34.86597 | -111.76381 |
33 | 2016 | AR | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.8 | Overall | 34.74865 | -92.27449 |
34 | 2016 | CA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26 | Overall | 37.63864 | -121.00000 |
35 | 2016 | CO | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 30 | Overall | 38.84384 | -106.13361 |
36 | 2016 | CT | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.9 | Overall | 41.56266 | -72.64984 |
37 | 2016 | DE | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 25.6 | Overall | 39.00883 | -75.57774 |
38 | 2016 | DC | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.8 | Overall | 38.90719 | -77.03687 |
39 | 2016 | FL | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24 | Overall | 28.93204 | -81.92896 |
40 | 2016 | GA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 25 | Overall | 32.83968 | -83.62758 |
41 | 2016 | HI | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 21.8 | Overall | 21.30485 | -157.85775 |
42 | 2016 | ID | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 22.8 | Overall | 43.68263 | -114.36373 |
43 | 2016 | IL | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28 | Overall | 40.48501 | -88.99771 |
44 | 2016 | IN | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.7 | Overall | 39.76691 | -86.14996 |
45 | 2016 | KS | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.5 | Overall | 38.34774 | -98.20078 |
46 | 2016 | KY | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.7 | Overall | 37.64597 | -84.77497 |
47 | 2016 | LA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.3 | Overall | 31.31266 | -92.44568 |
48 | 2016 | ME | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 31.2 | Overall | 45.25423 | -68.98503 |
49 | 2016 | MD | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.9 | Overall | 39.29058 | -76.60926 |
50 | 2016 | MA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 31.6 | Overall | 42.27687 | -72.08269 |
51 | 2016 | MI | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.6 | Overall | 44.66132 | -84.71439 |
52 | 2016 | MN | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.3 | Overall | 46.35565 | -94.79420 |
53 | 2016 | MS | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 21.3 | Overall | 32.74551 | -89.53803 |
54 | 2016 | MO | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 30.3 | Overall | 38.63579 | -92.56630 |
55 | 2016 | MT | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.1 | Overall | 47.06653 | -109.42442 |
56 | 2016 | NE | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.1 | Overall | 41.64104 | -99.36572 |
57 | 2016 | NV | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24.3 | Overall | 39.49324 | -117.07184 |
58 | 2016 | NH | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 31 | Overall | 43.65595 | -71.50036 |
59 | 2016 | NJ | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 22.7 | Overall | 40.13057 | -74.27369 |
60 | 2016 | NM | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.2 | Overall | 34.52088 | -106.24058 |
61 | 2016 | NY | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.8 | Overall | 42.82700 | -75.54397 |
62 | 2016 | NC | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26 | Overall | 35.46622 | -79.15925 |
63 | 2016 | ND | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 23.8 | Overall | 47.47532 | -100.11842 |
64 | 2016 | OH | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.1 | Overall | 40.06021 | -82.40426 |
65 | 2016 | OK | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.5 | Overall | 35.47203 | -97.52107 |
66 | 2016 | OR | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.8 | Overall | 44.56745 | -120.15503 |
67 | 2016 | PA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.9 | Overall | 40.79373 | -77.86070 |
68 | 2016 | RI | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 34.6 | Overall | 41.70828 | -71.52247 |
69 | 2016 | SC | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.3 | Overall | 33.99882 | -81.04537 |
70 | 2016 | SD | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24.3 | Overall | 44.35313 | -100.37353 |
71 | 2016 | TN | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 25.7 | Overall | 35.68094 | -85.77449 |
72 | 2016 | TX | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24.9 | Overall | 31.82724 | -99.42677 |
73 | 2016 | UT | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.3 | Overall | 39.36070 | -111.58713 |
74 | 2016 | VT | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 33.9 | Overall | 43.62538 | -72.51764 |
75 | 2016 | VA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.8 | Overall | 37.54268 | -78.45789 |
76 | 2016 | WA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 30.7 | Overall | 47.52228 | -120.47001 |
77 | 2016 | WV | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 31.2 | Overall | 38.66551 | -80.71264 |
78 | 2016 | WI | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 30.6 | Overall | 44.39319 | -89.81637 |
79 | 2016 | WY | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24 | Overall | 43.23554 | -108.10983 |
80 | 2016 | GU | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 19.7 | Overall | 13.44430 | 144.79373 |
81 | 2016 | PR | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 9.9 | Overall | 18.22083 | -66.59015 |
83 | 2016 | AL | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.4 | Overall | 32.84057 | -86.63186 |
84 | 2016 | AK | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 30.4 | Overall | 64.84508 | -147.72206 |
85 | 2016 | AZ | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 32.9 | Overall | 34.86597 | -111.76381 |
86 | 2016 | AR | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.4 | Overall | 34.74865 | -92.27449 |
87 | 2016 | CA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 25.7 | Overall | 37.63864 | -121.00000 |
88 | 2016 | CO | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 30 | Overall | 38.84384 | -106.13361 |
89 | 2016 | CT | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27 | Overall | 41.56266 | -72.64984 |
90 | 2016 | DE | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24.2 | Overall | 39.00883 | -75.57774 |
91 | 2016 | DC | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.9 | Overall | 38.90719 | -77.03687 |
92 | 2016 | FL | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 23.6 | Overall | 28.93204 | -81.92896 |
93 | 2016 | GA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 24.7 | Overall | 32.83968 | -83.62758 |
94 | 2016 | HI | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 22.2 | Overall | 21.30485 | -157.85775 |
95 | 2016 | ID | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 23.4 | Overall | 43.68263 | -114.36373 |
96 | 2016 | IL | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 27.8 | Overall | 40.48501 | -88.99771 |
97 | 2016 | IN | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 25.4 | Overall | 39.76691 | -86.14996 |
98 | 2016 | IA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 20.7 | Overall | 42.46940 | -93.81649 |
99 | 2016 | KS | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 28.6 | Overall | 38.34774 | -98.20078 |
100 | 2016 | KY | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.4 | Overall | 37.64597 | -84.77497 |
101 | 2016 | LA | Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke | 26.9 | Overall | 31.31266 | -92.44568 |
These are the type of questions looked at concerning Tobacco
Questions <- unique(Tobacco_df$Question)
kable(Questions) %>% kable_styling(font_size = 12) %>% scroll_box(height = "300px")
x |
---|
Current smoking among adults aged >= 18 years |
Pneumococcal vaccination among noninstitutionalized adults aged 18-64 years who smoke |
Pneumococcal vaccination among noninstitutionalized adults aged >= 65 years who smoke |
Quit attempts in the past year among current smokers |
Current cigarette smoking among women aged 18-44 years |
Current smokeless tobacco use among adults aged >= 18 years |
Current cigarette smoking among youth |
Current smokeless tobacco use among youth |
Secondary schools that have a comprehensive tobacco-free school policy in place |
Amount of tobacco product excise tax |
States that allow stronger local tobacco control and prevention laws |
States with strong polices that require retail licenses to sell tobacco products |
Proportion of the population protected by a comprehensive smoke-free policy prohibiting smoking in all indoor areas of workplaces and public places, including restaurants and bars |
Sale of cigarette packs |
Percent tobacco revenue to fund at CDC recommended level |
Cigarette smoking before pregnancy |
A Second Tobacco Dataframe was created because some of the DataValues are categorical (Yes, No) while others are numeric.The first Tobacco Dataframe now has 18681 obs with 7 variables.
#separate categorical datavalues from numerical ones and place in a new df
Tobacco_df2 <- subset(Tobacco_df, Tobacco_df$DataValue == c("Yes","No"))
dim(Tobacco_df2)
## [1] 238 7
kable(Tobacco_df2) %>% kable_styling(font_size = 10) %>% scroll_box(height = "300px")
Year | State | Question | DataValue | Stratification | Latitude | Longitude | |
---|---|---|---|---|---|---|---|
15815 | 2015 | ND | Amount of tobacco product excise tax | No | Overall | 47.47532 | -100.11842 |
15817 | 2015 | NH | Amount of tobacco product excise tax | No | Overall | 43.65595 | -71.50036 |
15819 | 2015 | NJ | Amount of tobacco product excise tax | No | Overall | 40.13057 | -74.27369 |
15821 | 2015 | AL | Amount of tobacco product excise tax | No | Overall | 32.84057 | -86.63186 |
15823 | 2015 | AZ | Amount of tobacco product excise tax | No | Overall | 34.86597 | -111.76381 |
15869 | 2015 | OK | Amount of tobacco product excise tax | No | Overall | 35.47203 | -97.52107 |
16225 | 2015 | CT | Amount of tobacco product excise tax | No | Overall | 41.56266 | -72.64984 |
16639 | 2015 | OR | Amount of tobacco product excise tax | No | Overall | 44.56745 | -120.15503 |
17288 | 2015 | DE | Amount of tobacco product excise tax | No | Overall | 39.00883 | -75.57774 |
18093 | 2015 | FL | Amount of tobacco product excise tax | No | Overall | 28.93204 | -81.92896 |
18263 | 2015 | SC | Amount of tobacco product excise tax | No | Overall | 33.99882 | -81.04537 |
18299 | 2015 | SD | Amount of tobacco product excise tax | No | Overall | 44.35313 | -100.37353 |
18830 | 2015 | UT | Amount of tobacco product excise tax | No | Overall | 39.36070 | -111.58713 |
18970 | 2015 | VA | Amount of tobacco product excise tax | No | Overall | 37.54268 | -78.45789 |
19811 | 2015 | WV | Amount of tobacco product excise tax | No | Overall | 38.66551 | -80.71264 |
19836 | 2015 | GA | Amount of tobacco product excise tax | No | Overall | 32.83968 | -83.62758 |
20497 | 2015 | IA | Amount of tobacco product excise tax | No | Overall | 42.46940 | -93.81649 |
20499 | 2015 | IL | Amount of tobacco product excise tax | No | Overall | 40.48501 | -88.99771 |
20501 | 2015 | KS | Amount of tobacco product excise tax | No | Overall | 38.34774 | -98.20078 |
20503 | 2015 | LA | Amount of tobacco product excise tax | No | Overall | 31.31266 | -92.44568 |
20505 | 2015 | MD | Amount of tobacco product excise tax | No | Overall | 39.29058 | -76.60926 |
20507 | 2015 | MI | Amount of tobacco product excise tax | No | Overall | 44.66132 | -84.71439 |
20508 | 2015 | MN | Amount of tobacco product excise tax | Yes | Overall | 46.35565 | -94.79420 |
20509 | 2015 | MO | Amount of tobacco product excise tax | No | Overall | 38.63579 | -92.56630 |
20513 | 2015 | ND | States that allow stronger local tobacco control and prevention laws | No | Overall | 47.47532 | -100.11842 |
20515 | 2015 | AL | States that allow stronger local tobacco control and prevention laws | No | Overall | 32.84057 | -86.63186 |
20517 | 2015 | AR | States that allow stronger local tobacco control and prevention laws | No | Overall | 34.74865 | -92.27449 |
20524 | 2015 | FL | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 28.93204 | -81.92896 |
20525 | 2015 | GA | States that allow stronger local tobacco control and prevention laws | No | Overall | 32.83968 | -83.62758 |
20527 | 2015 | HI | States that allow stronger local tobacco control and prevention laws | No | Overall | 21.30485 | -157.85775 |
20528 | 2015 | IA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 42.46940 | -93.81649 |
20529 | 2015 | ID | States that allow stronger local tobacco control and prevention laws | No | Overall | 43.68263 | -114.36373 |
20534 | 2015 | LA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 31.31266 | -92.44568 |
20535 | 2015 | MA | States that allow stronger local tobacco control and prevention laws | No | Overall | 42.27687 | -72.08269 |
20537 | 2015 | ME | States that allow stronger local tobacco control and prevention laws | No | Overall | 45.25423 | -68.98503 |
20538 | 2015 | MI | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 44.66132 | -84.71439 |
20539 | 2015 | MN | States that allow stronger local tobacco control and prevention laws | No | Overall | 46.35565 | -94.79420 |
20542 | 2015 | MT | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 47.06653 | -109.42442 |
20546 | 2015 | NV | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 39.49324 | -117.07184 |
20547 | 2015 | NY | States that allow stronger local tobacco control and prevention laws | No | Overall | 42.82700 | -75.54397 |
20550 | 2015 | OR | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 44.56745 | -120.15503 |
20553 | 2015 | RI | States that allow stronger local tobacco control and prevention laws | No | Overall | 41.70828 | -71.52247 |
20554 | 2015 | SC | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 33.99882 | -81.04537 |
20556 | 2015 | TN | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 35.68094 | -85.77449 |
20557 | 2015 | TX | States that allow stronger local tobacco control and prevention laws | No | Overall | 31.82724 | -99.42677 |
20562 | 2015 | WA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 47.52228 | -120.47001 |
20564 | 2015 | WV | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 38.66551 | -80.71264 |
20566 | 2015 | AK | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 64.84508 | -147.72206 |
20568 | 2015 | AR | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 34.74865 | -92.27449 |
20569 | 2015 | AZ | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 34.86597 | -111.76381 |
20570 | 2015 | CA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 37.63864 | -121.00000 |
20571 | 2015 | CO | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 38.84384 | -106.13361 |
20572 | 2015 | CT | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 41.56266 | -72.64984 |
20574 | 2015 | DE | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.00883 | -75.57774 |
20576 | 2015 | GA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 32.83968 | -83.62758 |
20578 | 2015 | HI | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 21.30485 | -157.85775 |
20581 | 2015 | IL | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 40.48501 | -88.99771 |
20582 | 2015 | IN | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.76691 | -86.14996 |
20586 | 2015 | MA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 42.27687 | -72.08269 |
20588 | 2015 | ME | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 45.25423 | -68.98503 |
20589 | 2015 | MI | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 44.66132 | -84.71439 |
20590 | 2015 | MN | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 46.35565 | -94.79420 |
20591 | 2015 | MO | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 38.63579 | -92.56630 |
20592 | 2015 | MS | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 32.74551 | -89.53803 |
20596 | 2015 | NE | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 41.64104 | -99.36572 |
20598 | 2015 | NJ | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 40.13057 | -74.27369 |
20599 | 2015 | NM | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 34.52088 | -106.24058 |
20600 | 2015 | NV | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.49324 | -117.07184 |
20602 | 2015 | OH | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 40.06021 | -82.40426 |
20606 | 2015 | PR | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 18.22083 | -66.59015 |
20609 | 2015 | SD | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 44.35313 | -100.37353 |
20612 | 2015 | UT | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.36070 | -111.58713 |
20613 | 2015 | VA | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 37.54268 | -78.45789 |
20614 | 2015 | VI | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 18.33576 | -64.89633 |
20616 | 2015 | WA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 47.52228 | -120.47001 |
20618 | 2015 | WV | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 38.66551 | -80.71264 |
20619 | 2015 | WY | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 43.23554 | -108.10983 |
23222 | 2014 | HI | States that allow stronger local tobacco control and prevention laws | No | Overall | 21.30485 | -157.85775 |
23681 | 2014 | IA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 42.46940 | -93.81649 |
24018 | 2014 | ID | Amount of tobacco product excise tax | No | Overall | 43.68263 | -114.36373 |
24058 | 2014 | ID | States that allow stronger local tobacco control and prevention laws | No | Overall | 43.68263 | -114.36373 |
24486 | 2014 | IL | States that allow stronger local tobacco control and prevention laws | No | Overall | 40.48501 | -88.99771 |
24506 | 2014 | IN | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 39.76691 | -86.14996 |
24518 | 2014 | AK | States that allow stronger local tobacco control and prevention laws | No | Overall | 64.84508 | -147.72206 |
24520 | 2014 | AR | States that allow stronger local tobacco control and prevention laws | No | Overall | 34.74865 | -92.27449 |
24527 | 2014 | FL | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 28.93204 | -81.92896 |
24528 | 2014 | GA | States that allow stronger local tobacco control and prevention laws | No | Overall | 32.83968 | -83.62758 |
24530 | 2014 | KS | States that allow stronger local tobacco control and prevention laws | No | Overall | 38.34774 | -98.20078 |
24531 | 2014 | KY | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 37.64597 | -84.77497 |
24534 | 2014 | MD | States that allow stronger local tobacco control and prevention laws | No | Overall | 39.29058 | -76.60926 |
24538 | 2014 | MO | States that allow stronger local tobacco control and prevention laws | No | Overall | 38.63579 | -92.56630 |
24539 | 2014 | MS | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 32.74551 | -89.53803 |
24541 | 2014 | NC | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 35.46622 | -79.15925 |
24542 | 2014 | ND | States that allow stronger local tobacco control and prevention laws | No | Overall | 47.47532 | -100.11842 |
24547 | 2014 | NV | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 39.49324 | -117.07184 |
24548 | 2014 | NY | States that allow stronger local tobacco control and prevention laws | No | Overall | 42.82700 | -75.54397 |
24551 | 2014 | OR | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 44.56745 | -120.15503 |
24554 | 2014 | RI | States that allow stronger local tobacco control and prevention laws | No | Overall | 41.70828 | -71.52247 |
24555 | 2014 | SC | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 33.99882 | -81.04537 |
24557 | 2014 | TN | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 35.68094 | -85.77449 |
24558 | 2014 | TX | States that allow stronger local tobacco control and prevention laws | No | Overall | 31.82724 | -99.42677 |
24563 | 2014 | WA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 47.52228 | -120.47001 |
24565 | 2014 | WV | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 38.66551 | -80.71264 |
24567 | 2014 | AK | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 64.84508 | -147.72206 |
24569 | 2014 | AR | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 34.74865 | -92.27449 |
24570 | 2014 | AZ | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 34.86597 | -111.76381 |
24571 | 2014 | CA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 37.63864 | -121.00000 |
24572 | 2014 | CO | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 38.84384 | -106.13361 |
24573 | 2014 | CT | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 41.56266 | -72.64984 |
24575 | 2014 | DE | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.00883 | -75.57774 |
24577 | 2014 | GA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 32.83968 | -83.62758 |
24579 | 2014 | HI | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 21.30485 | -157.85775 |
24582 | 2014 | IL | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 40.48501 | -88.99771 |
24583 | 2014 | IN | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.76691 | -86.14996 |
24587 | 2014 | MA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 42.27687 | -72.08269 |
24589 | 2014 | ME | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 45.25423 | -68.98503 |
24590 | 2014 | MI | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 44.66132 | -84.71439 |
24591 | 2014 | MN | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 46.35565 | -94.79420 |
24592 | 2014 | MO | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 38.63579 | -92.56630 |
24593 | 2014 | MS | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 32.74551 | -89.53803 |
24597 | 2014 | NE | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 41.64104 | -99.36572 |
24599 | 2014 | NJ | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 40.13057 | -74.27369 |
24600 | 2014 | NM | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 34.52088 | -106.24058 |
24601 | 2014 | NV | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.49324 | -117.07184 |
24603 | 2014 | OH | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 40.06021 | -82.40426 |
24607 | 2014 | PR | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 18.22083 | -66.59015 |
24610 | 2014 | SD | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 44.35313 | -100.37353 |
24613 | 2014 | UT | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.36070 | -111.58713 |
24614 | 2014 | VA | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 37.54268 | -78.45789 |
24615 | 2014 | VI | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 18.33576 | -64.89633 |
24617 | 2014 | WA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 47.52228 | -120.47001 |
24619 | 2014 | WV | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 38.66551 | -80.71264 |
24620 | 2014 | WY | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 43.23554 | -108.10983 |
24622 | 2014 | AL | Amount of tobacco product excise tax | No | Overall | 32.84057 | -86.63186 |
24624 | 2014 | AZ | Amount of tobacco product excise tax | No | Overall | 34.86597 | -111.76381 |
24626 | 2014 | CO | Amount of tobacco product excise tax | No | Overall | 38.84384 | -106.13361 |
24628 | 2014 | DC | Amount of tobacco product excise tax | No | Overall | 38.90719 | -77.03687 |
24630 | 2014 | FL | Amount of tobacco product excise tax | No | Overall | 28.93204 | -81.92896 |
24633 | 2014 | IN | Amount of tobacco product excise tax | No | Overall | 39.76691 | -86.14996 |
24635 | 2014 | KY | Amount of tobacco product excise tax | No | Overall | 37.64597 | -84.77497 |
24637 | 2014 | MA | Amount of tobacco product excise tax | No | Overall | 42.27687 | -72.08269 |
24639 | 2014 | ME | Amount of tobacco product excise tax | No | Overall | 45.25423 | -68.98503 |
24643 | 2014 | MS | Amount of tobacco product excise tax | No | Overall | 32.74551 | -89.53803 |
24645 | 2014 | NC | Amount of tobacco product excise tax | No | Overall | 35.46622 | -79.15925 |
24647 | 2014 | NE | Amount of tobacco product excise tax | No | Overall | 41.64104 | -99.36572 |
24649 | 2014 | NJ | Amount of tobacco product excise tax | No | Overall | 40.13057 | -74.27369 |
24651 | 2014 | NV | Amount of tobacco product excise tax | No | Overall | 39.49324 | -117.07184 |
24652 | 2014 | NY | Amount of tobacco product excise tax | Yes | Overall | 42.82700 | -75.54397 |
24653 | 2014 | OH | Amount of tobacco product excise tax | No | Overall | 40.06021 | -82.40426 |
24655 | 2014 | OR | Amount of tobacco product excise tax | No | Overall | 44.56745 | -120.15503 |
24658 | 2014 | RI | Amount of tobacco product excise tax | No | Overall | 41.70828 | -71.52247 |
24660 | 2014 | SD | Amount of tobacco product excise tax | No | Overall | 44.35313 | -100.37353 |
24662 | 2014 | TX | Amount of tobacco product excise tax | No | Overall | 31.82724 | -99.42677 |
24664 | 2014 | VA | Amount of tobacco product excise tax | No | Overall | 37.54268 | -78.45789 |
24667 | 2014 | WA | Amount of tobacco product excise tax | No | Overall | 47.52228 | -120.47001 |
24669 | 2014 | WV | Amount of tobacco product excise tax | No | Overall | 38.66551 | -80.71264 |
24731 | 2013 | IA | Amount of tobacco product excise tax | No | Overall | 42.46940 | -93.81649 |
24733 | 2013 | IL | Amount of tobacco product excise tax | No | Overall | 40.48501 | -88.99771 |
24735 | 2013 | KS | Amount of tobacco product excise tax | No | Overall | 38.34774 | -98.20078 |
24737 | 2013 | LA | Amount of tobacco product excise tax | No | Overall | 31.31266 | -92.44568 |
24739 | 2013 | MD | Amount of tobacco product excise tax | No | Overall | 39.29058 | -76.60926 |
24741 | 2013 | MI | Amount of tobacco product excise tax | No | Overall | 44.66132 | -84.71439 |
24742 | 2013 | MN | Amount of tobacco product excise tax | Yes | Overall | 46.35565 | -94.79420 |
24743 | 2013 | MO | Amount of tobacco product excise tax | No | Overall | 38.63579 | -92.56630 |
24745 | 2013 | MT | Amount of tobacco product excise tax | No | Overall | 47.06653 | -109.42442 |
24747 | 2013 | ND | Amount of tobacco product excise tax | No | Overall | 47.47532 | -100.11842 |
24749 | 2013 | NH | Amount of tobacco product excise tax | No | Overall | 43.65595 | -71.50036 |
24751 | 2013 | NM | Amount of tobacco product excise tax | No | Overall | 34.52088 | -106.24058 |
24755 | 2013 | OK | Amount of tobacco product excise tax | No | Overall | 35.47203 | -97.52107 |
24757 | 2013 | PA | Amount of tobacco product excise tax | No | Overall | 40.79373 | -77.86070 |
24760 | 2013 | SC | Amount of tobacco product excise tax | No | Overall | 33.99882 | -81.04537 |
24762 | 2013 | TN | Amount of tobacco product excise tax | No | Overall | 35.68094 | -85.77449 |
24764 | 2013 | UT | Amount of tobacco product excise tax | No | Overall | 39.36070 | -111.58713 |
24767 | 2013 | VT | Amount of tobacco product excise tax | No | Overall | 43.62538 | -72.51764 |
24769 | 2013 | WI | Amount of tobacco product excise tax | No | Overall | 44.39319 | -89.81637 |
24771 | 2013 | WY | Amount of tobacco product excise tax | No | Overall | 43.23554 | -108.10983 |
24933 | 2013 | AR | States that allow stronger local tobacco control and prevention laws | No | Overall | 34.74865 | -92.27449 |
25912 | 2013 | CA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 37.63864 | -121.00000 |
26281 | 2013 | CT | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 41.56266 | -72.64984 |
26840 | 2013 | DE | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 39.00883 | -75.57774 |
26899 | 2013 | FL | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 28.93204 | -81.92896 |
26956 | 2013 | GA | States that allow stronger local tobacco control and prevention laws | No | Overall | 32.83968 | -83.62758 |
27883 | 2013 | GU | States that allow stronger local tobacco control and prevention laws | No | Overall | 13.44430 | 144.79373 |
28063 | 2013 | IA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 42.46940 | -93.81649 |
28273 | 2013 | NH | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 43.65595 | -71.50036 |
28426 | 2013 | ID | States that allow stronger local tobacco control and prevention laws | No | Overall | 43.68263 | -114.36373 |
28729 | 2013 | AK | States that allow stronger local tobacco control and prevention laws | No | Overall | 64.84508 | -147.72206 |
28734 | 2013 | LA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 31.31266 | -92.44568 |
28735 | 2013 | MA | States that allow stronger local tobacco control and prevention laws | No | Overall | 42.27687 | -72.08269 |
28737 | 2013 | ME | States that allow stronger local tobacco control and prevention laws | No | Overall | 45.25423 | -68.98503 |
28738 | 2013 | MI | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 44.66132 | -84.71439 |
28739 | 2013 | MN | States that allow stronger local tobacco control and prevention laws | No | Overall | 46.35565 | -94.79420 |
28744 | 2013 | NV | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 39.49324 | -117.07184 |
28745 | 2013 | NY | States that allow stronger local tobacco control and prevention laws | No | Overall | 42.82700 | -75.54397 |
28748 | 2013 | OR | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 44.56745 | -120.15503 |
28751 | 2013 | RI | States that allow stronger local tobacco control and prevention laws | No | Overall | 41.70828 | -71.52247 |
28752 | 2013 | SC | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 33.99882 | -81.04537 |
28754 | 2013 | TN | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 35.68094 | -85.77449 |
28755 | 2013 | TX | States that allow stronger local tobacco control and prevention laws | No | Overall | 31.82724 | -99.42677 |
28760 | 2013 | WA | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 47.52228 | -120.47001 |
28762 | 2013 | WV | States that allow stronger local tobacco control and prevention laws | Yes | Overall | 38.66551 | -80.71264 |
28764 | 2013 | AK | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 64.84508 | -147.72206 |
28766 | 2013 | AR | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 34.74865 | -92.27449 |
28767 | 2013 | AZ | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 34.86597 | -111.76381 |
28768 | 2013 | CA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 37.63864 | -121.00000 |
28769 | 2013 | CO | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 38.84384 | -106.13361 |
28770 | 2013 | CT | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 41.56266 | -72.64984 |
28772 | 2013 | DE | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.00883 | -75.57774 |
28774 | 2013 | GA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 32.83968 | -83.62758 |
28776 | 2013 | HI | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 21.30485 | -157.85775 |
28779 | 2013 | IL | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 40.48501 | -88.99771 |
28780 | 2013 | IN | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.76691 | -86.14996 |
28784 | 2013 | MA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 42.27687 | -72.08269 |
28786 | 2013 | ME | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 45.25423 | -68.98503 |
28787 | 2013 | MI | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 44.66132 | -84.71439 |
28788 | 2013 | MN | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 46.35565 | -94.79420 |
28789 | 2013 | MO | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 38.63579 | -92.56630 |
28790 | 2013 | MS | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 32.74551 | -89.53803 |
28794 | 2013 | NE | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 41.64104 | -99.36572 |
28796 | 2013 | NJ | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 40.13057 | -74.27369 |
28797 | 2013 | NM | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 34.52088 | -106.24058 |
28798 | 2013 | NV | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.49324 | -117.07184 |
28800 | 2013 | OH | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 40.06021 | -82.40426 |
28804 | 2013 | PR | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 18.22083 | -66.59015 |
28807 | 2013 | SD | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 44.35313 | -100.37353 |
28810 | 2013 | UT | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 39.36070 | -111.58713 |
28811 | 2013 | VA | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 37.54268 | -78.45789 |
28812 | 2013 | VI | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 18.33576 | -64.89633 |
28814 | 2013 | WA | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 47.52228 | -120.47001 |
28816 | 2013 | WV | States with strong polices that require retail licenses to sell tobacco products | Yes | Overall | 38.66551 | -80.71264 |
28817 | 2013 | WY | States with strong polices that require retail licenses to sell tobacco products | No | Overall | 43.23554 | -108.10983 |
28842 | 2013 | FL | Amount of tobacco product excise tax | No | Overall | 28.93204 | -81.92896 |
28861 | 2013 | GA | Amount of tobacco product excise tax | No | Overall | 32.83968 | -83.62758 |
28874 | 2013 | AK | Amount of tobacco product excise tax | No | Overall | 64.84508 | -147.72206 |
28876 | 2013 | AR | Amount of tobacco product excise tax | No | Overall | 34.74865 | -92.27449 |
28878 | 2013 | CA | Amount of tobacco product excise tax | No | Overall | 37.63864 | -121.00000 |
28880 | 2013 | CT | Amount of tobacco product excise tax | No | Overall | 41.56266 | -72.64984 |
28882 | 2013 | DE | Amount of tobacco product excise tax | No | Overall | 39.00883 | -75.57774 |
#remove those placed in Tobacco_df2 from Tobacco_df
new_Tobacco_df <- Tobacco_df[!(Tobacco_df$DataValue %in% Tobacco_df2$DataValue), ]
#convert the datavalue column to numeric
new_Tobacco_df$DataValue <- as.numeric(new_Tobacco_df$DataValue)
new_Tobacco_df$Year <- as.numeric(new_Tobacco_df$Year)
dim(new_Tobacco_df)
## [1] 18681 7
ggplotly(ggplot(new_Tobacco_df, aes(x=State, y=Year, fill=Year)) +
geom_bar(stat="identity") + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + theme(axis.text=element_text(size=6)) + ggtitle("Data collected Over the years for States Concerning Tobacco"))
new_Tobacco_df %>% filter(Question == c("Current smokeless tobacco use among youth", "Current cigarette smoking among youth")) %>% ggplot(aes(x = Year, y = DataValue, fill = Question)) + geom_bar(stat = "identity", position = position_dodge())+ ggtitle("Youth (Grade 9-12) Using Tobacco Over the Years") + scale_fill_discrete(labels = c("Smokeless Tobacco", "Smoke Tobacco"))
## Warning: package 'bindrcpp' was built under R version 3.5.2
## Warning in Question == c("Current smokeless tobacco use among youth",
## "Current cigarette smoking among youth"): longer object length is not a
## multiple of shorter object length
It is likely that if the yout is using smokeless Tobacco, then they’ll smoke it too.
new_Tobacco_df %>% filter(!Stratification == "Overall") %>% ggplot(aes(x= Stratification, y=Year, fill=Stratification)) +
geom_bar(stat="identity") + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + theme(axis.text=element_text(size=6)) + transition_time(round(Year)) + labs(title = "Year: {frame_time}")
Based on this research, most of Tobacco customers are Male and the top race is White.
Increasing the price of tabacco discourages people from buying them, especially youths. This way improvements in health will get better in the long term. Majority of the states did not excise tax from the Tobacco product.
Tobacco_df2 %>% filter(Question == "Amount of tobacco product excise tax") %>% ggplot(aes(x = DataValue)) + geom_bar()
Map below shows which States did and did not allow stronger laws.
Tobacco_df2 %>% filter(Question == "States that allow stronger local tobacco control and prevention laws") %>% ggplot(aes(x = DataValue)) + geom_bar()
ggmap::register_google(key = "AIzaSyAPKYO8wG3mQUqSL6Ym4HeSIjkZmCwwVP8")
leaflet(options = leafletOptions(minZoom = 2, maxZoom = 8)) %>%
addProviderTiles("Esri") %>%
setView(lng = -100.166666, lat = 48.166666, zoom = 4) %>%
addMarkers(lng =Tobacco_df2$Longitude, lat = Tobacco_df2$Latitude, popup = Tobacco_df2$State, label = Tobacco_df2$DataValue)