Two Way Tables
Download
1 / 62

Two Way Tables Chi Square Test - PowerPoint PPT Presentation


  • 157 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Two Way Tables Chi Square Test' - thelma


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Two way tables chi square test

Two Way Tables

Chi Square Test





Two way tables chi square test

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.


Two way tables chi square test

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.


Music and wine data in counts
Music and wine data in counts 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.

243 bottles total


Marginal distribution
Marginal Distribution 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.


What percent of wine bought was italian
What percent of wine bought was Italian? 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.


What percent of wine bought was italian1
What percent of wine bought was Italian? 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.




Two way tables chi square test

Marginal Distributions music playing

Only ask about 1 variable

Use values in “margins”




Joint distribution
Joint distribution music playing in the store?

Ask about both variables

Use values inside table and total






Conditional distribution
Conditional distribution stores was French?

Asks about both variables

Given one variable

Use values inside table and margins


Two way tables chi square test

Hypothesis Testing stores was French?


Two way tables chi square test

  • H stores was French?0

Null Hypothesis

  • Ha

Alternative Hypothesis


Two way tables chi square test

  • H stores was French?0

Half of the deck is black

  • Ha

Half of the deck is notblack


Two way tables chi square test

  • Never

    • Prove

    • Accept


Two way tables chi square test

Standard: stores was French?α = 0.05


Chi square hypothesis tests
Chi-square hypothesis tests stores was French?

H0: There is NO association between music and wine in the population.

Ha: There is an association between music and wine in the population.


Two way tables chi square test

Observed stores was French? Data vs. Expected Data


Two way tables chi square test

Have stores was French?: Observed Counts

Want: Expected Counts if Music and Wine were Independent


Expected counts
Expected counts stores was French?


Expected counts1
Expected Counts stores was French?


Expected counts2
Expected Counts stores was French?


Expected counts vs observed counts
Expected Counts stores was French?vs Observed Counts


Chi square test statistic
Chi-square test statistic stores was French?


Partial chi square values
Partial Chi-Square values stores was French?


Chi square value
Chi-Square Value stores was French?

χ2 = 0.52 + 2.31 + 0.52 + 0.0084 + 7.70 + 6.44 + 0.39 + 0.00029 + 0.43

χ2 = 18.31


Chi square table
Chi-Square Table stores was French?


Degrees of freedom
Degrees of Freedom stores was French?

DF = (r-1)(c-1)

r = 3

c = 3

DF= (3-1)*(3-1)= 2x2 =4


Chi square table1
Chi-Square Table stores was French?

Test statistic = 9.49


Two way tables chi square test

Test Statistic stores was French?

If table value < χ2 then reject H0

If table value > χ2 then fail to reject H0


Chi square hypothesis tests1
Chi-square hypothesis tests stores was French?

X2 = 18.31 > 9.49

Reject H0.

We have evidence there is an association between music and wine in the population.


Two way tables chi square test

Is stores was French?table value < χ2

Yes

No

reject H0

Fail to reject H0

We have evidence Ha

We do not have evidence Ha



Two way tables chi square test

Tables larger than 2x2: stores was French?

  • the smallest expected count ≥ 1

  • <20% of cells have expected counts < 5.

    2x2 tables:

  • all 4 expected cell counts ≥ 5


Two way tables chi square test

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.


Pet ownership and heart disease data counts
Pet ownership and heart disease data (counts) 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.








Two way tables chi square test

Steps for ALL Chi-Square Tests pet? (J,M,C)

Write Hypothesis

Find Expected Counts (check if test is appropriate)

Find value by adding all partial chi-square values

Find DF

Find “test statistic” (table value use )

Write Conclusion


Chi square test for pet ownership and patient status
Chi-square test for pet ownership and patient status pet? (J,M,C)

H0: There is NO association between pet ownership

and patient status in the population.

Ha: There is an association between pet ownership and patient status in the population.


Expected counts3
Expected Counts pet? (J,M,C)


Partial chi square values1
Partial Chi-Square Values pet? (J,M,C)

χ2 = 0.786 + 0.579 + 4.408 + 3.211

χ2 = 8.984


Two way tables chi square test

df pet? (J,M,C) = (2-1)(2-1) = 1

Critical value from table for α = 0.05 is 3.84.

Since 8.984 > 3.84, we can reject H0and conclude that we have evidence that owning a pet and survival are not independent.


Two way tables chi square test

M&Ms and pet? (J,M,C)Two-way Tables


Full class m ms data in counts large sample size necessary for test
Full-class M&Ms data in counts pet? (J,M,C)(large sample size necessary for test)