In class we analyzed data on whether taller US presidential candidate won the el
ID: 3272058 • Letter: I
Question
In class we analyzed data on whether taller US presidential candidate won the election. Let denote the probability that the taller won. Repeat this analysis but include data through 2016, at the significance level =0.05. Added to data given in class are 1996 Clinton (taller) vs Dole, 2000 G·W.Bush vs Kerry (taller), 2004 Obama (taller) vs McCain, 2008 Obama vs Rommney (taller) and 2016 Trump (taller) vs Clinton: The Winner Taller Shorter Total 16 4 20 1. Test Ho:05 vs. Ha:u #0.5 using the exact method what is the p-value and conclusion? Using P(Y = y)-(, (.5)"(1-.5)(n-v), I computed the probability distribution and got y PCY-y) y P(Y-) 0 1 00002 11 16018 2 3 .00109 13 .07393 4 5 .01479 15 01479 00018 12 . 12013 4 00462 14 .03696 6 .03696 16 .00462 7.07393 17 8 9 .00109 12013 18 00018 9 16018 19.00002 10 Test Ho: = 0.5 vs. Ha: u >0.5 using the exact method. What is the p-value and conclusion? .17620 20 2. Test Ho: = 0.5 vs. Ha: u #0.5 using z-test (asymptotic). Hint: 1-pnorm(2.68) in R gives you 0.0037. 3.Explanation / Answer
1) The R snippet is as follows
y<- c(0,0.00002,.00018,.00109,.00462,.01479,.03696,.07393,.12013,.16018,.17620,.16018,.12013,.07393,.03696,.01479,.00462,.00109,.00018,.00002,.0)
## t test for comparison
t.test(y,mu=0.5,alternative = "two.sided")
## mu >0.5
t.test(y,mu=0.5,alternative = "greater")
#########
The results are
t.test(y,mu=0.5)
One Sample t-test
data: y
t = -33.249, df = 20, p-value < 2.2e-16 ## as the p value is less than 0.05 , hence we reject null hypothesis and conclude that mu is not equal to 0.05
alternative hypothesis: true mean is not equal to 0.5
95 percent confidence interval:
0.01923755 0.07600054
sample estimates:
mean of x
0.04761905
t.test(y,mu=0.5,alternative = "greater")
One Sample t-test
data: y
t = -33.249, df = 20, p-value = 1 , as the p value is not less than 0.05 , hence we fail to reject null hypothesis
alternative hypothesis: true mean is greater than 0.5
95 percent confidence interval:
0.02415263 Inf
sample estimates:
mean of x
0.04761905
Please note that we can answer only 1 full question at a time as per the answering guidelines . I have answered 2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.