6.6 2010 Healthcare Law. On June 28, 2012 the U.S. Supreme Court upheld the much debated 2010 healthcare law, declaring it constitutional. A Gallup poll released the day after this decision indicates that 46% of 1,012 Americans agree with this decision. At a 95% confidence level, this sample has a 3% margin of error. Based on this information, determine if the following statements are true or false, and explain your reasoning.39
“False”. We are 100% confident that between 43% and 49% of Americans in this sample support the decision of the U.S. Supreme Court on the 2010 healthcare law.
“True”, this is the definition of confidence interval.
“True”, this is also the definition of confidence interval
“Falese”, Margin of error = Z * Standard of Error. If this is a 90% confidence interval, the Z would correspond to: 1.65. Therefore, the margin of error would be smaller.
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
This is sample statistics, because it was from a samples size of 1,259 US residents and it was not from all us population.
SE <- sqrt(.48*(1 - .48)/1259)
lo <- .48 - 1.96 * SE
hi <- .48 + 1.96 * SE
c(lo, hi)
## [1] 0.4524028 0.5075972
Yes, sample proportions are characteried by a nearl normal distribution when 2 conditons are satified: 1. each observatons must be independent; 2. we must have at least 10 sucesses and 10 failures in our sample. We have 1,259 samples, so we can consider this is a fairly large smaple size. While having a normal model, we can perform 95% confidencer interval.
No, this statement is not justified. Only if the true population proportion is at the very upper most limit of our confidence interval then 50.8 percent of Americans would agree that marijuana should be legalized. That would be only very slightly more than half.
6.20 Legalize Marijuana, Part II. 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 ?
n <- 1.96^2 * 0.48 * 0.52 / 0.02^2
print(n)
## [1] 2397.158
2398 US residents we need to survey
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 insu"cient 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 di???erence between the proportions of Californians and Oregonians who are sleep deprived and interpret it in context of the data.53
p_ca <- 8/100
p_or <- 8.8/100
n_ca <- 11545
n_or <- 4691
se <- sqrt(p_ca * (1 - p_ca) / n_ca + p_or * (1 - p_or) / n_or)
point_est <- p_ca - p_or
lo <- point_est - 1.96 * se
hi <- point_est + 1.96 * se
c(lo, hi)
## [1] -0.017498128 0.001498128
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 Woods Cultivated grassplot Deciduous forests Other Total 4 16 67 345 426
\(H_0\): - Barking deer do not prefer one habitat over another for foraging.
\(H_A\): - Barking Deer do prefer one or more habitats over other habitats for foraging.
chi square test
woods <- round(426 * .048)
woods
## [1] 20
cultivated_grass <- round(426 * .147)
cultivated_grass
## [1] 63
decidous_forest <- round(426 * .396)
decidous_forest
## [1] 169
other <- round(426 * (1-(.048 + .147 + .396)))
other
## [1] 174
The conditions are satisfied. (1) counts are all more than 5; (2) each case is assumed to be independent.
\(H0\): Barking deer prefer each habitat equally likely \(HA\): Barking deer prefer some habitat over other
chi <- (4-woods)^2/woods + (16-cultivated_grass)^2/cultivated_grass + (61-decidous_forest)^2/decidous_forest + (345-other)^2/other
chi
## [1] 284.933
options(scipen = 999)
pchisq(chi, 3, lower.tail = FALSE)
## [1] 0.0000000000000000000000000000000000000000000000000000000000001813092
Because our p value is much smaller than 0.05, we reject the null hypotheis.
6.48 Co???ee and Depression. Researchers conducted a study investigating the relationship between ca???einated co???ee 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 ca???einated co???ee 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 ca???einated co???ee consumption.63
two table chi square test
\(H0\): The proportion of clinically depressed women is not associated with the amount of coffee they comsumpted. \(HA\): The proportion of clinically depressed women is associated with the amounts of coffee they cosumpted.
# Women who suffer from depression
p_do <- 2607/50739
p_do
## [1] 0.05138059
# Women who do not suffer from depression
p_do_not <- 48132/50739
p_do_not
## [1] 0.9486194
# A: <= 1 cup per week; B:2-6 cups per week; C: 1 cup per day; D: 2-3 cups per day; E: >=4 cups per day.
A.do <- p_do * 12215
A.do.not <- p_do_not * 12215
B.do <- p_do * 6617
B.do.not <- p_do_not * 6617
C.do <- p_do * 17234
C.do.not <- p_do_not * 17234
D.do <- p_do * 12290
D.do.not <- p_do_not * 12290
E.do <- p_do * 2383
E.do.not <- p_do_not * 2383
#------------------------------------
# Expected values
paste("Expected Value: 2 to 6 cups/week & depressed: ", B.do)
## [1] "Expected Value: 2 to 6 cups/week & depressed: 339.985395849347"
paste("Calculation for the test statistic: ", (373-B.do)^2/B.do)
## [1] "Calculation for the test statistic: 3.20591443200495"
df <- (2-1) * (5-1)
p <- pchisq(20.93, df, lower.tail = FALSE)
p
## [1] 0.0003269507
because p <0.05, we reject the null hypothesis. We conclude that coffee comsumption has effect to develop depression in women.
I agree because this is just an observation.