University of North Carolina at Chapel Hill

Slides:



Advertisements
Similar presentations
Statistical Analysis SC504/HS927 Spring Term 2008
Advertisements

Two-sample tests. Binary or categorical outcomes (proportions) Outcome Variable Are the observations correlated?Alternative to the chi- square test if.
Qualitative predictor variables
Brief introduction on Logistic Regression
Computing for Research I Spring 2013 Primary Instructor: Elizabeth Garrett-Mayer Regression Using Stata February 19.
Logistic Regression I Outline Introduction to maximum likelihood estimation (MLE) Introduction to Generalized Linear Models The simplest logistic regression.
Binary Logistic Regression: One Dichotomous Independent Variable
Logistic Regression.
Simple Logistic Regression
What is Interaction for A Binary Outcome? Chun Li Department of Biostatistics Center for Human Genetics Research September 19, 2007.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 13 Nonlinear and Multiple Regression.
Some Terms Y =  o +  1 X Regression of Y on X Regress Y on X X called independent variable or predictor variable or covariate or factor Which factors.
Sociology 601 Class 28: December 8, 2009 Homework 10 Review –polynomials –interaction effects Logistic regressions –log odds as outcome –compared to linear.
Introduction to Logistic Regression. Simple linear regression Table 1 Age and systolic blood pressure (SBP) among 33 adult women.
BIOST 536 Lecture 9 1 Lecture 9 – Prediction and Association example Low birth weight dataset Consider a prediction model for low birth weight (< 2500.
Logistic Regression Biostatistics 510 March 15, 2007 Vanessa Perez.
BIOST 536 Lecture 4 1 Lecture 4 – Logistic regression: estimation and confounding Linear model.
Marshall University School of Medicine Department of Biochemistry and Microbiology BMS 617 Lecture 12: Multiple and Logistic Regression Marshall University.
Logistic Regression II Simple 2x2 Table (courtesy Hosmer and Lemeshow) Exposure=1Exposure=0 Disease = 1 Disease = 0.
Logistic Regression. Outline Review of simple and multiple regressionReview of simple and multiple regression Simple Logistic RegressionSimple Logistic.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition. Calculating interaction patterns from logit coefficients: Interaction between two.
Using the Margins Command to Estimate and Interpret Adjusted Predictions and Marginal Effects Richard Williams
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition. Calculating the shape of a polynomial from regression coefficients Jane E. Miller,
Excepted from HSRP 734: Advanced Statistical Methods June 5, 2008.
Correlation and Regression SCATTER DIAGRAM The simplest method to assess relationship between two quantitative variables is to draw a scatter diagram.
Business Intelligence and Decision Modeling Week 11 Predictive Modeling (2) Logistic Regression.
Introduction to Logistic Regression Rachid Salmi, Jean-Claude Desenclos, Alain Moren, Thomas Grein.
Simple Linear Regression. Deterministic Relationship If the value of y (dependent) is completely determined by the value of x (Independent variable) (Like.
Applied Epidemiologic Analysis - P8400 Fall 2002
University of Warwick, Department of Sociology, 2014/15 SO 201: SSAASS (Surveys and Statistics) (Richard Lampard) Week 7 Logistic Regression I.
AN INTRODUCTION TO LOGISTIC REGRESSION ENI SUMARMININGSIH, SSI, MM PROGRAM STUDI STATISTIKA JURUSAN MATEMATIKA UNIVERSITAS BRAWIJAYA.
Multiple Regression and Model Building Chapter 15 Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
APPLIED DATA ANALYSIS IN CRIMINAL JUSTICE CJ 525 MONMOUTH UNIVERSITY Juan P. Rodriguez.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
Week 5: Logistic regression analysis Overview Questions from last week What is logistic regression analysis? The mathematical model Interpreting the β.
1 GCRC Data Analysis with SPSS Workshop Session 5 Follow Up on FEV data Binary and Categorical Outcomes 2x2 tables 2xK tables JxK tables Logistic Regression.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition. Interpreting multivariate OLS and logit coefficients Jane E. Miller, PhD.
Logistic Regression. Linear Regression Purchases vs. Income.
Multiple Logistic Regression STAT E-150 Statistical Methods.
© Department of Statistics 2012 STATS 330 Lecture 19: Slide 1 Stats 330: Lecture 19.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition. Visualizing shapes of interaction patterns between two categorical independent.
Logistic Regression. Linear regression – numerical response Logistic regression – binary categorical response eg. has the disease, or unaffected by the.
A first order model with one binary and one quantitative predictor variable.
The dangers of an immediate use of model based methods The chronic bronchitis study: bronc: 0= no 1=yes poll: pollution level cig: cigarettes smokes per.
Logistic Regression Analysis Gerrit Rooks
POPLHLTH 304 Regression (modelling) in Epidemiology Simon Thornley (Slides adapted from Assoc. Prof. Roger Marshall)
Introduction to Multiple Regression Lecture 11. The Multiple Regression Model Idea: Examine the linear relationship between 1 dependent (Y) & 2 or more.
1 Introduction to Modeling Beyond the Basics (Chapter 7)
Exact Logistic Regression
Logistic Regression An Introduction. Uses Designed for survival analysis- binary response For predicting a chance, probability, proportion or percentage.
Birthweight (gms) BPDNProp Total BPD (Bronchopulmonary Dysplasia) by birth weight Proportion.
Analysis of matched data Analysis of matched data.
Lecturer: Ing. Martina Hanová, PhD.. Regression analysis Regression analysis is a tool for analyzing relationships between financial variables:  Identify.
Marshall University School of Medicine Department of Biochemistry and Microbiology BMS 617 Lecture 13: Multiple, Logistic and Proportional Hazards Regression.
LOGISTIC REGRESSION. Purpose  Logistical regression is regularly used when there are only two categories of the dependent variable and there is a mixture.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition. Calculating interaction effects from OLS coefficients: Interaction between 1 categorical.
BINARY LOGISTIC REGRESSION
Advanced Quantitative Techniques
Simple Linear Regression
Logistic Regression APKC – STATS AFAC (2016).
Advanced Quantitative Techniques
REGRESSION (R2).
Notes on Logistic Regression
Advanced Quantitative Techniques
Introduction to logistic regression a.k.a. Varbrul
Introduction to Logistic Regression
Multiple logistic regression
University of North Carolina at Chapel Hill
Introduction to Logistic Regression
Logistic Regression.
Presentation transcript:

University of North Carolina at Chapel Hill Using Stata Graphics as a Method of Understanding and Presenting Interaction Effects Joanne M. Garrett, PhD University of North Carolina at Chapel Hill July 11, 2005

Problems with Understanding Interaction Interaction difficult concept to explain not a single answer (point estimate) linear combination of betas Often ignored because of difficulty Graph of interaction may be more intuitive for: students learning the concept presentations at professional meetings

Low Birth Weight Study* Variable Description Coding low Low birth weigh 1 = ≤ 2500 gms 0 = >2500 gms bwt Birth weight grams smk Smoked during pregnancy 1 = smoked 0 = did not smoke race Mother’s race 1 = black 0 = white age Mother’s age years * “Loosely” adapted from data from Applied Logistic Regression, David W. Hosmer, Jr. and Stanley Lemeshow

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) Logistic regression model: Add smk by race interaction Create interaction term and run logistic regression: . gen smkxrace = smk * race . logistic low smk race smkxrace

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) -------------------------------------------------- low | OR z P>|z| [95% CI] ---------+---------------------------------------- smk | 5.76 4.14 0.000 2.51 13.19 race | 5.43 4.13 0.000 2.43 12.15 smkxrace | .320 -2.08 0.038 .109 .936 Significant interaction: Relationship differs between smoking and low birth wt depending on mother’s race Question: How to interpret the interaction OR?

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) Convert OR’s to beta coefficients and solve by categories of race: . logit -------------------------------------------------- low | Coef. z P>|z| [95% CI] ---------+---------------------------------------- smk | 1.751 4.14 0.000 0.921 2.580 race | 1.693 4.13 0.000 0.889 2.497 smkxrace | -1.141 -2.08 0.038 -2.216 -0.066 _cons| -2.303 White: OR = e [β1 + β3(race)] = e [1.751 – 1.141(0)] = 5.76 Black: OR = e [β1 + β3(race)] = e [1.751 – 1.141(1)] = 1.84

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) White: . lincom smk + 0*smkxrace ---------------------------------------------- low | OR z P>|z| [95% CI] -----+---------------------------------------- (1) | 5.76 4.14 0.000 2.51 13.2 Black: . lincom smk + 1*smkxrace (1) | 1.84 1.75 0.081 .928 3.65

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) Interpretation: Among whites, women who smoke have 5.8 times the odds of having a low birth wt baby Among blacks, there is no relationship between smoking and having a low birth wt baby (OR=1.8, but not statistically significant)

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) Misinterpretations: Black mothers have less “risk” for low birth wt babies compared to white mothers It’s okay for black mothers to smoke Alternative: Solve the equation for values of smk and race Graph the individual probabilities (“predxcat”) . predxcat low, xvar(race smk) graph bar

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white) +-------------------------------------------------+ | race smk numobs prob lower upper | |-------------------------------------------------| | 0:White 0:No 88 0.091 0.046 0.171 | | 0:White 1:Yes 104 0.365 0.279 0.462 | | 1:NonWh 0:No 142 0.352 0.278 0.434 | | 1:NonWh 1:Yes 44 0.500 0.356 0.644 | Likelihood ratio test of interaction for race * smk: LR Chi2(1) = 4.56 Prob > Chi2 = 0.0328

