SlideShare a Scribd company logo
1 of 51
What Am I Supposed to Do With Three-Way
Crosstabs? An Introduction to Log Linear Models


               ERIC CANEN, M.S.
           UNIVERSITY OF WYOMING
       WYOMING SURVEY & ANALYSIS CENTER




      EVALUATION 2010: EVALUATION QUALITY
                SAN ANTONIO, TX
               NOVEMBER 13, 2010
Situation
                      What effects?
                          Community Level
Communities




                  3
Parents Have
                       Favorable Attitude
                        toward Smoking




 Would be
Seen as cool
for smoking
                       Set Up                          Tried smoking
                                                       during lifetime




       Pre-Ordinance                           Post-Ordinance


                       Matched Communities
                       Variables of Interest
                           Pre/Post              Smoked during past
                                                     30 days
     Friends Smoke



                                4
Design
Matched Communities       Pre/Post       Each Variable of Interest


        2             X     2        X              2




                             5
Expectations
    (Hypotheses)




         6
60%


50%


40%


30%                                        Ord
                                           Non-Ord
20%


10%


0%
                   Pre              Post

      NOTE: Hypothetical Data




                                7
60%


50%


40%


30%                                        Ord
                                           Non-Ord
20%


10%


0%
                   Pre              Post

      NOTE: Hypothetical Data




                                8
60%


50%


40%


30%                                        Ord
                                           Non-Ord
20%


10%


0%
                   Pre              Post

      NOTE: Hypothetical Data




                                9
Analysis
       Try: Cross Tabulation


Rows         Columns           Layers




                 10
Seen As Cool
                                                            Some chance OR Pretty
                                  No or very little chance    good chance OR Very
                                    OR Little chance             good chance        Total
Pre    Ord       Count                            11443                      1676    13119
                 Expected Count                 11308.3                    1810.7   13119.0
                 % of Total                       52.6%                      7.7%    60.3%
       Non-ord   Count                             7324                      1329     8653
                 Expected Count                  7458.7                    1194.3    8653.0
                 % of Total                       33.6%                      6.1%    39.7%
       Total     Count                            18767                      3005    21772
                 Expected Count                 18767.0                    3005.0   21772.0
                 % of Total                       86.2%                    13.8%    100.0%
Post   Ord       Count                             4137                       603     4740
                 Expected Count                  4083.0                     657.0    4740.0
                 % of Total                       50.8%                      7.4%    58.2%
       Non-ord   Count                             2879                       526     3405
                 Expected Count                  2933.0                     472.0    3405.0
                 % of Total                       35.3%                      6.5%    41.8%
       Total     Count                             7016                      1129     8145
                 Expected Count                  7016.0                    1129.0    8145.0
                 % of Total                       86.1%                    13.9%    100.0%



                                          11
Chi-Square Tests
                                                Asymp.
                                                Sig. (2-    Exact Sig. Exact Sig.
                          Value        df       sided)      (2-sided) (1-sided)
Pre    Pearson Chi-        29.251           1        .000
       Square
       Likelihood Ratio    28.976           1        .000
       N of Valid Cases    21772

Post   Pearson Chi-        12.336           1        .000
       Square
       Likelihood Ratio    12.243           1        .000
       N of Valid Cases     8145




                                  12
Seen As Cool
                                                            Some chance OR Pretty
                                  No or very little chance    good chance OR Very
                                    OR Little chance             good chance        Total
Pre    Ord       Count                            11443                      1676    13119
                 Expected Count                 11308.3                    1810.7   13119.0
                 % of Total                       52.6%                      7.7%    60.3%
       Non-ord   Count                             7324                      1329     8653
                 Expected Count                  7458.7                    1194.3    8653.0
                 % of Total                       33.6%                      6.1%    39.7%
       Total     Count                            18767                      3005    21772
                 Expected Count                 18767.0                    3005.0   21772.0
                 % of Total                       86.2%                    13.8%    100.0%
Post   Ord       Count                             4137                       603     4740

  Expected Expected Count
             Cell Probabilities:
             % of Total
                              4083.0
                              50.8%
                                                                            657.0
                                                                             7.4%
                                                                                     4740.0
                                                                                     58.2%
  P(AB|C) P(A) P(B) P(B|C)2879
  P(AB) ==Count * * P(B) * P(C)
  P(ABC) =P(A)
     Non-ord    P(A|C) *                                                      526     3405
                 Expected Count                  2933.0                     472.0    3405.0
                 % of Total                       35.3%                      6.5%    41.8%

  Expected Count Count
     Total
             Cell Counts:
            Expected
                                                   7016
                                                 7016.0
                                                                             1129
                                                                           1129.0
                                                                                      8145
                                                                                     8145.0
  E(nab))= n ofnP(AB)
     abc = = *Total P(AB|C)
        |C) % * P(ABC)
            n *                                   86.1%                    13.9%    100.0%



                                         13
