Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 6 Comparing Proportions (II)

Similar presentations


Presentation on theme: "Lecture 6 Comparing Proportions (II)"— Presentation transcript:

1 Lecture 6 Comparing Proportions (II)
Outline of Today: Testing Equality of Proportions The Chi-squared Test 9/19/2018 SA3202, Lecture 6

2 Testing Equality of Proportions
Hypothesis Testing A basic hypothesis of interest is H0: p1=p2 means H0: “C no effect on R” means H0: “C and R are independent” This test is also known as “Independence Test”. The alternative may be one-sided “H1: p1<p2” Or “H1: p1>p2”, or two sided , “ H1: p1 not equal to p2”. Let =p1-p2 be the population proportion difference. Its estimator is the sample proportion difference ~A N( , ) where the variance is The null hypothesis H0: p1=p2 is equivalent o H0: =0. The latter may be tested using Z= ~ AN(0, 1) under H0 9/19/2018 SA3202, Lecture 6

3 Testing Equality of the Proportions
Estimating the Common Variance Since the variance is unknown, we need to estimate it under H0. Let p denote the common value of p1 and p2 under H0 : p1=p2=p. Then Var( ||H0)=p1(1-p1)/n1+p2(1-p2)/n2=(1/n1+1/n2) p(1-p). The best estimator of p is the Pooled estimator (X1+X2)/(n1+n2) So the standard error is s.e( |H0)= 9/19/2018 SA3202, Lecture 6

4 Testing Equality of the Proportions
The Z- Test Statistic is then constructed as: Z= /s.e( | H0) ~AN(0,1) under H0 Testing Procedure: H0: p1=p2 is tested by comparing Z with the percentage points of N(0,1) if against H1: p1<p2, reject H0 if Z is too small, against H1: p1>p2, reject H0 if Z is too large, against H1: p1 not equal p2, reject H0 if |Z| is too large 9/19/2018 SA3202, Lecture 6

5 Example For the Vitamin C Data, consider testing H0: Vitamin C has no effect (p1=p2) against the alternative H1: it is effective in preventing cold (p1>p2). Placebo Vitamin C Cold Not Cold Total Now the sample proportion difference =.0991, the pooled sample proportion =(X1+X2)/(n1+n2)=(31+17) /( )=.1720 s.e. ( |H0)=.0448 Z= /s.e.( |H0 )=.0991/.0448=2.19, At 5% level, Reject H0: p1=p2 in favor H1: p1>p2 since Z> This means that Vitamin C seems to have some effect. This is consistent with the conclusion made previously using the CI procedure. 9/19/2018 SA3202, Lecture 6

6 The Chi-squared Test The H0: p1=p2 can also be tested by a chi-squared test: compare the observed frequencies with the expected frequencies using the Pearson’s Goodness of test of the Wilk’s Likelihood ratio test. Response Group Group 2 Positive X X2 Negative n1-X n2-X2 Total n n2 Under H0: p1=p2=p, the expected frequencies are Response Group Group 2 Positive n1p n2p Negative n1(1-p) n2(1-p) Total n n2 9/19/2018 SA3202, Lecture 6

7 The Chi-squared Test Replacing the p by its pooled sample proportion , we get the contingency table of the estimated expected frequencies. Response Group Group 2 Positive Negative Total n n2 Thus we can constructed the Pearson’s Goodness of fit Test statistic or the Wilk’s Likelihood Ratio Test statistic The d.f. =4-3=1, with 3 constraints: 9/19/2018 SA3202, Lecture 6

8 Example For the Vitamin C Data, consider testing H0: Vitamin C has no effect (p1=p2) against the alternative H1: it is effective. Placebo Vitamin C Cold Not Cold Total Under H0, the pooled sample proportion =(X1+X2)/(n1+n2)=(31+17) /( )=.1720 Under H0, the estimated expected frequencies are Cold e.g =139*.172 Not Cold The Pearson’s Goodness of Fit Test statistic is T=( )^2/24.1+( )^2/115.9+( )^2/24.1+( )^2/115.1=4.61 The 95% table value with 1 df= Therefore, H0 is rejected . That is the effect of Vitamin is significant at 5% level. Note that the Chi-squared Test is applicable only for two-sided alternatives. 9/19/2018 SA3202, Lecture 6


Download ppt "Lecture 6 Comparing Proportions (II)"

Similar presentations


Ads by Google