Interactions among Continuous Predictors

Similar documents
Simple, Marginal, and Interaction Effects in General Linear Models

Simple, Marginal, and Interaction Effects in General Linear Models: Part 1

Interactions among Categorical Predictors

A Re-Introduction to General Linear Models (GLM)

A Re-Introduction to General Linear Models

Time-Invariant Predictors in Longitudinal Models

Time-Invariant Predictors in Longitudinal Models

Course Introduction and Overview Descriptive Statistics Conceptualizations of Variance Review of the General Linear Model

Practice with Interactions among Continuous Predictors in General Linear Models (as estimated using restricted maximum likelihood in SAS MIXED)

Review of the General Linear Model

STA441: Spring Multiple Regression. This slide show is a free open source document. See the last slide for copyright information.

Course Introduction and Overview Descriptive Statistics Conceptualizations of Variance Review of the General Linear Model

Time-Invariant Predictors in Longitudinal Models

Categorical Predictor Variables

STA441: Spring Multiple Regression. More than one explanatory variable at the same time

Designing Multilevel Models Using SPSS 11.5 Mixed Model. John Painter, Ph.D.

Time-Invariant Predictors in Longitudinal Models

Generalized Linear Models for Non-Normal Data

Statistical Distribution Assumptions of General Linear Models

SAS Code for Data Manipulation: SPSS Code for Data Manipulation: STATA Code for Data Manipulation: Psyc 945 Example 1 page 1

Time Invariant Predictors in Longitudinal Models

An Introduction to Multilevel Models. PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012

Multilevel Models in Matrix Form. Lecture 7 July 27, 2011 Advanced Multivariate Statistical Methods ICPSR Summer Session #2

Review of Multiple Regression

Measurement Invariance (MI) in CFA and Differential Item Functioning (DIF) in IRT/IFA

Class Introduction and Overview; Review of ANOVA, Regression, and Psychological Measurement

POL 681 Lecture Notes: Statistical Interactions

Regression With a Categorical Independent Variable

EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7

Ch 7: Dummy (binary, indicator) variables

Introduction to Regression

Regression With a Categorical Independent Variable

Introduction to SAS proc mixed

Generalized Linear Models for Count, Skewed, and If and How Much Outcomes

Research Methods in Political Science I

Introduction to Within-Person Analysis and RM ANOVA

Introduction to SAS proc mixed

Describing Within-Person Fluctuation over Time using Alternative Covariance Structures

Advanced Quantitative Data Analysis

Review of CLDP 944: Multilevel Models for Longitudinal Data

Hierarchical Generalized Linear Models. ERSH 8990 REMS Seminar on HLM Last Lecture!

REVIEW 8/2/2017 陈芳华东师大英语系

Binary Logistic Regression

Sociology 593 Exam 2 Answer Key March 28, 2002

Linear Modelling in Stata Session 6: Further Topics in Linear Modelling

over Time line for the means). Specifically, & covariances) just a fixed variance instead. PROC MIXED: to 1000 is default) list models with TYPE=VC */

Regression: Main Ideas Setting: Quantitative outcome with a quantitative explanatory variable. Example, cont.

Profile Analysis Multivariate Regression

MLMED. User Guide. Nicholas J. Rockwood The Ohio State University Beta Version May, 2017

A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data

ECON 497 Midterm Spring

Longitudinal Data Analysis of Health Outcomes

36-309/749 Experimental Design for Behavioral and Social Sciences. Sep. 22, 2015 Lecture 4: Linear Regression

Exploratory Factor Analysis and Principal Component Analysis

STAT 135 Lab 11 Tests for Categorical Data (Fisher s Exact test, χ 2 tests for Homogeneity and Independence) and Linear Regression

Regression With a Categorical Independent Variable

Sociology 593 Exam 2 March 28, 2002

Chapter 4 Regression with Categorical Predictor Variables Page 1. Overview of regression with categorical predictors

Basic IRT Concepts, Models, and Assumptions

Exploratory Factor Analysis and Principal Component Analysis

Simple Linear Regression Using Ordinary Least Squares

Univariate Normal Distribution; GLM with the Univariate Normal; Least Squares Estimation

STAT 3900/4950 MIDTERM TWO Name: Spring, 2015 (print: first last ) Covered topics: Two-way ANOVA, ANCOVA, SLR, MLR and correlation analysis

Comparing IRT with Other Models

Econometric Modelling Prof. Rudra P. Pradhan Department of Management Indian Institute of Technology, Kharagpur

Generalized Models: Part 1

Introduction to Confirmatory Factor Analysis

Correlation and simple linear regression S5

Path Analysis. PRE 906: Structural Equation Modeling Lecture #5 February 18, PRE 906, SEM: Lecture 5 - Path Analysis

Longitudinal Modeling with Logistic Regression

Introduction to Generalized Models

Model Assumptions; Predicting Heterogeneity of Variance

36-309/749 Experimental Design for Behavioral and Social Sciences. Dec 1, 2015 Lecture 11: Mixed Models (HLMs)

Ron Heck, Fall Week 3: Notes Building a Two-Level Model

Example. Multiple Regression. Review of ANOVA & Simple Regression /749 Experimental Design for Behavioral and Social Sciences

Repeated Measures ANOVA Multivariate ANOVA and Their Relationship to Linear Mixed Models

Lecture 5: Omitted Variables, Dummy Variables and Multicollinearity

One-Way ANOVA. Some examples of when ANOVA would be appropriate include:

Formula for the t-test

Two-Level Models for Clustered* Data

Describing Within-Person Change over Time

Introduction to Random Effects of Time and Model Estimation

Math 1040 Final Exam Form A Introduction to Statistics Fall Semester 2010

Multivariate Regression (Chapter 10)

Course Review. Kin 304W Week 14: April 9, 2013

Estimation and Centering

Business Statistics. Lecture 9: Simple Regression

9. Linear Regression and Correlation

Analysing data: regression and correlation S6 and S7

Lab 10 - Binary Variables

MULTILEVEL MODELS. Multilevel-analysis in SPSS - step by step

Supplemental Materials. In the main text, we recommend graphing physiological values for individual dyad

Simple Linear Regression

AGEC 621 Lecture 16 David Bessler

General Principles Within-Cases Factors Only Within and Between. Within Cases ANOVA. Part One

SAS Syntax and Output for Data Manipulation: CLDP 944 Example 3a page 1

Overview. Multidimensional Item Response Theory. Lecture #12 ICPSR Item Response Theory Workshop. Basics of MIRT Assumptions Models Applications

SPSS Output. ANOVA a b Residual Coefficients a Standardized Coefficients

Interpreting and using heterogeneous choice & generalized ordered logit models

Group Comparisons: Differences in Composition Versus Differences in Models and Effects

Transcription:

Interactions among Continuous Predictors Today s Class: Simple main effects within two-way interactions Conquering TEST/ESTIMATE/LINCOM statements Regions of significance Three-way interactions (and beyond ) SPLH 861: Lecture 2 1

Representing the Effects of Predictors From now on, we will think carefully about exactly how the predictor variables are entered into the model for the means (i.e., by which a predicted outcome is created for each person) Why don t people always care? Because the scale of predictors: Does NOT affect the amount of outcome variance accounted for (R 2 ) Does NOT affect the outcomes values predicted by the model for the means (so long as the same predictor fixed effects are included) Why should this matter to us? Because the Intercept = expected outcome value when X = 0 Can end up with nonsense values for intercept if X = 0 isn t in the data, so we need to change the scale of the predictors to include 0 Scaling becomes more important once interactions are included or once random intercepts are included (i.e., variability around fixed intercept) SPLH 861: Lecture 2 2

Adjusting the Scale of Predictors For continuous (quantitative) predictors, we will make the intercept interpretable by centering: Centering = subtract a constant from each variable value so that the 0 value falls within the range of the new centered predictor variable Typical Center around predictor s mean: Centered X X X Intercept is then expected outcome for average X 1 person Better Center around meaningful constant C: Centered X X Intercept is then expected outcome for person with that constant (even 0 may be ok) For binary predictors, it can be more convenient to treat them as continuous than as categorical by doing manual coding: Accomplished via dummy coding (aka, reference group coding ) Two-group example using Gender: 0 = Men, 1 = Women (or 0 = Women, 1 = Men) SPLH 861: Lecture 2 3

Interactions: Interaction = Moderation: the effect of a predictor depends on the value of the interacting predictor Either predictor can be the moderator (interpretive distinction only) Interactions can always be evaluated for any combination of categorical and continuous predictors, although traditionally In ANOVA : By default, all possible interactions are estimated Software does this for you; oddly enough, nonsignificant interactions usually still are kept in the model (even if only significant interactions are interpreted) In ANCOVA : Continuous predictors ( covariates ) do not get to be part of interaction terms homogeneity of regression assumption There is no reason to assume this it is a testable hypothesis! In Regression : No default the effects of predictors are as you specify Requires most thought, but gets annoying because in regression programs you usually have to manually create the interaction as an observed variable: e.g., XZinteraction = centeredx * centeredz Interaction variables are created on the fly in MIXED instead! SPLH 861: Lecture 2 4

