In: Statistics and Probability
You wonder whether the proportion of children who have pink as their favorite color is different than the proportion of adults. You survey 100 children and 200 adults and find that 30% of children and 21% of adults have pink as their favorite color. Compute the value of the test statistic (in terms of children minus adults) that will allow you to test your hypothesis.
Solution :
Given that,
This a two-tailed test.
The null and alternative hypothesis is,
Ho: p1 = p2
Ha: p1 p2
The value of the pooled proportion is computed as,
= ( n1p1 + n2p2 ) / ( n1 + n2 )
= ( 0.30*100 + 0.21*200) / (100 + 200 )
= 72 / 300
= 0.24
1 - = 0.76
Test statistics
z = (1 - 2 ) / *(1-) ( 1/n1 + 1/n2 )
= (0.30 - 0.21 ) / ( 0.24 * 0.76) (1/100 + 1/200 )
= 1.721
P-value = 2 * P(Z > z )
= 2 * ( 1 - P(Z < 1.721 ))
= 2 * 0.0426
= 0.0852