Problem Set 1 Jake Brentnall format: html ## Questions 1 and 2 ’’’{r}

turnout <- read.csv(“https://raw.githubusercontent.com/kosukeimai/qss/master/INTRO/turnout.csv”) nrow(turnout) nrow(turnout) NROW(turnout) exists(“turnout”) turnout <- read.csv(“https://raw.githubusercontent.com/kosukeimai/qss/master/INTRO/turnout.csv”) nrow(“turnout”) turnout<-read.csv(“https://raw.githubusercontent.com/kosukeimai/qss/master/INTRO/turnout.csv”) > turnout<-read.csv(“https://raw.githubusercontent.com/kosukeimai/qss/master/INTRO/turnout.csv”) > turnout <- read.csv(“https://raw.githubusercontent.com/kosukeimai/qss/master/INTRO/turnout.csv”) > turnout <- read.csv(“https://raw.githubusercontent.com/kosukeimai/qss/master/INTRO/turnout.csv”) nrow(turnout) range(turnout$year) ’’’

dim(turnout) [1] 14 9 summary(turnout) year VEP VAP total
Min. :1980 Min. :159635 Min. :164445 Min. : 64991
1st Qu.:1986 1st Qu.:171192 1st Qu.:178930 1st Qu.: 73179
Median :1993 Median :181140 Median :193018 Median : 89055
Mean :1993 Mean :182640 Mean :194226 Mean : 89778
3rd Qu.:2000 3rd Qu.:193353 3rd Qu.:209296 3rd Qu.:102370
Max. :2008 Max. :213314 Max. :230872 Max. :131304

  ANES           felons         noncit         overseas       osvoters  

Min. :47.00 Min. : 802 Min. : 5756 Min. :1803 Min. :263
1st Qu.:57.00 1st Qu.:1424 1st Qu.: 8592 1st Qu.:2236 1st Qu.:263
Median :70.50 Median :2312 Median :11972 Median :2458 Median :263
Mean :65.79 Mean :2177 Mean :12229 Mean :2746 Mean :263
3rd Qu.:73.75 3rd Qu.:3042 3rd Qu.:15910 3rd Qu.:2937 3rd Qu.:263
Max. :78.00 Max. :3168 Max. :19392 Max. :4972 Max. :263
NAs :13 ’’’

Question 1 revelas that the data has 14 rows and 9 columns and an interesting outlook on how overseas votes stayed stable at 263 , Question 2 on the other hand, reveals that the 14 rows span from 1980-2008

Question 3 ’’‘{r} turnout$VEP[8] [1] 182623’’’ The VEP ended up being 182,623 in row 8 which means that 182.6 million Americans were able to vote that year.

Question 4 ’’’{r} mean(turnour\(VAP) mean(turnout\)VAP) [1] 194225.9

’’’ Question 4 reveals the average VAP across 1980-2008 which ended up being 194.2 million people on average.

Question 5 ’’‘{r} turnout\(total/turnout\)VEP min(turnout\(VEP.turnout) turnout\)VEP.turnout<-turnout\(total/turnout\)VEP min(turnou\(VEP.turnout) min(turnout\)VEP.turnout) [1] 0.3809316 max(turnout$VEP.turnout) [1] 0.6155433’’’ Question 5 explores how a min of 38% and max of 61% of the voting age population turnout.

Question 6 ’’‘{r} turnout\(ANES.turnout<-turnout\)ANES/100 cor(turnout\(VEP.turnout, turnout\)ANES) [1] 0.9534174’’’ Question 6 shows the positive correlation between ANES and VEP to be positive.THe correaltion between the two is 0.95 which means voters are likely to self-report on the ANES study after voting.

Question 7 ’’‘{r} turnout\(diff<-turnoutVEP.turnout-turnout\)ANES.turnout turnout\(diff<-turnout\)VEP.turnout-turnout\(ANES.turnout mean(turnout\)diff) [1] -0.1683634’’’ Question 7 reveals that ANES overestimates turnout by 16.8 percent wehich shows that people lie on surveys most likely due to social pressure from their peers. libray(tidyverse) library(tidyverse)

Question 8 ’’‘{r} turnout\(pres<-ifelse(turnout\)year %% 4== 0) turnout\(pres <- ifelse(turnout\)year %% 4 == 0, “presidential”, “midterm”) tapply (turnout\(diff, turnout\)pres, mean) midterm presidential -0.154288 -0.178920’’’ Question 8 reveals the bias within the ANES is greater in presidential elections which can be attributed to voter turnout or more social pressure

Question 9 ’’‘{r} library(ggplot2) > plot(turnout\(year, turnout\)diff, type = “b”, + xlab = “Year”, ylab = “VEP turnout rate minus ANES turnout rate”, + main = “Bias in Self-Reported Turnout Over Time”)’’’