We are 95% confident that between 43% and 49% of Americans in this sample support the decision of the US Supreme Court on the 2010 healthcare law.
We are 95% confident that between 43% and 49% of Americans support the decision of the US Supreme Court on the 2010 healthcare law.
+This statement is true based on the definition of confidence interval 46-3, 46+3 (43, 49).
If we considered many random samples of 1,012 Americans, and we calculated the sample proportions of those who support the decision of the US Supreme Court, 95% of those sample proportions will be between 43% to 49%.
The margin of error at a 90% confidence level would be higher than 3%.
zstar <- 1.96
n.cali <- 11545
n.oregon <- 4691
mean.cali <- .08
mean.oregon <- .088
meandiff <- mean.cali - mean.oregon
SE <- sqrt((((mean.cali)*(1-mean.cali)/n.cali)+mean.oregon)*(1-mean.oregon)/(n.oregon))
CIUPPER <- meandiff+(zstar*SE)
CILOWER <- meandiff-(zstar*SE)
CI.28 <- c(CILOWER, CIUPPER)
CI.28
## [1] -0.0161073298 0.0001073298
##our CI is (-.0161, 0001). Since our CI includes 0, we can say that there no significance data supporting that there is a difference in the sleep deprivation of Californians and Oregonians.
Check if the assumptions and conditions required for this test are satisfied.
Do these data provide convincing evidence that barking deer prefer to forage in certain habitats over others? Conduct an appropriate hypothesis test to answer this research question.
#see attachment for calculations
chisquare <- pchisq(284.067, 3, lower.tail =FALSE)
chisquare
## [1] 2.791297e-61
#our chi-square pvalue is 2.791297e-61 or 0 so we can conclude that the data does not support that barking deer forage in certain areas over others.
What type of test is appropriate for evaluating if there is an association between coffee intake and depression?
Write the hypotheses for the test you identified in part (a).
Calculate the overall proportion of women who do and do not suffer from depression.
depression <- 2607
no.depression <- 48132
total <- depression + no.depression
prop.depression <- depression/total
prop.nodepression <- no.depression/total
prop.depression
## [1] 0.05138059
prop.nodepression
## [1] 0.9486194
#.05 have depression and .95 do not
#using the proportions from above
expected <- prop.depression*6617
expected
## [1] 339.9854
observed <- 373
statistic <- ((observed-expected)^2)/expected
statistic
## [1] 3.205914
#contribution of this cell is 3.21
*The test statistic is chi-squared = 20.93. What is the pvalue?
pvalue <- pchisq(20.93, 4)
pvalue <- 1-pvalue
pvalue
## [1] 0.0003269507
#our pvalue is .0003
*What is the conclusion of the hypothesis test?
+ Because our pvalue is less than .05, we can conclude that there is not enough data supporting the association between caffinated coffee consumption and depression ie fail to reject the null hypothesis.
One of the authors of this study was quoted on the NYTimes as saying it was“too early to recommend that women load up on extra coffee” based on just this study. Do you agree with this statement? Explain.