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.
We are 95% 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.
Answer: This statement is False as confidence level is implied to an whole population not for a sample.
We are 95% confident that between 43% and 49% of Americans support the decision of the U.S. Supreme Court on the 2010 healthcare law.
Answer: This statement is True as this scenario talks about the whole population which is 46% (+/-3%). Or 43% to 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 U.S. Supreme Court, 95% of those sample proportions will be between 43% and 49%.
Answer: True. As long as Sample size, population size and percentage stays the same.
The margin of error at a 90% confidence level would be higher than 3%.
ANswer: False. As the Confidence level increases, the critical value increases and margin of error increases. In this case, Confidence level decrease, critical value decreases. As a result margin of error will be lower than 3%
Legalization of marijuana, Part I. (6.10, p. 216) The 2010 General Social Survey asked 1,259 US res- idents: “Do you think the use of marijuana should be made legal, or not?” 48% of the respondents said it should be made legal.
Answer: It is a sample statistic. According to the scenario, it is a survey asked from a 1259 residents, not whole population.
n <- 1259 #sample population
P <- 0.48 #proportion responded (48%)
SE <- sqrt((P * (1-P)) / n) #standard error
me <- 1.96 * SE #calculating margin of error using critical value*standard error
#lower and upper confidence level
lower <- P-me
higher <- P+me
round(lower,2) ; round(higher,2)
## [1] 0.45
## [1] 0.51
Answer: We can assume that the surveyed 1259 us residents are randomly selected and that number is less than 10% of the population. There for the sample is independent and follows a normal distribution.
# Margin of Error
round(me, 2)
## [1] 0.03
This sample can be gerneralized to its population. We are 95% confidenct that between 45% and 51% of US residents think that marijuana should be leagalized. That percentage does cover half of the amerians but we can not say it is the majority.
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 ?
# find the sample size n.
NEWme <- 0.02
p <- 0.48
z <- 1.96
SE <- NEWme/z
n <- round(p * (1-p)/SE^2)
n
## [1] 2397
Answer: To have margin of error no later than 2% at a 95% confidence interval for the proportion of US residents who thought marijuana should be legalized, you have to have a sample size of 2397
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.
# Random sample size of California and Oregon
n_CA <- 11545
n_OR <- 4691
# Proportion of residents with sleep deprivation
p_CA <- 0.08
p_OR <- 0.088
# Difference of the proportions
p <- p_CA - p_OR
SE_CA <- (p_CA * (1-p_CA))/n_CA
SE_OR <- (p_OR * (1-p_OR))/n_OR
SE_p <- sqrt(SE_CA + SE_OR)
# Margin of error for the proportion standard error
ME <- 1.96 * SE_p
ME
## [1] 0.009498128
#Calculating Confidence intervals
lower <- round(p - ME, 3)
higher <- round(p + ME, 3)
lower; higher
## [1] -0.017
## [1] 0.001
Answer: We are 95% confidence that the different of Californian and Oregon residence with sleep deprevation is between -0.017 and 0.001
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.
Write the hypotheses for testing if barking deer prefer to forage in certain habitats over others.
Answer:
Ho There is no difference in the proportion of deer that forage in certain habitats.
HA There is a difference in the proportion of the deer that forage in certain habitats.
What type of test can we use to answer this research question?
Answer:
Goodness of fit test using chi-square
habitat <- c(4,16,67,345)
expected <- c(20.45, 62.62, 168.70, 174.23)
k <- length(habitat)
df <- k-1
# Loop over the bin values to compute the chi2 test statistic
chi2 <- 0
for(i in 1:length(habitat))
{
chi2 <- chi2 + ((habitat[i] - expected[i])^2 / expected[i])
}
chi2
## [1] 276.6286
# check the chi2 test statistic and lookup p-val
pVal <- pchisq(chi2, df=df, lower.tail=FALSE)
pVal
## [1] 1.135815e-59
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.
{}
#overall proportion of Women who do suffer from depression
P_Dep <- 2607/50739
P_Dep
## [1] 0.05138059
#overall proportion of Women who do not suffer from depression
P_NoDep <- 48132/50739
P_NoDep
## [1] 0.9486194
#Expected count
exp <- 6617*P_Dep
exp
## [1] 339.9854
# Contribution to Test Statistics
TS <- (373-exp)^2/exp
TS
## [1] 3.205914
# df (degree of freedom)= (number of rows minus 1) × (number of columns minus 1)
# 2 rows and 5 columns
df <- (2-1)*(5-1)
df
## [1] 4
# P-value
Pval <- 1-pchisq(20.93,4)
Pval
## [1] 0.0003269507
As P-value is less than 0.05, we reject the null hypothesis. The data does not provide convincing evidence that there is a difference in the amount of coffee consumption by women with depression women without depression.
I agree. The study only shows the statistical significance and not practical significance. There could me more other variables in play that is not included in this study.