Main Effects of Predictors within Interactions Main effects of predictors within interactions should remain in the model regardless of whether or not they are significant An interaction is an over-additive (enhancing) or under-additive (dampening) effect, so what it is additive to must be included The role of a two-way interaction is to adjust its main effects However, the idea of a main effect no longer applies each main effect is conditional on the interacting predictor = 0 e.g., Model of Y = W, X, Z, X*Z: The effect of W is still a main effect because it is not part of an interaction The effect of X is now the conditional main effect of X specifically when Z=0 The effect of Z is now the conditional main effect of Z specifically when X=0 Note that this is a different type of conditionality than just holding the other predictors constant (which means constant at any value) Constant at the 0 value of the interacting predictor(s), specifically SPLH 861: Lecture 2 5

Interactions: Why 0 Matters Y = Student achievement (GPA as percentage out of 100) X = Parent attitudes about education (measured on 1-5 scale) Z = Father s education level (measured in years of education) GPA i = β 0 + (β 1 *Att i ) + (β 2 *Ed i )+ (β 3 *Att i *Ed i ) + e i GPA i = 30 + (1*Att i ) + (2*Ed i ) + (0.5*Att i *Ed i ) + e i Interpret β 0 : Interpret β 1 : Interpret β 2 : Interpret β 3 : Attitude as Moderator: Education as Moderator: Predicted GPA for attitude of 3 and Ed of 12? 75 = 30 + 1*(3) + 2*(12) + 0.5*(3)*(12) SPLH 861: Lecture 2 6

Model-Implied Simple Main Effects Original: GPA i = β 0 +(β 1 *Att i )+ (β 2 *Ed i ) + (β 3 *Att i *Ed i )+ e i GPA i = 30 + (1*Att i )+ (2*Ed i )+ (0.5*Att i *Ed i )+ e i Given any values of the predictor variables, the model equation provides predictions for: Value of outcome (model-implied intercept for non-zero predictor values) Any conditional (simple) main effects implied by an interaction term Simple (Conditional) Main Effect = what it is + what modifies it Step 1: Identify all terms in model involving the predictor of interest e.g., Effect of Attitudes comes from: β 1 *Att i + β 3 *Att i *Ed i Step 2: Factor out common predictor variable Start with [β 1 *Att i + β 3 *Att i *Ed i ] [Att i (β 1 + β 3 *Ed i )] Att i (new β 1 ) Value given by ( ) is then the model-implied coefficient for the predictor Step 3: Calculate model-implied simple effect and SE Let s try it for a new reference point of attitude = 3 and education = 12 SPLH 861: Lecture 2 7

Model-Implied Simple Main Effects Old Equation using uncentered predictors: GPA i = β 0 +(β 1 *Att i )+ (β 2 *Ed i ) + (β 3 *Att i *Ed i )+ e i GPA i = 30 + (1*Att i )+ (2*Ed i )+ (0.5*Att i *Ed i )+ e i New equation using centered predictors (Att i 3 and Ed i 12): GPA i = + *(Att i 3)+ *(Ed i 12) + *(Att i 3)*(Ed i 12)+e i Intercept: expected value of GPA when Att i =3 and Ed i =12 β 0 = 75 Simple main effect of Att if Ed i =12 β 1 *Att i + β 3 *Att i *Ed i Att i (β 1 + β 3 *Ed i ) Att i (1+0.5*12) Simple main effect of Ed if Att i =3 β 2 *Ed i + β 3 *Att i *Ed i Ed i (β 2 + β 3 *Att i ) Ed i (2+0.5*3) Two-way interaction of Att and Ed: (0.5*Att i *Ed i ) SPLH 861: Lecture 2 8

Significance of Model-Implied Fixed Effects We now know how to calculate simple (conditional) main effects: Effect of interest = what it is + what modifies it e.g., Effect of Attitudes = β 1 + β 3 *Ed But if we want to test whether that new effect is 0, we also need its standard error (SE to get Wald test t- or z-value p-value) Even if the simple (conditional) main effect is not directly given by the model, its estimate and SE are still implied by the model 3 options to get the new simple (conditional) main effect estimate and SE (in order of least to most annoying): 1. Ask the software to give it to you using your original model (e.g., ESTIMATE in SAS, TEST in SPSS, LINCOM in STATA, NEW in Mplus most programs will do this if you know how to ask) SPLH 861: Lecture 2 9