Analysis
Consider: Logistic Regression




              14
Analysis
Loglinear Models
    Relationship
    Higher Order
    Modeling Cell
      Related to
        Model
    Alternative to
      Generalize
       between
        Terms
       ANOVA
        Counts
        Based
    Linear Models
      Crosstabs
      variables




          15
Assumptions

 Data represent cross tabulated counts
 No expected cell counts are zero cell counts and no
  more than 20% of the cells have expected cell counts
  <=5
 If sample size was fixed then the cell counts are
  expected to follow a multinomial distribution
 If sample size was not fixed then cell counts are
  expected to follow a Poisson distribution
 Models look at relationships or association,
  like correlation (r statistic)

                            16
Program Commands

 SAS
     Proc CatMod procedure
     Proc GenMod procedure
 R
     loglin() function
     glm() function
 Stata
     poisson command (Poison regression)
     glm command
 SPSS/PASW
     GENLOG
     GENLIN


                                   17
Saturated Model
   Or perfect fit model




            18
In SPSS: Analyze  Loglinear  General




                  19
20
21
22
23
24
GENLOG ordinance PREPOSTORD FUD1_dichot
  /MODEL=POISSON
  /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM
     CORR COV
  /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID)
  /CRITERIA=CIN(95) ITERATE(20)
     CONVERGE(0.001) DELTA(.5)
  /DESIGN
     ordinance
     PREPOSTORD
     FUD1_dichot
     FUD1_dichot*PREPOSTORD
     FUD1_dichot*ordinance
     PREPOSTORD*ordinance
     FUD1_dichot*PREPOSTORD*ordinance.
                                       Run Syntax

                       25
Complete
Independence
   Model

     26
27
NOTE: All main effects…
 No interactions




28
GENLOG ordinance PREPOSTORD FUD1_dichot
  /MODEL=POISSON
  /PRINT=FREQ RESID ADJRESID ZRESID DEV
     ESTIM CORR COV
  /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID)
  /CRITERIA=CIN(95) ITERATE(20)
     CONVERGE(0.001) DELTA(.5)
  /DESIGN
     ordinance
     PREPOSTORD
     FUD1_dichot .

                                        Run Syntax

                       29
Block Independence
      Models
Testing whether one factor is independent of the
     relationship between two other factors



                       30
31
NOTE: Only one interaction
 effect




32
GENLOG ordinance PREPOSTORD FUD1_dichot
  /MODEL=POISSON
  /PRINT=FREQ RESID ADJRESID ZRESID DEV
     ESTIM CORR COV
  /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID)
  /CRITERIA=CIN(95) ITERATE(20)
     CONVERGE(0.001) DELTA(.5)
  /DESIGN
     ordinance
     PREPOSTORD
     FUD1_dichot
     PREPOSTORD*ordinance.



                                       Run Syntax

                       33
Testing whether one factor shares or mediates
  relationships between the other two factors



Partial Independence
        Models


                      34
NOTE: This is the
equivalent to what was
  being done in the
  original three-way
  crosstabs example




          35
NOTE: There are two
 interaction effects and they
 share a single factor




36
GENLOG ordinance PREPOSTORD FUD1_dichot
  /MODEL=POISSON
  /PRINT=FREQ RESID ADJRESID ZRESID DEV
     ESTIM CORR COV
  /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID)
  /CRITERIA=CIN(95) ITERATE(20)
     CONVERGE(0.001) DELTA(.5)
  /DESIGN
     ordinance
     PREPOSTORD
     FUD1_dichot
     PREPOSTORD*ordinance
     PREPOSTORD*FUD1_dichot.


                                       Run Syntax

                       37
Uniform
     Association Model
Testing whether the association between any two of the
 variables is the same at all levels of the third variable.



                             38
NOTE: All three two way
     interaction effects are present
     in the model




39
GENLOG ordinance PREPOSTORD FUD1_dichot
  /MODEL=POISSON
  /PRINT=FREQ RESID ADJRESID ZRESID DEV
     ESTIM CORR COV
  /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID)
  /CRITERIA=CIN(95) ITERATE(20)
     CONVERGE(0.001) DELTA(.5)
  /DESIGN
     ordinance
     PREPOSTORD
     FUD1_dichot
     PREPOSTORD*ordinance
     PREPOSTORD*FUD1_dichot
     FUD1_dichot*ordinance.
                                       Run Syntax

                       40
Showing the Effect




        41
60%


50%


40%


30%                                         Ord
                                            Non-Ord
20%