Example 1: Low birth weight and interaction between smoking and race (1=black, 0=white)

Example 2: Low birth weight and interaction between smoking and age (years) Logistic regression model: Add smk by age interaction Create interaction term and run logistic regression: . gen smkxage = smk * age . logistic low smk age smkxage

Example 2: Low birth weight and interaction between smoking and age (years) ------------------------------------------------- low | OR z P>|z| [95% CI] ---------+--------------------------------------- smk | 0.382 -0.90 0.367 .047 3.110 age | 0.920 -2.61 0.009 .865 0.980 smkxage | 1.076 1.97 0.049 1.001 1.157 Significant interaction: Relationship differs between smoking and low birth wt depending on mother’s age Question: How to interpret the interaction OR for a continuous interaction variable?

Example 2: Low birth weight and interaction between smoking and age (years) Convert OR’s to beta coefficients and solve for selected values of age: . logit ------------------------------------------------- low | Coef. z P>|z| [95% CI] --------+---------------------------------------- smk | -.963 -0.90 0.367 -3.058 1.131 age | -.083 -2.61 0.009 -0.145 -0.021 smkxage | .073 1.97 0.049 0.001 0.146 _cons| .805 Age=15: OR = e [β1 + β3(age)] = e [–0.963 + 0.073(15)] = 1.14 Age=35: OR = e [β1 + β3(age)] = e [–0.963 + 0.073(35)] = 4.93

