diff --git a/gss2018.rmd b/gss2018.rmd index 4774400..00c2620 100644 --- a/gss2018.rmd +++ b/gss2018.rmd @@ -1,7 +1,7 @@ --- title: "General Social Survey" -author: "Your Name" -date: "Year 2020" +author: "Kaylie Brehm" +date: "Summer 2022" output: html_document: number_sections: true @@ -55,11 +55,17 @@ First question - Is opinion on the death penalty (CAPPUN) independent of gun own Is there a difference in years of education (EDUC) between the those who did or did not vote in 2012 (VOTE12)? +$H_0$: There is no difference in years of education between those that did vote and those that didn't in 2012. + +$H_a$: There is a difference in years of education between those that did vote and those that didn't in 2012. + ## Methods -##Results +I will compare the years of education in an individual (categorical) to whether or not that individual voted in 2012 (numerical) using a numerical-categorical analysis. I will use a boxplot graph, some numerical results, and a t-test to analyze this. + +## Results @@ -69,14 +75,35 @@ Is there a difference in years of education (EDUC) between the those who did or +```{r} +boxplot(EDUC~VOTE12,data=GSSdata) +``` + + +Within the graph we see that the median of those who voted in 2012 have about 16 years of education. Of those who voted in 2012, there is a wider spread within each quartile range. The median of those who did not vote in 2012 is about 14. Of those who did not vote in 2012, there is a smaller spread within each quartile range. There are more outliers for years of education in those who did not vote in 2012. + + #### Numerical Descriptive Results +```{r} +favstats(EDUC~VOTE12,data=GSSdata) +``` + +The mean years of education for those who voted in 2012 was about 15.7 while the mean years of education for those who did not vote in 2012 was about 13.4. The standard deviation is higher in those who voted in 2012 which means that the results for years in education are more spread out. + ### Inferential Results +```{r} +t.test(EDUC~VOTE12,data=GSSdata) +``` + +The p-value is 0.0000001248 which is very small. This means I can not conclude that the results were not significant. The null hypothesis was "There is no difference in years of education between those that did vote and those that didn't in 2012." The alternative hypothesis was "There is a difference in years of education between those that did vote and those that didn't in 2012." I reject the null hypothesis due to a p value under 0.05. There was an observed difference in years of education between those who did vote and those that didn't. The t value is about 5.7 so the observable difference is substantial. Although, those who did not vote, had more outliers for years of education. + + # Question 3