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.
False. The 95% confidence interval is an inferential statistic about the population not the sample.
True. The 95% confidence interval is a population parameter which provides a range of support, 43% to 49%.
False. The 95% confidence interval estimates population parameter. It does not say anything about
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.
It’s a sample statistic, a point estimate for the population. The 48% is the percentage of the 1,259 people in the sample.
The 95% confidence interval is (45.24%, 51%), and the MOE is 2.76%
n <- 1259
p <- .48
z <- 1.96
SE <- ((sqrt((p*(1-p))/n)))
MOE <- z*SE
lower_tail <- p - MOE
upper_tail <- p + MOE
lower_tail## [1] 0.4524028
upper_tail## [1] 0.5075972
MOE## [1] 0.02759723
The conditions for this sampling being nearly normal has been met in this study because: 1. Since the number of observations are greater than 30, we can assume normality. 2. The success-failure condition needs at least 10 successes and 10 failures. In this study, we see 604 successes and 654 failures.
successes <- p*n
failures <- (1-p)*n
successes## [1] 604.32
failures## [1] 654.68
This news statement is inaccurate. The confidence interval provides a range of possible population parameters from 45% to 50%. A clear majority of Americans is not in this interval.
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 ?
Approximately 2,397 Americans would need to be surveyed to limit a MOE of a 95% CI to 2%
numerator = .48*.52
denominator = (.02/1.96)
ans<- numerator/(denominator)^2
ans## [1] 2397.158
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 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.
First, we have to check two conditions. The first condition is that each sample follows a normal distribution. Each sample is less than 10% of the population and is over 30 respondents, so we can assume normality. The second condition is that the samples are independent of each other. Since the samples were taken in two different cities, we can assume that they are independent.
The number of Californians who are more sleep deprived than Oregonians is between 1.75% and .15% higer at a 95% COnfidence leve.
sample_means_diff = .08 - .088
ORE_p = .088
ORE_n = 4691
ORE_pp = ORE_p*(1-ORE_p)
CAL_p = .08
CAL_n = 11545
CAL_pp = CAL_p*(1-CAL_p)
SE = sqrt(((ORE_pp/ORE_n)+(CAL_pp/CAL_n)))
z = 1.96
MOE = z*SE
lower_bound = sample_means_diff - MOE
upper_bound = sample_means_diff + MOE
lower_bound## [1] -0.01749813
upper_bound## [1] 0.001498128
MOE## [1] 0.009498128
SE## [1] 0.004845984
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.
Woods Cultivated_grassplot Deciduous_forests Other Total 4 16 61 345 426
Write the hypotheses for testing if barking deer prefer to forage in certain habitats over others. ### Answer Null Hypothesis: Barking deer prefer to forage all habitats equally. Alt Hypothesis: Barking deer prefer to forage in certain habitats.
What type of test can we use to answer this research question? ### Answer In this problem, we are given a sample that can be classified into different groups, and to determine if these groups are representative of the population, we use a chi-square, goodness of fit test.
Condition one: Independence. Each case that contributes a count to the table must be independent of all the other cases in the table. This condition is satisfied because each parcel of land is independent of each other.
Condition two: Sample size / distribution. Each particular scenario (i.e. cell count) must have at least 5 expected cases. This condition is satisfied because there are more than 5 observations in the expected count.
#Expected values
E1 = .048*426
E2 = .147*426
E3 = .396*426
E4 = .409*426
#Observed values minus expected values divided by null counts
Z1 = (4-E1)^2 / E1
Z2 = (16-E2)^2 / E2
Z3 = (61-E3)^2 / E3
Z4 = (345-E4)^2 /E4
chiSquare = Z1 +Z2 +Z3+Z4
chiSquare ## [1] 284.0609
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 ca???einated co???ee consumption.63
This is a chi square test of for independence of two variables caffeine consumption an depression.
Null Hypothesis: Depression and caffeine consumption are independent Alt Hypothesis ; Depression and caffeine consumption are dependendent
5.14% of the women suffer from depression 94.86% of the women do not suffer from depression
suffer_depress <- 2607/50739
not_suffer_depress <- 48132/50739
suffer_depress## [1] 0.05138059
not_suffer_depress## [1] 0.9486194
The expected count is 339.98 and the contribution of the cell is 3.206
Expected = suffer_depress*6617
Observed = 373
cell = ((Observed-Expected)^2 )/ Expected
cell## [1] 3.205914
P-value < 0.001. More precisely, it’s 0.0003269507.
df = (5-1)*(2-1)
df## [1] 4
pchisq(20.93,df,lower.tail = FALSE)## [1] 0.0003269507
Given that the P-value is < 0.05, we reject the null hypothesis. The two variables are dependent.
Yes. I agree with the author. The hypothesis test rejected the hypothesis that there is no independence between the two variables, but that does not imply causation. There may be other lurking variables as well.