1 / 15

Contingency Tables

Contingency Tables. Basic Concepts. 2 categories: (A (rows): possible outcomes A 1 , A 2 , … A r ; B (columns): possible outcomes B 1 , B 2 …, B c ) Assume the categories are independent unless it can be shown otherwise If categories are independent

Télécharger la présentation

Contingency Tables

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. Contingency Tables

  2. Basic Concepts • 2 categories: (A (rows): possible outcomes A1, A2, … Ar; B (columns): possible outcomes B1, B2 …, Bc) • Assume the categories are independent unless it can be shown otherwise • If categories are independent • the probability that event ij occurs (that is Ai and Bj occur simultaneously) = P(Ai)P(Bj) • If there are n total observations, the total expected occurrences of event ij is eij = n*(P(Ai)P(Bj))

  3. Best Estimates for P(Ai) and P(Bj) • From the sample suppose ni = number of times event Ai occurs and nj = number of times Bj occurs • Then, • P(Ai)  ni/n and P(Bj)  nj/n • Thus eij = n(ni/n)(nj/n) = ninj/n or,

  4. Rowi Total Column j Total 82*80/524 Tables Suppose there were 524 total observations. 82 were observed to be A2 and 80 were observed to be B3. Observations (frequency, fij) Contingency Table entry e23 if H0 were true 12.51908

  5. The Chi-Square Test • H0: Categories A and B are independent H1: Categories A and B are dependent •  = .05 • Reject H0 (Accept H1) if 2 > 2.05,(r-1)*(c-1) • Check that all eij’s  5 • Then again, EXCEL: p-value for this test: =CHITEST(cells containing the fi’s, cells containing the ei’s)

  6. =SUM(C4:G4) Drag down =SUM(C4:C7) Drag across Step 1: Determine row and column totals

  7. 2. Type Expected Values 3. Highlight the Frequency Table and Select Copy

  8. 4. Put cursor in cell below Expected Values and click Paste

  9. 5. Highlight entries in new table and click Delete

  10. =H4*C8/H8 6. In first cell put the formula for e11

  11. 7. In the formula bar for this cell: • Highlight the denominator (H8) and click the F4 function key to add $’s. • Since there is now a $ in front of the H and the 8, • Put another $ in front of the other H (H4===> $H4) • And put another in front of the other 8 (C8 ====> C$8)

  12. 8. Drag cell C13 down to cell C16 and highlight cells C13:C16.

  13. 9. Now drag cells C13:C16 across to cells G13:16. This is now the contingency table of expected values.

  14. =CHITEST(Highlight C4:G7, Highlight C13:G16) 10. Calculate the p-value for the chi-square test .009731

More Related