SS16.5

advertisement
Calculating interaction patterns
from logit coefficients:
Interaction between two categorical
independent variables
Jane E. Miller, PhD
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Overview
• Logic for calculating overall interaction
patterns from coefficients
• Review: Metric of logit coefficients
• Two approaches to calculating odds ratio for
an interaction
• Before watching this podcast, watch the
podcast on calculating categorical by
categorical interaction from OLS coefficients
for diagrams and detailed explanation.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Model specification with
interactions: race and education
• Logit(LBW) = f (race, education, race_education)
– LBW = low birth weight: <2,500 grams
– The log-odds of low birth weight are specified as a function of
race, education, and the race-by-education interaction.
• To specify the model, need ALL of the main effects and
interaction term variables related to race and mother’s
education
• Logit(LBW) = f (NHB, <HS, =HS, NHB_<HS, NHB_=HS)
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Interaction patterns from logit βs
• The logic for calculating overall interaction
patterns based on logit coefficients is the
same as for OLS:
– For cases in the reference category for one but not
both of the IVs involved in the interaction:
• One β (the coefficient on a main effect term)
– For cases NOT in the reference category for either
variable:
• Three β s (those on two main effects terms and the
interaction term)
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Example calculation for an
interaction from a logit model
• Suppose we have the following estimated
coefficients from a logit model of low birth
weight:
βNHB = 0.68;
β<HS = 0.60;
β<HS_NHB = –0.45
• Recall that coefficients from logit models are in
the metric of ln(relative odds)
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Calculating the net effect of the
interaction from logit coefficients
• From the βs, we can calculate the odds ratio for a given
group compared to the reference category either by
1. Summing the coefficients on the pertinent main effects and
interaction terms, which are in the metric of log-relative odds.
• Then exponentiating that sum to calculate the odds ratio.
or
2. Exponentiating each of the main effects and interaction term
coefficients separately.
• Then calculating the product of the resulting odds ratios.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Exponentiating the sum of the logit βs
on main effects and interaction
• General equation for the odds ratio involving
main effects and interaction terms:
e(βNHB + β<HS + β[<HS_NHB])
• Substituting the estimated βs from the logit
model and solving:
= e(0.68 + 0.60 + [–0.45]) = e(–0.84) = 2.29
• Thus, non-Hispanic black infants born to mothers with
<HS have 2.29 times the odds of LBW as those born to
non-Hispanic white women with >HS (the reference
category).
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Calculating the product of the odds ratios
on main effects and interaction terms
• General equation for the odds ratio involving
main effects and interaction terms:
eβNHB × e β<HS × e β[<HS_NHB]
• Substituting the βs from the logit model and
solving:
e0.68 × e0.60 × e(–0.45) = 1.98  1.81  0.64 = 2.29
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Both approaches yield same solution
• Note that the solution is the same regardless
of which approach we use to calculate the OR
based on the combination of pertinent main
effects and interaction coefficients.
– Exponentiating the sum of the main effect and
interaction βs:
e(0.68 + 0.60 + [–0.45]) = e(–0.84) = 2.29
– Multiplying the odds ratios for the main effects
and interaction terms:
e0.68 × e0.60 × e(–0.45) = 1.98  1.81  0.64 = 2.29
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Use a spreadsheet
to calculate the interaction pattern
• Spreadsheets can
– Store
• The estimated logit coefficients
• The input values of the independent variables
• The correct generalized formula to calculate odds ratios of
the outcome for combinations of the IVs involved in the
interaction
– Graph the overall pattern
• See spreadsheet template and voice-over
explanation
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Summary
• The logic for calculating overall interaction
patterns based on logit coefficients is the
same as for OLS in terms of number and type
of terms involved in the specification.
• Odds ratios can be computed from the logit
coefficients either by
– Exponentiating the sum of pertinent βs,
– Or calculating the product of the pertinent odds
ratios for each of the three terms.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Suggested resources
• Chapters 9 and 16 of Miller, J.E. 2013. The
Chicago Guide to Writing about Multivariate
Analysis, 2nd Edition.
• Podcasts on
– Interpreting multivariate coefficients
– Calculating interaction patterns from OLS
coefficients for 2 categorical independent
variables
• Spreadsheet for calculating the pattern for a
categorical by categorical interaction.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Suggested practice exercises
• Study guide to The Chicago Guide to Writing
about Multivariate Analysis, 2nd Edition.
– Problem set for Chapter 16
– Suggested course extensions for Chapter 16
• “Reviewing” exercises.
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Contact information
Jane E. Miller, PhD
jmiller@ifh.rutgers.edu
Online materials available at
http://press.uchicago.edu/books/miller/multivariate/index.html
The Chicago Guide to Writing about Multivariate Analysis, 2 nd edition.
Download