Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inference for Relationships

Similar presentations


Presentation on theme: "Inference for Relationships"— Presentation transcript:

1 Inference for Relationships
Lesson 3: Section 11.2 (part 1)

2 objectives Check the Random, Large Sample Size and Independent conditions before performing a chi-square test Use a chi-square test for homogeneity to determine whether the distribution of a categorical variable differs for several populations or treatments Interpret computer output for a chi-square test based on a two-way table Examine individual components of the chi-square statistic as part of a follow-up analysis Show that the two-sample z test for comparing two proportions and the chi-square test for a 2-by-2 two-way table give equivalent results

3 EXAMPLE: Saint-John’s-Wort and depression
An article in the Journal of the American Medical Association (vol. 287, no. 14, April 10, 2002) reports the results of a study designed to see if the herb Saint-Jon’s-Wort is effective in treating moderately severe cases of depression. The study involved 228 subjects who were being treated for major depression. The subjects were randomly assigned to receive one of three treatments – Saint-John’s-Wort, Zoloft (a prescription drug), or a placebo – for an eight-week period. The table below summarizes the results of the experiment.

4 EXAMPLE: Saint-John’s-Wort and depression
(a) Calculate the conditional distribution (in proportions) of the type of response for each treatment. (b) Make an appropriate graph for comparing the conditional distributions in part (a). (c) Compare the distributions of response for each treatment. Saint-John’s-Wort Zoloft Placebo Total Full Response 27 37 91 Partial response 16 26 13 55 No response 70 56 66 192 113 109 116 338

5 EXAMPLE: Saint-John’s-Wort and depression
(a) For the Saint-John’s-Wort treatment: Full: 27/113 = 0.239 Partial: 16/113 = 0.142 No: 70/113 = 0.619 For the Zoloft treatment: Full: 27/109 = 0.248 Partial: 26/109 = 0.239 No: 56/109 = 0.514 For the placebo treatment: Full: 37/116 = 0.319 Partial: 13/116 = 0.112 No: 66/116 = 0569

6 EXAMPLE: Saint-John’s-Wort and depression
(b) Use either a bar graph or segmented bar graph. (c) Surprisingly, a higher proportion of subjects receiving the placebo had a full response than subjects receiving Saint-John’s-Wort or Zoloft. Overall, a higher proportion of Zoloft users had at least some response, followed by placebo users, and then Saint-John’s-Wort users.

7 EXAMPLE: Saint-John’s-Wort and depression
What would the hypotheses be if we did a test with this data? H0: There is NO difference in distribution of responses of patients with major depression when there is Saint-John’s-Wort, Zoloft, or Placebo Ha: There is a difference in distribution of responses of subjects with major depression when there is Saint-John’s-Wort, Zoloft, or Placebo

8 Multiple Comparisons The problem of how to do many comparisons at once with an overall measure of confidence in all our conclusions is common in statistics. This is the problem of multiple comparisons. 1. An overall test to see if there is good evidence of any difference among the parameters that we want to compare. 2. A detailed follow up analysis to decide which of the parameters differ and to estimate how large the differences are.

9 EXAMPLE: Saint-John’s-Wort and depression
Calculate the expected counts for the three treatments, assuming that all three treatments are equally effective. (turn to a person around you and see if you can figure out the expected counts!) Full response: 91/338 = 26.9%  we expect 26.9% of patients in each treatment group to have a full response. Saint-John’s-Wort: (91/338)(113) = 30.4 Zoloft: (91/338)(109) = 29.3 Placebo: (91/338)(116) = 31.2 Do the same for the other responses and fill in the chart below.

10 EXAMPLE: Saint-John’s-Wort and depression – use this for the next example!
Zoloft Placebo Total Full Response 27 (30.4) (29.3) 37 (31.2) 91 Partial response 16 (18.4) 26 (17.7) 13 (18.9) 55 No response 70 (64.2) 56 (61.9) 66 (65.9) 192 113 109 116 338

11 Finding Expected Counts
Expected count = (row total)(column total) table total Remember, you don’t NEED to use this formula – we just did the (row total/table total)(column total) in the last example!

12 EXAMPLE: Saint-John’s-Wort and depression
Calculate the chi-square statistic. Show your work.

13 Chi-Square Test for Homogeneity
We use Chi-Square Goodness of Fit Test for ONE categorical variable (with df = #categories – 1) We use Chi-Square Test for Homogeneity for a categorical variable of several independent populations or treatments. Typically for a two-way table or a comparative experiment.

14 Chi-Square Test for Homogeneity
If the Random, Large Sample Size, and Independent conditions are met, you can use the chi-square test for homogeneity to test: H0: There is no difference in distribution of a categorical variable for several populations or treatments. Ha: There is a difference in distribution of a categorical variable for several populations or treatments. 1.) Find the expected counts 2.) Find the chi-square statistic 3.) Use degrees of freedom = (number of rows – 1)(number of columns – 1) and Table C to find the P-value.

