A.FALSE.It should be 100% confident since itlies between 43% and 49%.
B.TRUE. It refers to the population proportion. C.FALSE. The confidence interval is for the population proportion. D.FALSE, the lower confidence level, the smaller the margin of error.
This is sample statistic, it measure sample of 1259 people.
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.the sample are indipendent. 2.both the success and failure are more than 10.
the 95% CI is between 45.2% to 50.8%. so it is justified.
p = 0.48
me = 0.02
((p*(1-p)/(me/1.96)^2))
## [1] 2397.158
# california
n1 = 4691
p1 = 0.088
# oregon
n2 = 11545
p2 = 0.080
diff <- p1-p2
se_diff = sqrt((p1*(1-p1)/n1) + (p2*(1-p2)/n2))
me <- 1.96 * se_diff
c(diff-me,diff+me)
## [1] -0.001498128 0.017498128
It shows that people from California who are sleep deprived is 1.75% less and 0.15% more than people from Oregon.
Ho:Barking deer do not prefer a certain habitat over the other for foraging Ha:Barking deer do prefer a certain habitat over the other for foraging
Chi-square test.
1.the sample are independent 2.the sample sizes are greater than 5.
n <- c(4, 16, 67, 345)
p <- c(.048, .147, .396, 1 - .048 - .147 - .396)
e <- 426 * p
chi <- 276.6135
p_chi <- (1 - pchisq(chi, df = length(n) - 1))
p_chi
## [1] 0
The p-value is 0, so we can reject the null hypothesis. Therefore, barking deer prefer to forage in certain habitats over others.
Chi-Square test
Ho: There is no relationship between coffee consumption and clinical depression Ha: There is a relationship between coffee consumption and clinical depression
p = (2607 / 50739)
p
## [1] 0.05138059
1-p
## [1] 0.9486194
expcount = 6617 * 0.0514
obscount = 373
(obscount - expcount)^2/expcount
## [1] 3.179824
nrow <- 2
ncol <- 5
df <- (nrow-1)*(ncol-1)
chid <- 20.93
pchisq(chid,df,lower.tail=FALSE)
## [1] 0.0003269507
the p-value is less than the significance level. Therefore, we can reject the null hypothesis.