FALSE, 100% confident regarding the sample itself.
TRUE, 46% +- 3%/definition of 95% CI.
TRUE, definition of 95% CI.
FALSE, ME inversely proportional to Z score
Sample statistic, describes sample attribute not attribute of entire population.
# n = 1,259
# p = .48
48 - 1.96*sqrt(0.48*(1-0.48)/1259)
## [1] 47.9724
48 + 1.96*sqrt(0.48*(1-0.48)/1259)
## [1] 48.0276
95% CI: (47.9724, 48.0276)
Sample is less than 10% of population, so independent observations reasonable.
Greater than 10 successes and failures, so can assume sample is large enough to avoid being impacted severely by skew.
Assuming the other percentage is “don’t think marijuana should be legal”, this study actually shows a majority do not hold the opinion “marijuana should be legalized”.
As discussed in Exercise 6.12, the 2010 General Social Survey reported a sample where about 48% of US residents thought marijuana should be made legal. If we wanted to limit the margin of error of a 95% confidence interval to 2%, about how many Americans would we need to survey ?
ME = 0.02 = 1.96 * SE = 1.96 * sqrt(p(1-p)/n) solve for n
0.48*(1 - .48)/((0.02/1.96)^2)
## [1] 2397.158
Should survey 2398 Americans.
According to a report on sleep deprivation by the Centers for Disease Control and Prevention, the proportion of California residents who reported insufficient rest or sleep during each of the preceding 30 days is 8.0%, while this proportion is 8.8% for Oregon residents. These data are based on simple random samples of 11,545 California and 4,691 Oregon residents. Calculate a 95% confidence interval for the difference between the proportions of Californians and Oregonians who are sleep deprived and interpret it in context of the data.
11,545 California - 8.0%
4,691 Oregon residents - 8.8%
# Difference:
0.008
## [1] 0.008
# ME:
0.008 - 1.96*sqrt(0.08*(1-0.08)/11545 + 0.088*(1-0.088)/4691)
## [1] -0.001498128
0.008 + 1.96*sqrt(0.08*(1-0.08)/11545 + 0.088*(1-0.088)/4691)
## [1] 0.01749813
(-0.0015, 0.018)
No significant difference.
4.8*426/100
## [1] 20.448
14.7*426/100
## [1] 62.622
39.6*426/100
## [1] 168.696
40.9*426/100
## [1] 174.234
426 sites where the deer forage,
4 were categorized as woods,
16 as cultivated grassplot,
61 as deciduous forests
345 as other
Ha:
Deer foraged some significantly different proportion of these
Chi-square test
Check if the assumptions and conditions required for this test are satisfied.
Independence: Each case independent of others (might be violated if deer exhibit pack behavior?).
Sample size/distribution: Each case does have at least 5 expected cases. Well, see they actually foraged only 4 woods areas, but I think the expected is based on the null hypothesis?
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
(4 - 20.4)^2/4 + (16 - 62.6)^2/62.6 + (61 - 168.6)^2/168.6 + (174.234 - 345)^2/174.234
## [1] 337.9665
probability <<< 0.001. Evidence that they may prefer specific areas instead of just choosing randomly.
Chi-square tests on a two-way table.
H0: Depression in women does not differ by amount of coffee drank.
HA: Depression in women does differ by amount of coffee drank
Is drinking some greater amount of coffee independent of drinking a lesser amount?
2607/50739 (5.1%) suffer from clinical depression
48132/50739 (95%) do not suffer from clinical depression
2607/50739
## [1] 0.05138059
48132/50739
## [1] 0.9486194
# Depression expected values
2607*12215/50739
## [1] 627.614
2607*6617/50739
## [1] 339.9854
2607*17234/50739
## [1] 885.4932
2607*12290/50739
## [1] 631.4675
2607*2383/50739
## [1] 122.44
# No depression expected values
48132*12215/50739
## [1] 11587.39
48132*6617/50739
## [1] 6277.015
48132*17234/50739
## [1] 16348.51
48132*12290/50739
## [1] 11658.53
48132*2383/50739
## [1] 2260.56
Depression expected values:
627.614
339.9854
885.4932
631.4675
122.44
No depression expected values:
11587.39
6277.015
16348.51
11658.53
2260.56
((607 - 627.614)^2/627.614) +
((373 - 339.9854)^2/339.9854) +
((905 - 885.4932)^2/885.4932) +
((564 - 631.4675)^2/631.4675) +
((95 - 122.44)^2/122.44) +
((11545 - 11587.39)^2/11587.39) +
((6244 - 6277.015)^2/6277.015) +
((16329 - 16348.51)^2/16348.51) +
((11726 - 11658.53)^2/11658.53) +
((2288 - 2260.56)^2/2260.56)
## [1] 18.74621
18.74621
I get a slightly different test statistic Thinking this may be due to rounding errors? 18.74621
Both 20.93 and 18.74 have a p-value < 0.001
Given this conclusion it does seem that the amount of coffee consumption affects the clinical depression
This was an observational study, so causality cannot be attributed.