6.6 2010 Healthcare law
p=0.46, n=1012, c=95%, ME=3%
a) False, as we are 100% confident that that proportion in this sample is 46% and lies between 43% and 49%.
b) True, p-ME=43%, p+ME=49%.
We are 95% confident that the proportion of supporters in the population is between 43% and 49%.
c) False, 95% confidence interval is for the population proportions and not for the sample proportions.
d) False, if the confidence level decreased to 90%, we are less sure that it contains the true population proportion and the interval becomes narrower.
6.12 Legalization of marijuana
a) the 48% is based on a sample of 1259 and is therefore a sample statistic.
b)c=95%, z=1.96, ME is calculated as follows
1.96 * sqrt((0.48*(1-0.48)/1259))
## [1] 0.02759723
p-ME=.4524, p+ME=.5076
WE are 95% confident that the true proportion of residents who think marijuana should be legalized is between 45.24 to 50.76%.
c)No of success=12590.48=604 ####No of failure=1259(1-0.48)=655
As both are at least 10, the normal distribution is an appropriate approximate.
d)Since 46% is not majority, the news piece is not justified.
6.20 Legalize marijuana
No of americans we need to survey is
(1.96*(sqrt(.48*.52)/.02))^2
## [1] 2397.158
6.28 Sleep deprivation
p1=.08, p2=.088, n1=11545, n2=4691, c=95%, z=1.96
ME is calculated as follows
1.96*sqrt((.08*.92/11545)+(.088*.912/4691))
## [1] 0.009498128
The endpoints of the confidence interval are
.08-.088-.00949
## [1] -0.01749
.08-.088+.00949
## [1] 0.00149
We are 95% confident that the true proportion of sleep deprived Californians is between 1.75% lower and
####.15% higher than the true proportion of sleep deprived Oregonians.
6.44 Barking Deer
a) Ho: p1=4.8%, p2=14.7%, p3=39.6%, p4=100-rest=40.9%
Ha: At least one of the p is different
b) We need to use Chi Square goodness of fit test
c) Independence, satisfied given that the areas are independent of each other.
Samplesize/distribution: satisfied, as the expected values are at least 5 as belows
((4-(426*.048))^2)/(426*.048)
## [1] 13.23047
((16-(426*.147))^2)/(426*.147)
## [1] 34.71002
((67-(426*.396))^2)/(426*.396)
## [1] 61.306
((345-(426*.409))^2)/(426*.409)
## [1] 167.367
d)Chi Square test
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
P is low so we accept the Alternate Hypothesis
There is a statistically significant difference in the above proportions.
6.48 Coffee and Depression
a) Chi Square 2 way test
b) Ho: There is no difference between the consumption of coffee between women with depression and women without depression.
Ha: There is a difference between the consumption of coffee between women with depression and women without depression.
c) Women who suffer from depression
pd<-2607/50739
Women who do not suffer from depression
pnd<-48132/50739
d) Expected count
exp<-6617*pd
exp
## [1] 339.9854
Contribution to test statistic
ts<-(373-exp)^2/exp
ts
## [1] 3.205914
e) df=(2-1)*(5-1)=4
p=1-pchisq(20.93,4)
p
## [1] 0.0003269507
f) Since p is less than 0.05, we reject the null and accept the alternate hypotheis.
There is sufficient evidence to support the claim that clinical depressions in women are related to caffeinated coffee consumption.
g) I agree, the effects may be due to some other variable not included in this study.
```