1 / 62

Two Way Tables Chi Square Test

Two Way Tables Chi Square Test. 2 categorical variables. Data collected in a table with counts. Can test whether there is association between the 2 variables.

thelma
Télécharger la présentation

Two Way Tables Chi Square Test

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Two Way Tables Chi Square Test

  2. 2 categorical variables

  3. Data collected in a table with counts.

  4. Can test whether there is association between the 2 variables.

  5. Market researchers think that background music can influence the mood and purchasing behavior of customers. One study compared 3 treatments: no music, French accordion music, and Italian string music. Under each condition, the researchers recorded the number of bottles of French, Italian, and other wine purchased.

  6. Market researchers think that background music can influence the mood and purchasing behavior of customers. One study compared 3 treatments: no music, French accordion music, and Italian string music. Under each condition, the researchers recorded the number of bottles of French, Italian, and other wine purchased.

  7. Music and wine data in counts 243 bottles total

  8. Marginal Distribution

  9. What percent of wine bought was Italian?

  10. What percent of wine bought was Italian?

  11. What percent of wine was purchased from a store with no music playing

  12. What percent of wine was purchased from a store with no music playing

  13. Marginal Distributions Only ask about 1 variable Use values in “margins”

  14. What percent of all wine bought was Italian with French music playing in the store?

  15. What percent of all wine bought was Italian with French music playing in the store?

  16. Joint distribution Ask about both variables Use values inside table and total

  17. What percent of all wine bought was Italian with French music playing in the store?

  18. Of the Italian wine purchased, what percent was from a store playing French music?

  19. What percent of the wine purchased from French music-playing stores was French?

  20. What percent of the wine purchased from French music-playing stores was French?

  21. Conditional distribution Asks about both variables Given one variable Use values inside table and margins

  22. Hypothesis Testing

  23. H0 Null Hypothesis • Ha Alternative Hypothesis

  24. H0 Half of the deck is black • Ha Half of the deck is notblack

  25. Possible Outcomes • Reject H0 • Fail to reject H0 • Never • Prove • Accept

  26. Standard: α = 0.05

  27. Chi-square hypothesis tests H0: There is NO association between music and wine in the population. Ha: There is an association between music and wine in the population.

  28. Observed Data vs. Expected Data

  29. Have: Observed Counts Want: Expected Counts if Music and Wine were Independent

  30. Expected counts

  31. Expected Counts

  32. Expected Counts

  33. Expected Counts vs Observed Counts

  34. Chi-square test statistic

  35. Partial Chi-Square values

  36. Chi-Square Value χ2 = 0.52 + 2.31 + 0.52 + 0.0084 + 7.70 + 6.44 + 0.39 + 0.00029 + 0.43 χ2 = 18.31

  37. Chi-Square Table

  38. Degrees of Freedom DF = (r-1)(c-1) r = 3 c = 3 DF= (3-1)*(3-1)= 2x2 =4

  39. Chi-Square Table Test statistic = 9.49

  40. Test Statistic If table value < χ2 then reject H0 If table value > χ2 then fail to reject H0

  41. Chi-square hypothesis tests X2 = 18.31 > 9.49 Reject H0. We have evidence there is an association between music and wine in the population.

  42. Is table value < χ2 Yes No reject H0 Fail to reject H0 We have evidence Ha We do not have evidence Ha

  43. When is chi-square test appropriate?

  44. Tables larger than 2x2: • the smallest expected count ≥ 1 • <20% of cells have expected counts < 5. 2x2 tables: • all 4 expected cell counts ≥ 5

  45. Psychological and social factors can influence the survival of patients with serious diseases. One study examined the relationship between survival of patients with coronary heart disease and pet ownership. Each of 92 patients was classified as having a pet or not and by whether they survived for one year. The researchers suspect that having a pet might be connected to the patient status.

  46. Pet ownership and heart disease data (counts)

  47. Assuming a patient is still alive, what is the probability he owns a pet?

More Related