Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions gss2018.rmd
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

<!--Decide on your methods: use "variable analysis" or other appropriate descriptors. Make sure to choose at least one graphical method and at least one numerical method.!-->

##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

<!--Divide this section into two sub-sections: One for your descriptive results and one for your inferential results.!-->

Expand All @@ -69,14 +75,35 @@ Is there a difference in years of education (EDUC) between the those who did or

<!--Graphical results here. Make sure to show your code. Provide appropriate labels for axes, giving units if possible, and provide a good title for the graph, too. Use the graphical results to describe the patterns if any that exist in the data as focused toward the research question!-->

```{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

<!--Numerical results go here. Use the numerical results to describe the patterns if any that exist in the data as focused toward the research question!-->

```{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

<!--State hypothesis clearly. Make sure your discussion of the inferential test covers all the aspects that the test output produces, such as test statistic, p-value etc. Make a decision about the null hypothesis, explain the assumptions on which the selected test/procedure was based, and why the chosen procedure satisfys the assumptions and is appropriate to answer the research question!-->

```{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

<!--In this section you explain what you are trying to show. Where did the data come from? What is the research or other question you are trying to answer?!-->
Expand Down