Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Check the Random, Large Sample Size and Independent conditions before performing a chi-square test  Use a chi-square test for homogeneity to determine.

Similar presentations


Presentation on theme: " Check the Random, Large Sample Size and Independent conditions before performing a chi-square test  Use a chi-square test for homogeneity to determine."— Presentation transcript:

1

2  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  http://www.bing.com/videos/search?q=saint+john%27s +wort&view=detail&mid=EE2829F48ED52D904F13EE2829 F48ED52D904F13&first=21&FORM=LKVR12 http://www.bing.com/videos/search?q=saint+john%27s +wort&view=detail&mid=EE2829F48ED52D904F13EE2829 F48ED52D904F13&first=21&FORM=LKVR12  http://www.bing.com/videos/search?q=saint+john%27s +wort&view=detail&mid=220851A58E7D5E49DFC322085 1A58E7D5E49DFC3&first=21&FORM=LKVR10 http://www.bing.com/videos/search?q=saint+john%27s +wort&view=detail&mid=220851A58E7D5E49DFC322085 1A58E7D5E49DFC3&first=21&FORM=LKVR10  http://www.youtube.com/watch?v=JVEYdpDJZlE http://www.youtube.com/watch?v=JVEYdpDJZlE  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  (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 ZoloftPlaceb o Total Full Respon se 27 3791 Partial respons e 16261355 No respons e 705666192 Total113109116338

5  (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  (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  What would the hypotheses be if we did a test with this data? › H 0 : There is NO difference in distribution of responses of patients with major depression when there is Saint-John’s-wort, Zoloft, or Placebo › H a : There is a difference in distribution of responses of subjects with major depression when there is Saint-John’s-wort, Zoloft, or Placebo

8  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  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 Saint- John’s-wort ZoloftPlaceboTotal Full Response 27 ( 30.4) 27 (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 Total113109116338

11  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  Calculate the chi-square statistic. Show your work.

13  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 populations or treatments. › Typically for a two-way table or a comparative experiment.

14  If the Random, Large Sample Size, and Independent conditions are met. You can use the chi-square test for homogeneity to test: › H 0 : There is no difference in distribution of a categorical variable for several populations or treatments. › H a : 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  Back to the example – here is what we have found so far:  H 0 : There is no difference in distribution of responses of patients with major depression when there is Saint- John’s-wort, Zoloft, or Placebo  H a : 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  (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  (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: X 2 cdf(8.72, 1000, 4) = 0.0685  (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 › 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  Put Observed into Matrix A › 2 nd 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: X 2 -Test  Choose Calculate or Draw  To see the Expected Counts, go to the Matrix Menu, choose B and hit enter.

20  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 Fly544599 Freeze Time524496 Invisibility303767 Superstrength202343 Telepathy4466110 TOTAL200215415

21  (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  (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  (b) STATE: We want to perform a test of the following hypotheses with a significance level = 0.05. › H 0 : There is no difference in the distributions of superpower preference for U.S. and U.K. children. › H a : There is a difference in the distributions of superpower preference for U.S. and U.K. children.

24  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 Fly47.751.399 Freeze Time46.349.796 Invisibility32.334.767 Superstrength20.722.343 Telepathy53.057.0110 TOTAL200215415

25  (b) DO: › Test statistic: › P-value: Using (5-1)(2-1) = 4 degrees of freedom, P-value = X2cdf(6.29, 1000, 4) = 0.1785  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  Assigned reading: p. 696 – 713  BEGIN HW problems:  p. 724 #28, 30, 32, 33, 35, 36, 37, 39, 41, 43, 44, 46, 47, 49, 52, 53-58  Check answers to odd problems.


Download ppt " Check the Random, Large Sample Size and Independent conditions before performing a chi-square test  Use a chi-square test for homogeneity to determine."

Similar presentations


Ads by Google