2010 Healthcare Law. (6.48, p. 248) 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.
False–the confidence interval applies to all of the population, and not exclusively the sample.
True. 43% to 49% is the confidence interval range for the population
False– confidence intervals relate to the population proportion, rather than for the sample proportion
False – at a 90% confidence interval, the margin of error would be lower.
Legalization of marijuana, Part I. (6.10, p. 216) 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.
48% is a sample statistic, since this survey is a sample of a population.
n = 1259
p = 0.48
q = 0.52
z = 1.96
high_CI <- p + z * sqrt((p*q)/n)
high_CI
## [1] 0.5075972
low_CI <- p - z * sqrt((p*q)/n)
low_CI
## [1] 0.4524028
Stand_error <- sqrt((0.48 * (1 - 0.48))/1259)
# Lower and Upper limit:
Lower <- 0.48 - (qnorm(0.975)*Stand_error)
Upper <- 0.48 + (qnorm(0.975)*Stand_error)
paste('A 95% confidence interval is',
round(Lower*100, 2) , ' and ', round(Upper*100, 2) )
## [1] "A 95% confidence interval is 45.24 and 50.76"
Yes–the data follows a normal distribution since every observation is independent. We can see that the sample is certainly not larger than 10% of the US population. Also, according to the success-failure condition, our samples sizes must be large enough such that the rates of success and failure are greater than 10. We can verify this by multiplying the upper and lower bounds of the confidence interval by the sample size.
Because our upper confidence interval is greater than 50%, we can say this statement is somewhat justified.
Legalize Marijuana, Part II. (6.16, p. 216) As discussed in Exercise above, 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 = (0.48 * (1 - 0.48)) / (0.02 / (qnorm(0.975)))^2; ceiling(n)
## [1] 2398
Sleep deprivation, CA vs. OR, Part I. (6.22, p. 226) According to a report on sleep deprivation by the Centers for Disease Control and Prevention, the proportion of California residents who reported insuffient 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.
A 95% confidence interval for the given sample is -15.20% and 16.8%
#Calculating standard error for both California and Oregon
cali_stand_err <- sqrt((0.08 * (1 - 0.08))/11545)
ore_stand_err <- sqrt((0.088 * (1 - 0.088))/4691)
#Finding the difference in proportion of California's and Oregon's standard errors
stand_error_diff_CA_OR <- sqrt(cali_stand_err + ore_stand_err)
#Finding the bounds of the confidence interval for the difference of proportions
low <- (0.088 - 0.08) - (qnorm(0.975)*stand_error_diff_CA_OR)
up <- (0.088 - 0.08) + (qnorm(0.975)*stand_error_diff_CA_OR)
low
## [1] -0.1519639
up
## [1] 0.1679639
Barking deer. (6.34, p. 239) 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.
Null: Barking deer has no preference forgaging in habitats Alternative: Barking deer have preferences for foraging in habitats
Chi-square test
We must check for independence, which holds true, and for the sample size of the land to be at least 5%. In this case, the sample size is 4.8%, which is close enough to 5.
According to our Chi-Square test, there is evidence that barking deer favor certain habitats for foraging. Therefore, we reject the null hypothesis.
k <- 4
df <- k-1
# Percentages of land distribution
p_woods <- .048
p_cult_grass <- .147
p_decid_forests <- .396
p_other <- 1 - (p_woods + p_cult_grass + p_decid_forests)
# Where deer forage
sites <- 426
f_woods <- 4
f_cult_grass <- 16
f_decid_forests <- 61
f_other <- sites-(f_woods + f_cult_grass + f_decid_forests)
# Expected values
expec_woods <- sites * p_woods
expec_cultivated_grass <- sites * p_cult_grass
expec_decid_forests <- sites * p_decid_forests
expec_other <- sites * p_other
# Z Values
woods_z <- (f_woods - expec_woods)/sqrt(expec_woods)
cultivated_grass_z <- (f_cult_grass - expec_cultivated_grass)/sqrt(expec_cultivated_grass)
deciduous_forests_z <- (f_decid_forests - expec_decid_forests)/sqrt(expec_decid_forests)
other_z <- (f_other - expec_other)/sqrt(expec_other)
# Test statistic
chi_squared <- (woods_z^2) + (cultivated_grass_z^2) + (deciduous_forests_z^2) + (other_z^2)
chi_squared
## [1] 284.0609
p <- pchisq(chi_squared, df=df, lower.tail=FALSE)
p
## [1] 2.799724e-61
Coffee and Depression. (6.50, p. 248) 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.
A chi-square test for two ways is appropriate for evaluating this association.
Null Hypothesis: There is no difference in depression amongst women who drink caffinated coffee. Alternative Hypothesis: There is a difference in depression amongst women who drink caffinated coffee.
depressed <- 2607
not_depressed <- 48132
total <- depressed + not_depressed
suffer_depress <- depressed/total
suffer_depress
## [1] 0.05138059
do_not_suffer_depress <- not_depressed/total
do_not_suffer_depress
## [1] 0.9486194
expected_count = 6617*0.0514
round(expected_count, digit = 0)
## [1] 340
t <- (373 - expected_count)^2/expected_count
t
## [1] 3.179824
k <- 5
df <- k - 1
p <- pchisq(20.93, df=df, lower.tail=FALSE)
p
## [1] 0.0003269507
We reject the null hypothesis–we can conclude that women demonstrate a difference in depression based on drinking caffeinated coffee.
The study only indicates that there’s a statistical difference between the groups, and not necessarily causes nor prevents depression.