head(health)
names(health)
[1] "FIPS"
[2] "Name of Area"
[3] "Qualifying Name"
[4] "State"
[5] "County"
[6] "Physically Unhealthy Days per Month (Persons 18 Years and Over)"
[7] "Mentally Unhealthy Days per Month (Persons 18 Years and Over)"
[8] "Percent of Adults That Report Fair or Poor Health (Persons 18 Years and Over)"
[9] "Percent of Low Birthweight Births (<2.5kg)"
[10] "Low Birthweight Births (<2.5kg)"
[11] "Primary Care Physicians (PCP)"
[12] "Mental Health Providers (MHP)"
[13] "Dentists"
[14] "Primary Care Physicians (PCP) Rate per 100,000 Population"
[15] "Mental Health Providers (MHP) Rate per 100,000 Population"
[16] "Dentists Rate per 100,000 Population"
[17] "Health Care Costs Price-adjusted Medicare Reimbursements"
[18] "Percent of Persons Without Insurance (Population Under 19 Years, 2013 est.)"
[19] "Percent of Persons Without Insurance (Population 18 to 64 Years, 2013 est.)"
[20] "Percent of Persons Without Insurance (Population Under 65 Years, 2013 est.)"
[21] "Persons Without Insurance (Population Under 19 Years, 2013 est.)"
[22] "Persons Without Insurance (Population 18 to 64 Years, 2013 est.)"
[23] "Persons Without Insurance (Population Under 65 Years, 2013 est.)"
[24] "Premature Deaths (Less than 75 Years)"
[25] "Years of Potential Life Lost (YPLL) Rate per 100,000 Population (Less than 75 Years)"
[26] "Infant Mortality (Death Counts)"
[27] "Child Mortality (Death Counts)"
[28] "Premature Age-adjusted Mortality (Death Counts)"
[29] "Drug Poisoning Mortality (Death Counts)"
[30] "Infant Mortality Rate per 1,000 Live Births"
[31] "Child Mortality Rate per 1,000 Population"
[32] "Premature Age-adjusted Mortality Rate per 100,000 Population"
[33] "Drug Poisoning Mortality Rate per 100,000 Population"
[34] "Percent Diabetics (Adults)"
[35] "Percent of Diabetic Medicare Enrollees Receiving Hba1c Test"
[36] "Diabetics"
[37] "Diabetic Medicare Enrollees (Out of Total Medicare Enrolles)"
[38] "Teen Birth Count (Females 15 to 19 Years)"
[39] "Chlamydia Cases (Count)"
[40] "HIV Prevalence (Count)"
[41] "Teen Births Rate per 100,000 Population (Females 15 to 19 Years)"
[42] "Chlamydia Cases Rate per 100,000 Population"
[43] "HIV Prevalence Rate per 100,000 Population"
[44] "Percent Current Smokers (Persons 18 Years and Over)"
[45] "Percent Drinking Adults (Persons 18 Years and Over)"
[46] "Percent of Persons with Limited Access to Healthy Foods"
[47] "Percent of Persons with Access to Exercise Opportunities"
[48] "Percent Obese Persons (20 Years and Over)"
[49] "Percent Percent Physically Inactive Persons (20 Years and Over)"
[50] "Percent of Children Eligible for Free Lunch (Persons < 18 Years)"
[51] "Food Environment Index"
new_health<-select(health, "Qualifying Name" : "Dentists Rate per 100,000 Population","Percent Drinking Adults (Persons 18 Years and Over)" )
names(new_health)
[1] "Qualifying Name"
[2] "State"
[3] "County"
[4] "Physically Unhealthy Days per Month (Persons 18 Years and Over)"
[5] "Mentally Unhealthy Days per Month (Persons 18 Years and Over)"
[6] "Percent of Adults That Report Fair or Poor Health (Persons 18 Years and Over)"
[7] "Percent of Low Birthweight Births (<2.5kg)"
[8] "Low Birthweight Births (<2.5kg)"
[9] "Primary Care Physicians (PCP)"
[10] "Mental Health Providers (MHP)"
[11] "Dentists"
[12] "Primary Care Physicians (PCP) Rate per 100,000 Population"
[13] "Mental Health Providers (MHP) Rate per 100,000 Population"
[14] "Dentists Rate per 100,000 Population"
[15] "Percent Drinking Adults (Persons 18 Years and Over)"
library(dplyr)
total_health<- new_health %>% mutate("Total Unhealthy" = `Physically Unhealthy Days per Month (Persons 18 Years and Over)` + `Mentally Unhealthy Days per Month (Persons 18 Years and Over)`)
names(total_health)
[1] "Qualifying Name"
[2] "State"
[3] "County"
[4] "Physically Unhealthy Days per Month (Persons 18 Years and Over)"
[5] "Mentally Unhealthy Days per Month (Persons 18 Years and Over)"
[6] "Percent of Adults That Report Fair or Poor Health (Persons 18 Years and Over)"
[7] "Percent of Low Birthweight Births (<2.5kg)"
[8] "Low Birthweight Births (<2.5kg)"
[9] "Primary Care Physicians (PCP)"
[10] "Mental Health Providers (MHP)"
[11] "Dentists"
[12] "Primary Care Physicians (PCP) Rate per 100,000 Population"
[13] "Mental Health Providers (MHP) Rate per 100,000 Population"
[14] "Dentists Rate per 100,000 Population"
[15] "Percent Drinking Adults (Persons 18 Years and Over)"
[16] "Total Unhealthy"
Summarizing “Total Unhealthy” and “Qualifying Name” variables and filtering out missing NA values as well.
Summ_unhealthy<- total_health %>% filter(!is.na(`Total Unhealthy`)) %>%
group_by(`Qualifying Name`) %>%
summarise(total_unhealth = sum(`Total Unhealthy`))
Summ_unhealthy
Creating a plot to see if there is any correlation between % of drinking adults and total number of reported unhealthy days per month.
ggplot(data=total_health, aes(x=`Percent Drinking Adults (Persons 18 Years and Over)`,
y=`Total Unhealthy`)) +
geom_bar(stat="identity",fill="darkorange1") + ggtitle("Data distribution of Drinking Adults (%) and reporting of feeling unhealthy")
NA