6.12 Legalization of marijuana, Part I. The 2010 General Social Survey asked 1,259 US residents: “Do you think the use of marijuana should be made legal, or not?” 48% of the respondents said it should be made legal.44
(a) Is 48% a sample statistic or a population parameter? Explain.
It is meant to be a sample statistics representative of the “general society of the US”
(b) Construct a 95% confidence interval for the proportion of US residents who think marijuana should be made legal, and interpret it in the context of the data.
n = 1259
nP = 0.48
sE = sqrt((nP*(1-nP))/n)
t = qt(0.975,n-1)
moe = t*sE
upperTail = nP + moe
lowerTail = nP - moe
c(lowerTail,upperTail)
## [1] 0.4523767 0.5076233
(c) A critic points out that this 95% confidence interval is only accurate if the statistic follows a normal distribution, or if the normal model is a good approximation. Is this true for these data? Explain.
It is probably true. We don’t know how many answers there were to the survey. Assuming it was only “yes” or “no”, then we can induce the other answer “it shouldnt be legal” should be around 52%. This would make a normal distribution.
(d) A news piece on this survey’s ???ndings states, “Majority of Americans think marijuana should be legalized.” Based on your confidence interval, is this news piece’s statement justi???ed?
There is more evidence pointing towards the opposite. However, it is possible considering the upper tail of our confidence interval 0.5076233 is above 50%.
6.28 Sleep deprivation, CA vs. OR, Part I. According to a report on sleep deprivation by the Centers for Disease Control and Prevention, the proportion of California residents who reported insucient 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.53
nH : No difference in sleep deprivation aH : Difference in sleep deprivation
oreP = .088
caliP = .08
nCali = 11545
nOre = 4691
sE = sqrt((caliP*(1-caliP)/nCali)+(oreP*(1-oreP)/nOre))
moe = qnorm(0.975)*sE
upperTail = -0.008 + moe
lowerTail = -0.008 - moe
c(lowerTail,upperTail)
## [1] -0.017497954 0.001497954
The confidence interval contains 0, we fail to reject nH. (null hypothesis)…Sleep deprivation is not significantly different.
6.44 Barking deer. Microhabitat factors associated with forage and bed sites of barking deer in Hainan Island, China were examined from 2001 to 2002. In this region woods make up 4.8% of the land, cultivated grass plot makes up 14.7% and deciduous forests makes up 39.6%. Of the 426 sites where the deer forage, 4 were categorized as woods, 16 as cultivated grassplot, and 61 as deciduous forests. The table below summarizes these data.62
(a) Write the hypotheses for testing if barking deer prefer to forage in certain habitats over others.
null Hypothesis : Land foraged by deer is proportionately distributed by land mass.
alternative Hypothesis : Land foraged by deer is not proportionately distributed by land mass.
(b) What type of test can we use to answer this research question?
A chi-square test may be uesd to answer this question.
(c) Check if the assumptions and conditions required for this test are satis???ed.
SRS compliant, check.
Variables are categorical, check.
Not a contigency table (I’m looking at your woods biome), check.
Assumptions are met, if we do a little math.
wP = round(426*.048,1)
gP = round(426*.147,1)
fP = round(426*.396,1)
oP = round(426*.409,1)
proportions = c(wP,gP,fP,oP)
proportions
## [1] 20.4 62.6 168.7 174.2
(d) 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
x = c(4,16,67,345)
k = 4
dF = 3
chi = 0
for(biome in 1:4){
chi = chi + ((x[biome]-proportions[biome])^2/proportions[biome])
}
p = pchisq(chi,dF,lower.tail = FALSE)
p
## [1] 1.124065e-59
We reject the null hypothesis in favor of the alternative hypothesis. Barking deer do not bark in a proportion to land mass between biomes.
6.48 Coffee and Depression. Researchers conducted a study investigating the relationship between caffeinated coffee consumption and risk of depression in women. They collected data on 50,739 women free of depression symptoms at the start of the study in the year 1996, and these women were followed through 2006. The researchers used questionnaires to collect data on caffeinated coffee consumption, asked each individual about physician-diagnosed depression, and also asked about the use of antidepressants. The table below shows the distribution of incidences of depression by amount of caffeinated coffee consumption.63
(a) What type of test is appropriate for evaluating if there is an association between coffee intake and depression?
We would use a chi-square test to evaluate if there is independence between depression and coffee intake. ####(b) Write the hypotheses for the test you identi???ed in part (a).
null Hypothesis : Coffee intake and depression are independent alternative Hypothesis : Coffe intake and depression are dependent. ####(c) Calculate the overall proportion of women who do and do not suffer from depression.
propOfWomenWithDep = 2607/50739
propOfWomenWithoutDep = 1 - propOfWomenWithDep
Proportion of women with depression is 0.0513806
Propottion of women without depression is 0.9486194
(d) Identify the expected count for the highlighted cell, and calculate the contribution of this cell to the test statistic, i.e. (ObservedExpected)2/Expected.
groups = 5
dF = 4
expected = propOfWomenWithDep*6617
cellFactor = (373 - expected)^2/expected
cellFactor
## [1] 3.205914
(e) The test statistic is X2 = 20.93. What is the p-value
pValue = pchisq(20.93,dF,lower.tail = FALSE)
pValue
## [1] 0.0003269507
(f) What is the conclusion of the hypothesis test?
We reject the null hypothesis in favor of teh alternative hypothesis. Coffee intake and depression are dependent.