This problem is from the "Using R for Introductory Statistics" by John Verzani. Problem 9.22:
In the year 2001, a poll of 600 people found that 250 supported gay marriage. A 2013 poll of 1,050 found 52% in support. Do a test of significance to see whether the difference in proportions is statistically significant.
Solution:
Here, we have to use two sample z test for population proportions.
H0: p1 = p2 versus Ha: p1 ≠ p2
(two tailed test)
We are given
n1 = 600,
n2 = 1050
x1 = 250,
x2 = 1050*0.52 = 546,
By using R, test output is given as below:
> prop.test(x=c(250,546), n=c(600, 1050))
2-sample test for equality of proportions with continuity correction
data: c(250, 546) out of c(600, 1050)
X-squared = 15.917, df = 1, p-value = 6.619e-05
alternative hypothesis: two.sided
95 percent confidence interval:
-0.1543351 -0.0523316
sample estimates:
prop 1 prop 2
0.4166667 0.5200000
P-value for above test is given as 0.000066 approximately.
P-value < α = 0.05
So, we reject the null hypothesis
There is sufficient evidence to conclude that there is a statistically significant difference in two population proportions.
Get Answers For Free
Most questions answered within 1 hours.