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.

  1. 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.
  2. 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.
  3. 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%.
  4. The margin of error at a 90% confidence level would be higher than 3%.

p= 46% of thte 1012 Americans agree with health care law being consitutional n=1012 margin of error is 3%

The Confidence Interval = point est +/- Margin of Error CI= 0.46+/- 0.03 CI = (0.43,0.49)

Answers a) False. The confidence interval calculated applies to a population and not the sample. This sample is based on a point estimate. We know the exact proportion is 46% for this sample as we have a statistic for the given sample. b) True. The 95% confidence interval applies to the population. c) True. If we took many samples of the and created a 95% CI for each then we see about 95% of those confidence intervals would contain the probability above of p-0.46. d) FALSE. As the confidence interval is decreased the margin of error decreases.

p=0.46
n=1012

(success= p*n)
## [1] 465.52
(fail= n*(1-p))
## [1] 546.48
#CI=point_est +/- Margin_error

(CIlow= 0.46- 0.03)
## [1] 0.43
(CIhi=  0.46+0.03)
## [1] 0.49

np= p(n-1)


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.

  1. Is 48% a sample statistic or a population parameter? Explain.

48% is a sample statistic as it is a direct calculation based on the sample.

  1. 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.

It is assumed these are indepent sample. The criteria for normal distribution is meet: np = 604 n(1-p)=654 both greater than 10

Based on the calculation below. We are 95% confident that the proportion of US residents who think marijuana should be made legal is between 45.24% and 50.76%.

n <- 1259
p <- 0.48
SE <- sqrt((p * (1-p))/n)
( ME <- 1.96 * SE )
## [1] 0.02759723
(UpperCI= p+ME)
## [1] 0.5075972
(LowerCI= p-ME)
## [1] 0.4524028
  1. 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 assumed these are indepentent sample of different people and not from a given subset or targeted group. If this is not true then the sample would not be indepentent.

The criteria for normal distribution is meet: np = 604 n(1-p)=654 both greater than 10 It is reasonable to assume the distribution is normal.

  1. A news piece on this survey’s findings states, “Majority of Americans think marijuana should be legalized.” Based on your confidence interval, is this news piece’s statement justified?

Based on the 95% Confidence Interval (0.45,0.50) which represents the US population % that thinks marajuana should be legalized we can not say a majority of the US thinks this as the interval has a significant portion below 50%.


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?

We can use the sample p=0.48 or we could use 0.5 if we want to push the error up a bit. But for this example lets use the given sample p to estimate the number of people that need to be surveyed to ensure a margin of error of 1%

p <- 0.48
ME <- 0.02
# ME = 1.96 * SE
SE <- ME / 1.96
# SE = sqrt((p * (1-p)) / n) 
# SE^2 = (p * (1-p)) / n
( n <- (p * (1-p)) / (SE^2) )
## [1] 2397.158

Below would represent the number of people we need to survey if we decided it needed to be even tighter with a 1% margin of error. (lets call it ME2)

p <- 0.48
ME2 <- 0.01
# ME = 1.96 * SE
SE <- ME2 / 1.96
# SE = sqrt((p * (1-p)) / n) 
# SE^2 = (p * (1-p)) / n
( n <- (p * (1-p)) / (SE^2) )
## [1] 9588.634

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.

The data is noted to be indepentent and randomly taken in each state. The sample size and percent are each seperately large enough to ensure both California and Oregon are normal distributions Based on satisfying these conditions we can use the SE calculation as follows for the difference in the proportions:

SE= Sqrt( p1(1-P1)/n1 + p2(1-p2)/n2)

The margin of error (ME) is calculated below then as 0.009498 or approx 0.95%

p_cali <- 0.08
p_ore <- 0.088
p <- p_cali - p_ore
n_cali <- 11545
n_ore <- 4691
SE2_cali <- (p_cali * (1-p_cali)) / n_cali
SE2_ore <- (p_ore * (1-p_ore)) / n_ore
SE <- sqrt(SE2_cali + SE2_ore)
( ME <- 1.96 * SE )
## [1] 0.009498128

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.

observed <- c(4, 16, 61, 345, 426)
expected_prop <- c(0.048, 0.147, 0.396, 1-0.048-0.147-0.396, 1)
expected <- expected_prop * 426
deer <- rbind(observed, expected)
colnames(deer) <- c("woods", "grassplot", "forests", "other", "total")
deer
##           woods grassplot forests   other total
## observed  4.000    16.000  61.000 345.000   426
## expected 20.448    62.622 168.696 174.234   426
  1. Write the hypotheses for testing if barking deer prefer to forage in certain habitats over others.

Hypothesis null: Barking deer have no habitate preference for foraging Hypthesis A- barking deer prefer to forage in specific types of habitates

  1. What type of test can we use to answer this research question?

Use a chi-square goodness of fit test to this hypothesis.

  1. Check if the assumptions and conditions required for this test are satisfied.

Each area for foraging is independent and has an independent count/ siting. There are at least 5 expected cases/spottings of foraging for each category.

k <- 4
df <- k-1
chi2 <- sum(((deer[1,] - deer[2,])^2)/deer[2,])
( p_value <- 1 - pchisq(chi2, df) )
## [1] 0
  1. Do these data provide convincing evidence that barking deer pre- fer to forage in certain habitats over others? Conduct an appro- priate hypothesis test to answer this research question.

We would reject the null hypothesis as the value is essentially zero. So Barking deer prefer to forage in some habitates over others.


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.

  1. What type of test is appropriate for evaluating if there is an association between coffee intake and depression?

Chi-Square test for coffee intake and level of depression in a two-way test.

  1. Write the hypotheses for the test you identified in part (a).

Hypthesis Null: There is no correlation between coffee intake and risk of depression in women (or no impact of caffine on depression risk in women) Hypotheis A: Coffee intake level (caffine instake) can impact the risk depression in women.

  1. Calculate the overall proportion of women who do and do not suffer from depression.

Overall group who do not suffer from depression= 48,132/50,739 = 95% or more accurate 94.86%

Overall group who do suffer from depression = 2,607/50,739 = 5.14% or approx 5%

  1. Identify the expected count for the highlighted cell, and calculate the contribution of this cell to the test statistic, i.e. (\(Observed - Expected)^2 / Expected\)).

Expected Count (Row 1, Col 2) = 6617* 5.14% = 340.11

Contribution of cell to test stat = (373-340.11)^2/340.11 =3.18

  1. The test statistic is \(\chi^2=20.93\). What is the p-value?

What is the p-value for Chi-squared=20.95

The p-value is 0.03 %

row=2
col=5
ChiSQR=20.95
df2=(row-1)*(col-1)
( p_value <- 1 - pchisq(ChiSQR, df2))
## [1] 0.0003239798
  1. What is the conclusion of the hypothesis test?

If we selected an alpha=0.01 we still see the value less than this and therefore we would reject the null hypothesis.

There is an indication that the degree of coffee consumed has an impact on depression.

  1. One of the authors of this study was quoted on the NYTimes as saying it was “too early to recommend that women load up on extra coffee” based on just this study. Do you agree with this statement? Explain your reasoning.

Yes this seems reasonable as we are not 100% sure this was the only factor or the factor causing the change in depression level.

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: