False, the correct interpretation is We are 95% confident that between 43% and 49% of Americans (not just in this sample) support the decision of the U.S. Supreme Court on the 2010 healthcare law.
TRUE, this confidence interval applies to the whole population.
TRUE, this is another way to interprete confidence interval.
FALSE, the lower confidence level, the smaller the margin of error.
48% is sample statistic. 48% out of 1259 us residents agreed.
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
The confidence interval t 95% is (45%,51%).The confidence interval is also includes <50%. Thus, the news piece’s statement justified.
# cali
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
The 95% confidence interval between the difference in the proportion of sleep depreviation between Oregonians and Californians is between -0.15% to ~1.75%. The proportion of oregonians who has sleep deprived can be from 0.15% less than californians to 1.75% more than californians at 95% confidence level.
H0: The barking deer does not prefer a certain habitat to forage.
HA: The barking deer does prefer a certain habitat to forage.
Chi-square test. (Several groups involved)
Independence: Assume all barking deep habitat variables are independent from each other.
Samples all contain at leat 5 expected cases satisfying the sample size condition.
H0: The barking deer does not prefer a certain habitat to forage. HA: The barking deer does prefer a certain habitat to forage.
n <- 426
hab_ls <- c(4, 16, 67, 345)
p_ls <- c(.048, .147, .396, 1 - .048 - .147 - .396)
expected <- n * p_ls
# chi square
chi <- ((hab_ls - expected) ^ 2 / expected) %>%
sum %>%
print
## [1] 276.6135
p_chi <- (1 - pchisq(chi, df = length(hab_ls) - 1))
p_chi
## [1] 0
P-value = 0 < 0.05, then we reject the null hypothesis. Thus we can accept that the barking deer does prefer a certain haitat to forage.
Chi-square
H0: There is no relationship between coffee consumption and clinical depression.
HA: There is a relationship between coffee consumption and clinical depression.
p = (2607 / 50739) %>%print
## [1] 0.05138059
1-p
## [1] 0.9486194
5.4% women suffering from depression
94.6% women does not suffer from depression
exp = 6617*p
obs = 373
(obs-exp)^2 / exp
## [1] 3.205914
df = ((5-1)*(2-1))%>%print
## [1] 4
1 - pchisq(20.93,df)
## [1] 0.0003269507
p value is 0.00032695
Since the p-value is smaller than 0.05,we cannot reject the null hypothesis at 0.05 significant level that there is no relationship between depression and coffe consumption among women.