Example 2: Low birth weight and interaction between smoking and age (years) Age=15: . lincom smk + 15*smkxage ----------------------------------------------- low | OR z P>|z| [95% CI] -----+----------------------------------------- (1) | 1.14 0.32 0.751 .503 2.59 Age=35: . lincom smk + 35*smkxage low | OR z P>|z| [95% CI] (1) | 4.93 2.59 0.010 1.47 16.5

Example 2: Low birth weight and interaction between smoking and age (years) Interpretation: Among 15 year olds, women who smoke have 1.1 times the odds of having a low birth wt baby Among 35 year olds, women who smoke have 4.9 times the odds of having a low birth wt baby

Example 2: Low birth weight and interaction between smoking and age (years) Misinterpretations: 15 year olds are not at risk for low birth wt babies It’s okay for 15 year olds to smoke Alternative: Solve the equation and graph the probabilities for different levels of smoke and age (“predxcon”) . predxcon low, xvar(age) from(15) to(35) inc(2) class(smk) graph

Example 2: Low birth weight and interaction between smoking and age (years) -> smk = 0 +---------------------------------+ | age pred_y lower upper | |---------------------------------| | 15 .392 .272 .527 | | 17 .353 .259 .461 | | 19 .317 .243 .400 | | (etc) ... ... ... | -> smk = 1 | 15 .424 .285 .577 | | 17 .419 .303 .546 | Likelihood ratio test for interaction of age * smk: LR Chi2(1) = 3.88 Prob > Chi2 = 0.05

