a-) false, condifence level is to study the population.
b-) true.
c-) true
d-) false, will be less than 3%
a-) sample statisticts which is 48% b-)
ME <- 1.96 *(sqrt((.48*(1-.48))/1259))
ME
## [1] 0.02759723
c-) p * n = 0.48 ∗ 1259 = 604.3
(1−p) * n = 0.52 ∗ 1259 = 654.7
we can see we have less than 10% and we can assume the data was collect ramdonly.we can assume is normally distributed.
d-) we can see confidence level can be above 50% or it can be below 50%
SE <- 0.02 / 1.96
(0.48 * ( 1 - 0.48)) / (SE ^ 2)
## [1] 2397.158
we are 95% of the propotion of california and oregon residents that sleep deprived follow on ( -0.01749813 , 0.001498128)
cal <- 0.08
ore <- 0.088
p <- cal - ore
ncal <- 11545
nore <- 4691
se <- sqrt((ore * (1-ore)) / nore + (cal * (1-cal)) / ncal)
p + se * 1.96
## [1] 0.001498128
p - se *1.96
## [1] -0.01749813
a-) chi-square
b-) H0:clinical depression is not affected with coffee consumption
HA:clinical depression is affected with coffee consumption
c-) clinical depressed: 2607/50739 = 0.0514 clinical not depressed 48132/50739 = 0.9486
d-) 2607 * 6617 / 50739 = 339.9 (373 - 339.9)^2 / 339.9 = 3.22
e-)
paste("the P value is " ,round(pchisq(20.93,4,lower.tail = FALSE),6))
## [1] "the P value is 0.000327"
f-) in this exercise, we can see that clinical depression can be affected by the consumption of coffee.
g-) Yes agree, it can be other factors that affect this outcome.