10%


0%
                   Pre               Post

      NOTE: Hypothetical Data




                                42
60%


50%


40%


30%                                         Ord
                                            Non-Ord
20%


10%


0%
                   Pre               Post

      NOTE: Hypothetical Data




                                43
60%


50%


40%


30%                                         Ord
                                            Non-Ord
20%


10%


0%
                   Pre               Post

      NOTE: Hypothetical Data




                                44
Complete independence model:




                               45
Complete independence model:




                               46
Complete independence model:




                               47
Uniform Association Model:




                             48
Uniform Association Model:




                             49
Uniform Association Model:




                             50
Tips and Tricks

 Plot both the observed and expected values for all models
 Consider if you want to work forward
 (independent  block  partial  uniform  saturated)

 or backward
 (saturated  uniform  block  partial  independent)

  Backward maybe quicker
 Example of non-significant and inconclusive result


                                                   Run Syntax

                             51
Contact information

Eric Canen
University of Wyoming,
Wyoming Survey & Analysis Center
ecanen@uwyo.edu

 Download presentation file and handout from AEA
 e-library




                         52

More Related Content

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Aea 2010 log linear models

  • 1. What Am I Supposed to Do With Three-Way Crosstabs? An Introduction to Log Linear Models ERIC CANEN, M.S. UNIVERSITY OF WYOMING WYOMING SURVEY & ANALYSIS CENTER EVALUATION 2010: EVALUATION QUALITY SAN ANTONIO, TX NOVEMBER 13, 2010
  • 2. Situation What effects? Community Level Communities 3
  • 3. Parents Have Favorable Attitude toward Smoking Would be Seen as cool for smoking Set Up Tried smoking during lifetime Pre-Ordinance Post-Ordinance Matched Communities Variables of Interest Pre/Post Smoked during past 30 days Friends Smoke 4
  • 4. Design Matched Communities Pre/Post Each Variable of Interest 2 X 2 X 2 5
  • 5. Expectations (Hypotheses) 6
  • 6. 60% 50% 40% 30% Ord Non-Ord 20% 10% 0% Pre Post NOTE: Hypothetical Data 7
  • 7. 60% 50% 40% 30% Ord Non-Ord 20% 10% 0% Pre Post NOTE: Hypothetical Data 8
  • 8. 60% 50% 40% 30% Ord Non-Ord 20% 10% 0% Pre Post NOTE: Hypothetical Data 9
  • 9. Analysis Try: Cross Tabulation Rows Columns Layers 10
  • 10. Seen As Cool Some chance OR Pretty No or very little chance good chance OR Very OR Little chance good chance Total Pre Ord Count 11443 1676 13119 Expected Count 11308.3 1810.7 13119.0 % of Total 52.6% 7.7% 60.3% Non-ord Count 7324 1329 8653 Expected Count 7458.7 1194.3 8653.0 % of Total 33.6% 6.1% 39.7% Total Count 18767 3005 21772 Expected Count 18767.0 3005.0 21772.0 % of Total 86.2% 13.8% 100.0% Post Ord Count 4137 603 4740 Expected Count 4083.0 657.0 4740.0 % of Total 50.8% 7.4% 58.2% Non-ord Count 2879 526 3405 Expected Count 2933.0 472.0 3405.0 % of Total 35.3% 6.5% 41.8% Total Count 7016 1129 8145 Expected Count 7016.0 1129.0 8145.0 % of Total 86.1% 13.9% 100.0% 11
  • 11. Chi-Square Tests Asymp. Sig. (2- Exact Sig. Exact Sig. Value df sided) (2-sided) (1-sided) Pre Pearson Chi- 29.251 1 .000 Square Likelihood Ratio 28.976 1 .000 N of Valid Cases 21772 Post Pearson Chi- 12.336 1 .000 Square Likelihood Ratio 12.243 1 .000 N of Valid Cases 8145 12
  • 12. Seen As Cool Some chance OR Pretty No or very little chance good chance OR Very OR Little chance good chance Total Pre Ord Count 11443 1676 13119 Expected Count 11308.3 1810.7 13119.0 % of Total 52.6% 7.7% 60.3% Non-ord Count 7324 1329 8653 Expected Count 7458.7 1194.3 8653.0 % of Total 33.6% 6.1% 39.7% Total Count 18767 3005 21772 Expected Count 18767.0 3005.0 21772.0 % of Total 86.2% 13.8% 100.0% Post Ord Count 4137 603 4740 Expected Expected Count Cell Probabilities: % of Total 4083.0 50.8% 657.0 7.4% 4740.0 58.2% P(AB|C) P(A) P(B) P(B|C)2879 P(AB) ==Count * * P(B) * P(C) P(ABC) =P(A) Non-ord P(A|C) * 526 3405 Expected Count 2933.0 472.0 3405.0 % of Total 35.3% 6.5% 41.8% Expected Count Count Total Cell Counts: Expected 7016 7016.0 1129 1129.0 8145 8145.0 E(nab))= n ofnP(AB) abc = = *Total P(AB|C) |C) % * P(ABC) n * 86.1% 13.9% 100.0% 13
  • 14. Analysis Loglinear Models Relationship Higher Order Modeling Cell Related to Model Alternative to Generalize between Terms ANOVA Counts Based Linear Models Crosstabs variables 15
  • 15. Assumptions  Data represent cross tabulated counts  No expected cell counts are zero cell counts and no more than 20% of the cells have expected cell counts <=5  If sample size was fixed then the cell counts are expected to follow a multinomial distribution  If sample size was not fixed then cell counts are expected to follow a Poisson distribution  Models look at relationships or association, like correlation (r statistic) 16
  • 16. Program Commands  SAS  Proc CatMod procedure  Proc GenMod procedure  R  loglin() function  glm() function  Stata  poisson command (Poison regression)  glm command  SPSS/PASW  GENLOG  GENLIN 17
  • 17. Saturated Model Or perfect fit model 18
  • 18. In SPSS: Analyze  Loglinear  General 19
  • 19. 20
  • 20. 21
  • 21. 22
  • 22. 23
  • 23. 24
  • 24. GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot FUD1_dichot*PREPOSTORD FUD1_dichot*ordinance PREPOSTORD*ordinance FUD1_dichot*PREPOSTORD*ordinance. Run Syntax 25
  • 26. 27
  • 27. NOTE: All main effects… No interactions 28
  • 28. GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot . Run Syntax 29
  • 29. Block Independence Models Testing whether one factor is independent of the relationship between two other factors 30
  • 30. 31
  • 31. NOTE: Only one interaction effect 32
  • 32. GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot PREPOSTORD*ordinance. Run Syntax 33
  • 33. Testing whether one factor shares or mediates relationships between the other two factors Partial Independence Models 34
  • 34. NOTE: This is the equivalent to what was being done in the original three-way crosstabs example 35
  • 35. NOTE: There are two interaction effects and they share a single factor 36
  • 36. GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot PREPOSTORD*ordinance PREPOSTORD*FUD1_dichot. Run Syntax 37
  • 37. Uniform Association Model Testing whether the association between any two of the variables is the same at all levels of the third variable. 38
  • 38. NOTE: All three two way interaction effects are present in the model 39
  • 39. GENLOG ordinance PREPOSTORD FUD1_dichot /MODEL=POISSON /PRINT=FREQ RESID ADJRESID ZRESID DEV ESTIM CORR COV /PLOT=RESID(ADJRESID) NORMPROB(ADJRESID) /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(.5) /DESIGN ordinance PREPOSTORD FUD1_dichot PREPOSTORD*ordinance PREPOSTORD*FUD1_dichot FUD1_dichot*ordinance. Run Syntax 40
  • 41. 60% 50% 40% 30% Ord Non-Ord 20% 10% 0% Pre Post NOTE: Hypothetical Data 42
  • 42. 60% 50% 40% 30% Ord Non-Ord 20% 10% 0% Pre Post NOTE: Hypothetical Data 43
  • 43. 60% 50% 40% 30% Ord Non-Ord 20% 10% 0% Pre Post NOTE: Hypothetical Data 44
  • 50. Tips and Tricks  Plot both the observed and expected values for all models  Consider if you want to work forward (independent  block  partial  uniform  saturated) or backward (saturated  uniform  block  partial  independent) Backward maybe quicker  Example of non-significant and inconclusive result Run Syntax 51
  • 51. Contact information Eric Canen University of Wyoming, Wyoming Survey & Analysis Center ecanen@uwyo.edu  Download presentation file and handout from AEA e-library 52

Editor's Notes

  1. All the factors are indepen
  2. Example height and weight are related but are independent of hair growth
  3. Example height and weight are related but are independent of hair growth
  4. Example height and weight are related but are independent of hair growth
  5. All the factors are indepen
  6. Note when only accounting for pre/post marginals, then non ordinance seem to consistently have lower percentages of students who have one or more friends who use cigarettes.
  7. Note: that pattern in the last slide reverses when you take into account the community size differences between ordinance and non ordinance communities and the pre-post count differences. Then the observed percentages of students who have friends who use cigarettes is actually higher in the non-ordinance case. Also notice the change in rates. The non-ordinance went from 45% to 42%. The ordinance went from 41% to 33%. Yet the complete independence model would have expected no change pre to post after accounting for the other two factors.