15 EXAMPLE: Saint-John’s-wort and depression
Back to the example – here is what we have found so far: H0: There is no difference in distribution of responses of patients with major depression when there is Saint-John’s-wort, Zoloft, or Placebo Ha: There is a difference in distribution of responses of subjects with major depression when there is Saint-John’s-wort, Zoloft, or Placebo Chi square statistic = 8.72 (a) Verify that the conditions for the test are satisfied. (b) Calculate the P-value for this test. (c) Interpret the P-value in context. (d) What is your conclusion?

16 EXAMPLE: Saint-John’s-Wort and depression
(a) Verify that the conditions for the test are satisfied. Random: The treatments were randomly assigned. Large Sample Size: The expected counts (30.4, 29.3, 31.2, 18.4, 17.7, 18.9, 64.2, 61.9, 65.9) are all at least 5. Independent: Knowing the response of one patient should not provide any additional information about the response of any other patient. (NOT sampling without replacement, so don’t have to check the 10% rule)

17 EXAMPLE: Saint-John’s-Wort and depression
(b) Calculate the P-value for this test. Df = (3-1)(3-1) = 4 Using Table C, in row 4, our chi square statistic of 8.72 falls between .05 and 0.10. Or Using Calculator: X2cdf(8.72, 1000, 4) = (c) Interpret the P-value in context. Assuming that the treatments were equally effective, the probability of observing a difference in the distributions of responses among the three treatment groups as large as or larger than the one in the study is about 7%. (d) What is your conclusion?

18 EXAMPLE: Saint-John’s-Wort and depression
(d) What is your conclusion? Since the P-value is > than 0.05, we fail to reject the null hypothesis. We do NOT have convincing evidence that there is a difference in the distributions of responses for patients with moderately sever cases of depression when taking Saint-John’s-Wort, Zoloft, or a placebo.

19 In your calculator… Put Observed into Matrix A
2nd Matrix  Edit  option 1: A Choose the size of the matrix by the size of the two-way table without the total column and row  type in observed counts Do not need to put in expected counts  calculator will calculate these for you! STAT  TESTS  choose C: X2-Test Choose Calculate or Draw To see the Expected Counts, go to the Matrix Menu, choose B and hit enter.

20 YOUR TURN! Superpowers A random sample of 200 children (ages 9-17) from the United Kingdom who filled out a CensusAtSchool survey were asked what was their superpower preference. A random sample of 215 U.S. children (ages 9 -17) was selected from the same survey. Here are the results: U.K. U.S. TOTAL Fly 54 45 99 Freeze Time 52 44 96 Invisibility 30 37 67 Superstrength 20 23 43 Telepathy 66 110 200 215 415

21 EXAMPLE: Superpowers (a) Construct an appropriate graph to compare the distribution of superpower preference for U.K. and U.S. children. (b) Do these data provide convincing evidence that the distribution of superpower preference differs among U.S. and U.K. children? (STATE, PLAN, DO, CONCLUDE!)

22 EXAMPLE: Superpowers (a) Draw a bar graph or segmented bar graph that compares the conditional distributions (in proportions) of superpower preference for the children in each country’s sample.

23 EXAMPLE: Superpowers (b) STATE: We want to perform a test of the following hypotheses with a significance level = 0.05. H0: There is no difference in the distributions of superpower preference for U.S. and U.K. children. Ha: There is a difference in the distributions of superpower preference for U.S. and U.K. children.

24 EXAMPLE: Superpowers PLAN: If conditions are met, we will perform a chi-square test for homogeneity. Random: The data are from separate random samples of U.K. and U.S. children Large Sample Size: The expected counts (see below) are all at least 5. Independent: The sample were independently selected. Also, since there are at least 10(200) = 2000 children in the U.K. and at least 10(215) = 2150 children in the United States, both samples are less than 10% of their populations. U.K. U.S. TOTAL Fly 47.7 51.3 99 Freeze Time 46.3 49.7 96 Invisibility 32.3 34.7 67 Superstrength 20.7 22.3 43 Telepathy 53.0 57.0 110 200 215 415

25 EXAMPLE: Superpowers (b) DO: CONCLUDE: Test statistic:
P-value: Using (5-1)(2-1) = 4 degrees of freedom, P-value = X2cdf(6.29, 1000, 4) = CONCLUDE: Because the P-value is greater than 0.05, we fail to reject the null hypothesis. We do NOT have convincing evidence that there is a difference in the distributions of superpower preference for U.S. and U.K. schoolchildren.

26 homework Assigned reading: p. 696 – 713 BEGIN HW problems: p #28, 30, 32, 33, 35, 36, 37, 39, 41, 43, 44, 46, 47, 49, 52, 53-58 Check answers to odd problems.


Download ppt "Inference for Relationships"

Similar presentations


Ads by Google