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.
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
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.
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.
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.
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.
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
ans:
To answer the critic, lets verify a couple of things:
sample observations are independent
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.
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.
ans:
H0: The barking deer does not prefer a certain habitat to forage. HA: The barking deer does prefer a certain habitat to forage.
ans:
A chi-square test can be used to answer this research question
ans:
For chi squared test two of the following conditions must hold:
the table. IN our case, we assume so for this exercise
which we do in our case study except for woods.
The woods habitat has only 4.8 cases - which we assume is "closed enough
# 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.
{}
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)?
ans:
H0: There is no relationship between coffee consumption and clinical depression.
HA: There is a relationship between coffee consumption and clinical 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
exp <- p_depressed*6617/100
((373-exp)^2)/exp
## [1] 3.205914
ans:
3.205, see computation above
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
ans:
Since the P is low, cannot reject the Null H0, therefore there is no relationship between coffee consumption and
clinical depression.
ans:
I agree, There was no evidence of a relationship between coffee consumption and depression as shown from part (f)