Rpub link: http://rpubs.com/ssufian/540951


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.

ans:

False, because this pertains to the true population as shown below. The statement states In this sample.

ME <- 0.03
p <- 0.46

c(p-ME, p+ME)
## [1] 0.43 0.49
  1. 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.

ans:

True, We are 95% confident that the true proportion in the population of Americans who support the decision fall

within this interval of 43 to 49 percent.

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

ans:

True. If we keep making random sample of 1,012 Americans, there is a 95% chance that the proprotion

will fall within the range of 43% to 49%. AS the sampling size increases, then we are more confident that the

true population will fall within this range, in fact will be 95 confidence that it will.

  1. The margin of error at a 90% confidence level would be higher than 3%.

ans:

False. The Z critical values is smaller at 1.645. Therefore, the confidence interval would be smaller

(0.48,0.33) leading to an interval of 0.051.


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.

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

ans:

Its a sample parameter because it was a survey in which only 1259 people were surveyed. This is too small of a

sample size to warrent it a population.

  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.

ans:

The 95% confidence interval is (0.45 0.51). We are 95% confident that true proportion of US residents who think marijuana should be made legal falls within 45% to 51%.

p <- 0.48
n <- 1259
se <- sqrt(p*(1-p)/n)
me <- 1.96 * se
c(p - me, p + me)
## [1] 0.4524028 0.5075972
  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.

ans:

To answer the critic, lets verify a couple of things:

  1. sample observations are independent

  2. sample size is sufficiently large based on at least 10 successes and 10 failures in the sample, i.e. np ≥ 10

and n(1−p) ≥ 10. This is called the success-failure condition.

For (a) We are confident the survey were performed in a random fashion as it was done by a reputable survey.

For (b), np = 0.48*1259 = 604 while n(1-p) = 654. So it passed the success-failure condition test.

Therefore, we could tell the critic, that this sampling size and its randomized nature is sufficient for this

method to be modelled as if it came from a normal distribution data set.

  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?

ans:

The confidence interval at 95% is (0.45 0.51) as shown in part b. This is includes the high range of 0.51. But

the true population could be lower than 51% too as the interval indicated. Therefore to really believe this

statement, the interval should start with the lower interval at 51%, then we can truly be comfortable beleiving

that statement of a “majority” of American think….


Legalize Marijuana, Part II. (6.16, p. 216)

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 ?

ans:

n = p(1-p)/(ME/1.96)^2 = 2397 people

n = 0.48*0.52/(0.02/1.96)^2

n
## [1] 2397.158

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.

ans:

PE = p0 - pc = 0.008

PE = 0.088-0.08

PE
## [1] 0.008

ans:

SE = 0.00484

SE = ((0.088*0.912/4691)+(0.08*0.92/11545))^0.5
SE
## [1] 0.004845984

ans:

ME = 0.00949

ME = 1.96*SE
ME
## [1] 0.009498128

ans:

CI = PE +/- ME = (-0.00149, 0.0174)

CI = vector()
CI[1] = PE- ME
CI[2] = PE + ME
CI
## [1] -0.001498128  0.017498128

answer:

Since the confidence interval contains 0, there is not a statistically significant difference in the proportion of

sleep deprivation of the two populations at the 95% confidence level.


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.

  1. Write the hypotheses for testing if barking deer prefer to forage in certain habitats over others.

ans:

H0: The barking deer does not prefer a certain habitat to forage. HA: The barking deer does prefer a certain habitat to forage.

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

ans:

A chi-square test can be used to answer this research question

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

ans:

For chi squared test two of the following conditions must hold:

  1. Independence. Each case that contributes a count to the table must be independent of all the other cases in

the table. IN our case, we assume so for this exercise

  1. Sample size / distribution. Each particular scenario (i.e. cell count) must have at least 5 expected cases

which we do in our case study except for woods.

The woods habitat has only 4.8 cases - which we assume is "closed enough

  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.
# using the chisq.test in R
chisq.test(x=c(4,16,67,345),p=c(0.048,0.147,0.396,0.409))
## 
##  Chi-squared test for given probabilities
## 
## data:  c(4, 16, 67, 345)
## X-squared = 272.69, df = 3, p-value < 2.2e-16

ans:

If p is low (<0.05) the null must go, so in this case we fail to reject the alternative hypothesis that the deer

prefers certain habitat to forage.


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?

ans:

Chi Square 2-way table because:

A two-way table describes counts for combinations of outcomes for two variables. When we consider a two-way

table, we often would like to know, are these variables related in any way? That is, are they dependent (versus

independent)?

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

ans:

H0: There is no relationship between coffee consumption and clinical depression.

HA: There is a relationship between coffee consumption and clinical depression.

  1. Calculate the overall proportion of women who do and do not suffer from depression.
#women who are depressed
p_depressed = (2607/50739) * 100; round(p_depressed, digits=2) 
## [1] 5.14
#women who are normal - Not depressed 
p_normal = (48132/50739) * 100; round(p_normal, digits=2) 
## [1] 94.86
  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\)).
exp <- p_depressed*6617/100


((373-exp)^2)/exp
## [1] 3.205914

ans:

3.205, see computation above

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

df <- (n-1)*(k-1)
chi <- 20.93

p <- (1 - pchisq(chi, df)) 
 p
## [1] 0.0003269507

ans:

Since the P = 0.00032

  1. What is the conclusion of the hypothesis test?

ans:

Since the P is low, cannot reject the Null H0, therefore there is no relationship between coffee consumption and

clinical 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.64 Do you agree with this statement? Explain your reasoning.

ans:

I agree, There was no evidence of a relationship between coffee consumption and depression as shown from part (f)