Since the sample size is large? Normal approximation can be used. Thus, prop.test can be used.
"H_0:P=0.2"
"H_a:P\\ne0.2"
The R code is
prop.test(50,400,0.2, alternative="two.sided", correct=TRUE)
1-sample proportions test with continuity correction
data: 50 out of 400, null probability 0.2
X-squared = 13.598, df = 1, p-value = 0.0002265
alternative hypothesis: true p is not equal to 0.2
95 percent confidence interval:
0.09501362 0.16239279
sample estimates:
p
0.125
The P-value from the output is 0.0002265 which is less than 0.05 we reject the null hypothesis and conclude that the sample is not representative.
Comments
Leave a comment