Loglinear Contingency Table Analysis Karl L. Wuensch Dept of Psychology East Carolina University.

Slides:



Advertisements
Similar presentations
SPSS Session 5: Association between Nominal Variables Using Chi-Square Statistic.
Advertisements

Chapter 16: Chi Square PSY —Spring 2003 Summerfelt.
Simple Logistic Regression
1 Contingency Tables: Tests for independence and homogeneity (§10.5) How to test hypotheses of independence (association) and homogeneity (similarity)
Loglinear Models for Independence and Interaction in Three-way Tables Veronica Estrada Robert Lagier.
Statistical Inference for Frequency Data Chapter 16.
Analysis of frequency counts with Chi square
Log-linear Analysis - Analysing Categorical Data
Structural Equation Modeling
1 STA 517 – Introduction: Distribution and Inference 1.5 STATISTICAL INFERENCE FOR MULTINOMIAL PARAMETERS  Recall multi(n, =( 1,  2, …,  c ))  Suppose.
PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010.
Chi-Square and Analysis of Variance (ANOVA) Lecture 9.
Chi-square Test of Independence
1 Modeling Ordinal Associations Section 9.4 Roanna Gee.
Crosstabs and Chi Squares Computer Applications in Psychology.
Handling Categorical Data. Learning Outcomes At the end of this session and with additional reading you will be able to: – Understand when and how to.
Aaker, Kumar, Day Seventh Edition Instructor’s Presentation Slides
An Introduction to Logistic Regression
WLS for Categorical Data
1 Chapter 20 Two Categorical Variables: The Chi-Square Test.
Example of Simple and Multiple Regression
Statistics for the Social Sciences Psychology 340 Fall 2013 Tuesday, November 19 Chi-Squared Test of Independence.
Xuhua Xia Smoking and Lung Cancer This chest radiograph demonstrates a large squamous cell carcinoma of the right upper lobe. This is a larger squamous.
Statistics for the Social Sciences Psychology 340 Fall 2013 Thursday, November 21 Review for Exam #4.
Log-linear Models For 2-dimensional tables. Two-Factor ANOVA (Mean rot of potatoes) Bacteria Type Temp123 1=Cool 2=Warm.
This Week: Testing relationships between two metric variables: Correlation Testing relationships between two nominal variables: Chi-Squared.
Aaker, Kumar, Day Ninth Edition Instructor’s Presentation Slides
Categorical Data Analysis School of Nursing “Categorical Data Analysis 2x2 Chi-Square Tests and Beyond (Multiple Categorical Variable Models)” Melinda.
One-Factor Experiments Andy Wang CIS 5930 Computer Systems Performance Analysis.
Two Way ANOVAs Factorial Designs. Factors Same thing as Independent variables. Referred to as factors when there are more than one in a study. Factorial.
Chi-Square Test of Independence Practice Problem – 1
LOG-LINEAR MODEL FOR CONTIGENCY TABLES Mohd Tahir Ismail School of Mathematical Sciences Universiti Sains Malaysia.
Logit model, logistic regression, and log-linear model A comparison.
A. Analysis of count data
Chi-square (χ 2 ) Fenster Chi-Square Chi-Square χ 2 Chi-Square χ 2 Tests of Statistical Significance for Nominal Level Data (Note: can also be used for.
Chapter 9: Non-parametric Tests n Parametric vs Non-parametric n Chi-Square –1 way –2 way.
Multiple regression - Inference for multiple regression - A case study IPS chapters 11.1 and 11.2 © 2006 W.H. Freeman and Company.
Randomized Block Design (Kirk, chapter 7) BUSI 6480 Lecture 6.
Multilevel Linear Modeling aka HLM. The Design We have data at two different levels In this case, 7,185 students (Level 1) Nested within 160 Schools (Level.
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Pearson Chi-Square Contingency Table Analysis.
Education 793 Class Notes Presentation 10 Chi-Square Tests and One-Way ANOVA.
Slide 26-1 Copyright © 2004 Pearson Education, Inc.
Nonparametric Tests: Chi Square   Lesson 16. Parametric vs. Nonparametric Tests n Parametric hypothesis test about population parameter (  or  2.
Reasoning in Psychology Using Statistics
BPS - 5th Ed. Chapter 221 Two Categorical Variables: The Chi-Square Test.
CHI SQUARE TESTS.
Chi-square Test of Independence
Chapter 13 CHI-SQUARE AND NONPARAMETRIC PROCEDURES.
Reasoning in Psychology Using Statistics Psychology
Chapter 13 Inference for Counts: Chi-Square Tests © 2011 Pearson Education, Inc. 1 Business Statistics: A First Course.
General Linear Model.
1 STA 617 – Chp10 Models for matched pairs Summary  Describing categorical random variable – chapter 1  Poisson for count data  Binomial for binary.
Log-linear Models HRP /03/04 Log-Linear Models for Multi-way Contingency Tables 1. GLM for Poisson-distributed data with log-link (see Agresti.
12/23/2015Slide 1 The chi-square test of independence is one of the most frequently used hypothesis tests in the social sciences because it can be used.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L14.1 Lecture 14: Contingency tables and log-linear models Appropriate questions.
Class Seven Turn In: Chapter 18: 32, 34, 36 Chapter 19: 26, 34, 44 Quiz 3 For Class Eight: Chapter 20: 18, 20, 24 Chapter 22: 34, 36 Read Chapters 23 &
Chapter 11 REGRESSION Multiple Regression  Uses  Explanation  Prediction.
ERIC CANEN, M.S. UNIVERSITY OF WYOMING WYOMING SURVEY & ANALYSIS CENTER EVALUATION 2010: EVALUATION QUALITY SAN ANTONIO, TX NOVEMBER 13, 2010 What Am I.
Categorical Data Aims Loglinear models Categorical data
Multiple Regression.
Two Way ANOVAs Factorial Designs.
6-1 Introduction To Empirical Models
Reasoning in Psychology Using Statistics
Statistics in SPSS Lecture 9
Introduction to log-linear models
Reasoning in Psychology Using Statistics
Reasoning in Psychology Using Statistics
Reasoning in Psychology Using Statistics
Karl L. Wuensch Department of Psychology East Carolina University
Presentation transcript:

Loglinear Contingency Table Analysis Karl L. Wuensch Dept of Psychology East Carolina University

The Data

Weight Cases by Freq

Crosstabs

Cell Statistics

LR Chi-Square

Model Selection Loglinear HILOGLINEAR happy(1 2) marital(1 3) /CRITERIA ITERATION(20) DELTA(0) /PRINT=FREQ ASSOCIATION ESTIM /DESIGN. No cells with count = 0, so no need to add.5 to each cell. Saturated model = happy, marital, Happy x Marital

In Each Cell, O=E, Residual = 0

The Model Fits the Data Perfectly, Chi-Square = 0 The smaller the Chi-Square, the better the fit between model and data.

Both One- and Two-Way Effects Are Significant The LR Chi-Square for Happy x Marital has the same value we got with Crosstabs

The Model: Parameter Mu LN(cell freq) ij =  + i + j + ij We are predicting natural logs of the cell counts.  is the natural log of the geometric mean of the expected cell frequencies. For our data, and LN( ) =

The Model: Lambda Parameters LN(cell freq) ij =  + i + j + ij i is the parameter associated with being at level i of the row variable. There will be (r-1) such parameters for r rows, And (c-1) lambda parameters, j, for c columns, And (r-1)(c-1) lambda parameters, for the interaction, ij.

Lambda Parameter Estimates

Main Effect of Marital Status For Marital = 1 (married), = for Marital = 2 (single), = ‑.415 For each effect, the lambda coefficients must sum to zero, so For Marital = 3 (split), = 0 ‑ (.397 ‑.415) =.018.

Main Effect of Happy For Happy = 1 (yes), = Accordingly, for Happy =2 (no), is ‑.885.

Happy x Marital For cell 1,1 (Happy, Married), = So for [Unhappy, Married], = For cell 1,2 (Happy, Single), = So for [Unhappy, Single], = For cell 1,3 (Happy, Split), = 0 ‑ (.346 ‑.111) = ‑.235 And for [Unhappy, Split], = 0 ‑ ( ‑.235) =

Interpreting the Interaction Parameters For (Happy, Married), = There are more scores in that cell than would be expected from the marginal counts. For (Happy, Split), = 0 ‑.235 There are fewer scores in that cell than would be expected from the marginal counts.

Predicting Cell Counts Married, Happy e ( ) = 786 (within rounding error of the actual frequency, 787) Split, Unhappy e ( ) =82, the actual frequency.

Testing the Parameters The null is that lambda is zero. Divide by standard error to get a z score. Every one of our effects has at least one significant parameter. We really should not drop any of the effects from the model, but, for pedagogical purposes, ………

Drop Happy x Marital From the Model HILOGLINEAR happy(1 2) marital(1 3) /CRITERIA ITERATION(20) DELTA(0) /PRINT=FREQ RESID ASSOCIATION ESTIM /DESIGN happy marital. Notice that the design statement does not include the interaction term.

Uh-Oh, Big Residuals A main effects only model does a poor job of predicting the cell counts.

Big Chi-Square = Poor Fit Notice that the amount by which the Chi- Square increased = the value of Chi- Square we got earlier for the interaction term.

Pairwise Comparisons Break down the 3 x 2 table into three 2 x 2 tables. Married folks report being happy significantly more often than do single persons or divorced persons. The difference between single and divorced persons falls short of statistical significance.

SPSS Loglinear LOGLINEAR Happy(1,2) Marital(1,3) / CRITERIA=Delta(0) / PRINT=DEFAULT ESTIM / DESIGN=Happy Marital Happy by Marital. Replicates the analysis we just did using Hiloglinear. More later on the differences between Loglinear and Hiloglinear.

SAS Catmod options pageno=min nodate formdlim='-'; data happy; input Happy Marital count; cards; proc catmod; weight count; model Happy*Marital = _response_; Loglin Happy|Marital; run;

PASW GENLOG GENLOG happy marital /MODEL=POISSON /PRINT=FREQ DESIGN ESTIM CORR COV /PLOT=NONE /CRITERIA=CIN(95) ITERATE(20) CONVERGE(0.001) DELTA(0) /DESIGN.

GENLOG Coding Uses dummy coding, not effects coding. –Dummy = One level versus reference level –Effects = One level versus versus grand mean I don’t like it.

Catmod Output Parameter estimates same as those with Hilog and loglinear. For the tests of these paramaters, SAS’ Chi-Square = the square of the z from PASW. I don’t know how the entries in the ML ANOVA table were computed.