Presentation is loading. Please wait.

Presentation is loading. Please wait.

Comparing Two Proportions Using Dependent Samples (p 1 vs. p 2 )

Similar presentations


Presentation on theme: "Comparing Two Proportions Using Dependent Samples (p 1 vs. p 2 )"— Presentation transcript:

1 Comparing Two Proportions Using Dependent Samples (p 1 vs. p 2 )

2 Inferential Methods (cont’d) Large dependent samples - McNemar’s test (chi-square) Large dependent samples - McNemar’s test (chi-square) Small dependent samples - McNemar’s test (binomial ) Small dependent samples - McNemar’s test (binomial )

3 Matched Dichotomous Data In some studies, we make comparisons of proportions across samples which are dependent. In some studies, we make comparisons of proportions across samples which are dependent. E.g. Cross-over studies E.g. Cross-over studies - Relief of headaches using Drug A vs. Drug B - Subject receives both treatments in random order E.g. Treating ear infections E.g. Treating ear infections - randomly assign a one of two treatments to each ear E.g. Infection status before and after treatment E.g. Infection status before and after treatment

4 Example 1: Effect of Disinfectant Use on Acute Cutaneous Complications (ACCs) During Insulin Pump Treatment A study examined the effect of disinfectant use on acute cutaneous complications (ACC’s) during insulin-pump treatment. At the time of the initial exam, 70.0% of 40 diabetic patients with insulin pumps had ACC’s at the needle insertion site. After use of a disinfectant on the skin before needle insertion for two to four weeks, 27.5% of the patients had ACC’s at the needle insertion site. A study examined the effect of disinfectant use on acute cutaneous complications (ACC’s) during insulin-pump treatment. At the time of the initial exam, 70.0% of 40 diabetic patients with insulin pumps had ACC’s at the needle insertion site. After use of a disinfectant on the skin before needle insertion for two to four weeks, 27.5% of the patients had ACC’s at the needle insertion site.

5 Example 1: Effect of Disinfectant Use on Acute Cutaneous Complications (ACCs) During Insulin Pump Treatment The data here is matched because we are examining infection status before and after regular disinfectant use at the injection site. The data here is matched because we are examining infection status before and after regular disinfectant use at the injection site. We can create the data table as shown below We can create the data table as shown below Proportion with ACCs before treatment = (a+b)/n Proportion with ACCs after treatment = (a+c)/n The difference between these quantities is (a+b)/n – (a+c)/n = (b – c)/n If disinfectant use if NOT effective we expect b = c, if it is we expect b > c.

6 Example 2: Cross-over study (Drug A vs. Drug B) Generic table from a cross-over study Generic table from a cross-over study If there is no difference between the drugs success rates we expect b = c. If Drug B is better than Drug A we would expect b < c. If Drug A is better than Drug B we would expect b > c. At any rate if b and c differ substantially then we have evidence of a difference between the drugs. Proportion successfully treated with drug A = (a+b)/n Proportion successfully treated with drug B = (a+c)/n The difference between these quantities is (a+b)/n – (a+c)/n = (b – c)/n The cells corresponding to b and c represent what we call discordant pairs and the total… b + c = # of discordant pairs.

7 McNemar’s Test Procedure Hypotheses Hypotheses H o : p 1 = p 2 (treatment 1 and 2 are equal) H A : p 1 > p 2 (treatment 1 is better than 2) Reject H o if b is “large” Reject H o if b is “large” H A : p 1 < p 2 (treatment 2 is better than 1) Reject H o if c is “large” Reject H o if c is “large” H A : p 1 = p 2 (treatment 1 and 2 are different) Reject Ho if b or c Reject Ho if b or c is “large” is “large”

8 McNemar’s Test Procedure We know that the total number of discordant pairs is b + c. We know that the total number of discordant pairs is b + c. If the null hypothesis is true b and c should be equal. If the null hypothesis is true b and c should be equal. If the null is true then b and c are like the number of heads and tails in (b + c) flips of a fair coin, both are binomial with p =.50. If the null is true then b and c are like the number of heads and tails in (b + c) flips of a fair coin, both are binomial with p =.50. Excessively large values for either b or c provide evidence against the null hypothesis. Excessively large values for either b or c provide evidence against the null hypothesis.

9 McNemar’s Test: P-values (uses binomial probabilities) H A : p 1 > p 2 Reject H o if H A : p 1 < p 2 Reject H o if H A : p 1 = p 2 Reject H o if Use either binomial probability tables or computer software to find these probabilities.

10 Example 1: Effect of Disinfectant Use on Acute Cutaneous Complications (ACCs) During Insulin Pump Treatment The results of treating n = 40 patients a = 9 subjects had ACCs both before and after disinfectant b = 19 subjects had ACCs before the disinfectant and did NOT have ACCs after the use of disinfectant c = 2 subjects had no ACCs before disinfectant use but had them after disinfectant was used d = 10 patients had no ACCs before or after the use of disinfectant. H o : there is no change in ACC incidence following use of disinfectant. H A : the ACC rate is lower following the use disinfectant. Intuitively we will reject H o if b is “large”… use McNemar’s Test.

11 Example 1: Effect of Disinfectant Use on Acute Cutaneous Complications (ACCs) During Insulin Pump Treatment 1) Let p = probability of ACC H o : p before = p after H A : p before > p after 2) Choose  and reject if b is “large”. 3) b = 19 with (b+c) = 21 4) Find p-value = P(X > 19|n=21, p=.50) =.00011 5) Therefore we conclude that the ACC infection rate is lower following the use of disinfectant at the injection site (p =.0001).

12 Example 2: Aspartame and Headaches In a double-blind study of aspartame and headaches, 40 subjects were given aspartame and a placebo after different times. All of the subjects had reported suffering from headaches after consuming food products that contained aspartame. In a double-blind study of aspartame and headaches, 40 subjects were given aspartame and a placebo after different times. All of the subjects had reported suffering from headaches after consuming food products that contained aspartame.

13 Example 2: Aspartame and Headaches 1) Let p = probability of headache H o : p aspartame = p placebo H A : p aspartame > p placebo 2) Choose  and reject if b is “large”. 3) b = 12 with (b+c) = 20 4) Find p-value = P(X > 12|n=20, p=.50) =.2517 5) Therefore we fail to conclude that there is a difference between the proportion of subjects getting headaches after consuming aspartame vs. placebo (p =.2517).

14 Large Sample McNemar’s Test Test Statistic

15 Example 1: Effect of Disinfectant Use on Acute Cutaneous Complications (ACCs) During Insulin Pump Treatment Using McNemar’s Test for large samples Find p-value = Therefore we conclude that the ACC infection rate is lower following the use of disinfectant at the injection site (p =.00048).

16 Chi-square Probability in JMP Enter chi-square statistic value and df then the p-value will automatically be calculated.


Download ppt "Comparing Two Proportions Using Dependent Samples (p 1 vs. p 2 )"

Similar presentations


Ads by Google