Significance of Model-Implied Fixed Effects 2. Re-center your predictors to the interacting value of interest (e.g., make attitudes=3 the new 0 for attitudes) and re-estimate your model; repeat as needed for each value of interest 3. Hand calculations (what the program does for you in option #1) For example: Effect of Attitudes = β 1 + β 3 *Ed SE 2 = sampling variance of estimate e.g., Var(β 1 ) = SE β1 2 SE β12 = Var(β 1 ) + Var(β 3 )*Ed + 2Cov(β 1,β 3 )*Ed Values come from asymptotic (sampling) covariance matrix (COVB) Variance of a sum of terms always includes 2*covariance among them Here, this is because what each main effect estimate could be is related to what the other main effect estimates could be Note that if a main effect is unconditional, its SE 2 = Var(β) only SPLH 861: Lecture 2 10

1. Model-Implied Simple Main Effects Old Equation using uncentered predictors: GPA i = β 0 +(β 1 *Att i )+ (β 2 *Ed i ) + (β 3 *Att i *Ed i )+ e i GPA i = 30 + (1*Att i )+ (2*Ed i )+ (0.5*Att i *Ed i )+ e i Intercept: predicted GPA if Att i =3 and Ed i =12? Simple main effect of Att if Ed i =12? Att i (β 1 + β 3 *Ed i ) Simple main effect of Ed if Att i =3? Ed i (β 2 + β 3 *Att i ) ECHO 'Requesting Model-Implied Fixed Effects From Previous Slide'. MIXED y WITH att ed /METHOD = REML /PRINT = SOLUTION TESTCOV /FIXED = att ed att*ed /TEST = "Pred GPA if Att=3 Ed=12" intercept 1 att 3 ed 12 att*ed 36 /TEST = "Effect of Att if Ed=12" att 1 att*ed 12 /TEST = "Effect of Ed if Att=3" ed 1 att*ed 3. In TEST statements, the variables refer to their betas; the numbers refer to the operations of their betas. These estimates would be given directly by the fixed effects instead if you recentered the predictors as: Att-3, Ed-12. SPLH 861: Lecture 2 11

Requesting Model-Implied Fixed Effects To request predicted outcomes (= intercepts): Need to start with "intercept 1" (for β 0 ) ALL model effects must be included or else are held = 0 Note: predictors on CLASS/BY statements must be given a value (more on this next week) For example: regression after centering both predictors GPA i = β 0 +(β 1 *Att i 3)+ (β 2 *Ed i 12) + (β 3 *Att i 3*Ed i 12)+e i "GPA if Att=5 Ed=16" intercept 1 att ed att*ed "GPA if Att=1 Ed=12" intercept 1 att ed att*ed "GPA if Att=3 Ed=20" intercept 1 att ed att*ed SPLH 861: Lecture 2 12

Requesting Model-Implied Fixed Effects To request predicted slopes (= simple main effects): DO NOT start with "intercept 1" (β 0 does not contribute to slopes) NOT ALL model effects must be included (only what modifies the slope) Note: predictors on CLASS/BY statements must be given a value if they modify the slope in an interaction (more on this next week) For example: regression after centering both predictors GPA i = β 0 +(β 1 *Att i 3)+ (β 2 *Ed i 12) + (β 3 *Att i 3*Ed i 12)+e i "Att Slope if Ed=10" intercept 0 att ed att*ed "Att Slope if Ed=18" intercept 0 att ed att*ed "Ed Slope if Att=2" intercept 0 att ed att*ed "Ed Slope if Att=5" intercept 0 att ed att*ed SPLH 861: Lecture 2 13

Regions of Significance for Main Effects For continuous predictors, there may not be specific values of the moderator at which you want to know significance For example, age*woman (in which 0=man, 1=woman): y i = β 0 +(β 1 *Age i 85)+(β 2 *Woman i )+(β 3 *Age i 85*Woman i )+e i Age slopes are only possible for two specific values of woman: "Age Slope for Men" age85 woman age85*woman "Age Slope for Women" age85 woman age85*woman But there are many ages to request gender differences for... "Gender Diff at Age=80" age85 woman age85*woman "Gender Diff at Age=90" age85 woman age85*woman SPLH 861: Lecture 2 14

Regions of Significance for Main Effects An alternative approach for continuous moderators is known as regions of significance (see Hoffman 2014 ch 2. for refs) Rather than asking if the simple main effect of gender is still significant at a particular age, we can find the boundary ages at which the gender effect becomes non-significant We know that: EST / SE = t-value if t > 1.96, then p<.05 So we work backwards to find the EST and SE such that: Slope Estimate ± t = ±1.96 =, where: Variance of Slope Estimate Gender Slope (Gender Difference) Estimate = Age 85 2 3 Need to request asymptotic covariance matrix (COVB) Covariance matrix of fixed effect estimates (SE 2 on diagonal) Variance of Slope Estimate = Var 2Cov Age 85 Var Age 85 2 2 3 3 2 SPLH 861: Lecture 2 15

Regions of Significance for Main Effects Slope Estimate ± t = ±1.96 =, where: Variance of Slope Estimate For example, age*woman (0=man, 1=woman), age = moderator: y i = β 0 +(β 1 *Age i 85)+(β 2 *Woman i )+(β 3 *Age i 85*Woman i )+e i β 2 = 0.5306* at age=85, Var(β 2 ) SE 2 for β 2 = 0.06008 β 3 = 0.1104* unconditional, Var(β 3 ) SE 2 for β 3 = 0.00178 Covariance of β 2 SE and β 3 SE = 0.00111 2 3 Gender Slope (Gender Difference) Estimate = Age 85 Variance of Slope Estimate = Var 2Cov Age 85 Var Age 85 2 2 3 3 Regions of Significance for Moderator of Age = 60.16 to 79.52 The gender effect β 2 is predicted to be significantly negative above age 79.52, non-significant from ages 79.52 to 60.16, and significantly positive below age 60.16 (because non-parallel lines will cross eventually). SPLH 861: Lecture 2 16 2

More Generally Can decompose a 2-way interaction by testing the simple effect of X at different levels of Z (and vice-versa) Use TESTs to request simple effects at any point of the interacting predictor Regions of significance are useful for continuous interacting predictors More general rules of interpretation, given a 3-way interaction: Simple (main) effects move the intercept 1 possible interpretation for each simple main effect Each simple main effect is conditional on other two variables = 0 The 2-way interactions (3 of them in a 3-way model) move the simple effects 2 possible interpretations for each 2-way interaction Each simple 2-way interaction is conditional on third variable = 0 The 3-way interaction moves each of the 2-way interactions 3 possible interpretations of the 3-way interaction Is highest-order term in model, so is unconditional (applies always) SPLH 861: Lecture 2 17

Practice with 3-Way Interactions Intercept = 5, Effect of X = 1.0, Effect of Z = 0.50, Effect of W = 0.20 X*Z =.10 (applies specifically when W is 0) #1: for every 1-unit X, #2: for every 1-unit Z, X*W =.01 (applies specifically when Z is 0) #1: for every 1-unit X, #2: for every 1-unit W, Z*W =.05 (applies specifically when X is 0) #1: for every 1-unit Z, #2: for every 1-unit W, X*Z*W =.001 (unconditional because is highest order) #1: for every 1-unit X, #2: for every 1-unit Z, #3: for every 1-unit W, SPLH 861: Lecture 2 18

Practice with 3-Way Interactions Model: Formula to get simple main effects: Simple effect of X = Simple effect of Z = Simple effect of W = Formula to get simple 2-way interactions: Simple X*Z = Simple X*W = Simple Z*W = SPLH 861: Lecture 2 19

Interpreting Interactions: Summary Interactions represent moderation the idea that the effect of one variable depends upon the level of other(s) The main effects WILL CHANGE in once an interaction with them is added, because they now mean different things: Main effect Simple effect specifically when interacting predictor = 0 Need to have 0 as a meaningful value for each predictor for that reason Rules for interpreting conditional (simple) fixed effects: Intercepts are conditional on (i.e., get adjusted by) main effects Main effects are conditional on two-ways (become simple main effects ) Two-ways are conditional on three-ways... And so forth Highest-order term is unconditional same regardless of centering SPLH 861: Lecture 2 20

Creating Predicted Outcomes Figures of predicted outcomes will be essential in describing interaction terms (especially in talks and posters) Three ways to get them (in order of most to least painful): 1. In excel: input fixed effects, input variable values, write equation to create predicted outcomes for each row Good for pedagogy, but gets old quickly (and error-prone) 2. Via programming statements: Per prediction: Use SAS ESTIMATE or SPSS TEST For a range of predictor values: Use STATA MARGINS 3. Via fake people (most useful in SPSS and SAS) Add cases to your data with desired predictor values (no outcomes) Ask program to save predicted outcomes for all cases (FIXPRED in SPSS) Fake cases won t contribute to model, but will get predicted outcomes SPLH 861: Lecture 2 21