Example 2: Low birth weight and interaction between smoking and age (years)

Example 3: Birth weight (grams) and interaction between smoking and race Linear regression model: Create interaction term and run linear regression: . gen smkxrace = smk * race . regress low smk race smkxrace Or: . predxcat bwt, xvar(race smk) graph bar

Example 3: Birth weight (grams) and interaction between smoking and race

Example 4: Birth weight (grams) and interaction between smoking and age Linear regression model: Create interaction term and run linear regression: . gen smkxage = smk * age . regress low smk age smkxage Or: . predxcon bwt, xvar(age) from(15) to(35) inc(2) class(smk) graph

Example 4: Birth weight (grams) and interaction between smoking and age

Example 5: Birth weight (grams) and interaction between smoking and age, age2, age3 Linear regression model: add quadratic & cubic terms Create interaction terms and run linear regression: . gen age2 = age^2 . gen age3 = age^3 . gen smkxage = smk * age . gen smkxage2 = smk * age2 . gen smkxage3 = smk * age3 . regress low smk age age2 age3 smkxage smkxage2 smkxage3 Or: . predxcon bwt, xvar(age) from(15) to(35) inc(2) class(smk) graph poly(3)

Example 5: Birth weight (grams) and interaction between smoking and age, age2, age3

Conclusions Interaction can be a difficult concept for people unfamiliar with the methodology Examining a graph of an interaction is an easier way to get an intuitive feel for the effect A useful technique for explaining interaction to students hearing it for the first time, before introducing mathematical models A simple way to present study results at meetings, even to a statistically savvy audience

Calculating and Graphing Predicted Values: (when “X” is categorical) . predxcat yvar, xvar(xvar1 xvar2) yvar – dependent variable continuous – defaults to linear regression binary (0,1) – defaults to logistic regression xvar(xvar) – nominal variable for categories of estimated means or proportions xvar(xvar1 xvar2) – categories of all combinations of xvar1 and xvar2; tests interaction adjust(cov_list) – adjusts for any covariates

Calculating and Graphing Predicted Values: (when “X” is categorical) graph – display graph (otherwise shows list of predicted values only) bar – bar graph (instead of symbols – default) model – for display purposes only; displays regression model Some other options: level(#) cluster(cluster_id) savepred(ds_name)

Calculating and Graphing Predicted Values: (when “X” is continuous) . predxcon yvar, xvar(xvar) from(#) to(#) inc(#) graph yvar – dependent variable continuous – defaults to linear regression binary (0,1) – defaults to logistic regression xvar(xvar) – continuous independent variable; probabilities calculated for each value of X from(#) – bottom value for xvar to(#) – top value for xvar inc(#) – increment desired between bottom and top values adjust(cov_list) – adjusts for any covariates

Calculating and Graphing Predicted Values: (when “X” is continuous) graph – display graph (otherwise shows list of predicted values only) class(class_var) – adds an xvar by class_var interaction term poly(2 or 3) – polynomial terms added: 2=squared 3=squared and cubic model – for display purposes only; displays regression model Some other options: level(#) cluster(cluster_id) nolist savepred(ds_name)