Download presentation
Presentation is loading. Please wait.
Published byGerald Burns Modified over 9 years ago
1
Multinomial Logit Sociology 229: Advanced Regression
Copyright © 2010 by Evan Schofer Do not copy or distribute without permission
2
Announcements Short assignment 1 handed out today
Due at start of class next week
3
Agenda Minor follow-up to last class: Models for “polytomous” outcomes
Marginal change in logistic regression Models for “polytomous” outcomes Ordered logistic regression Multinomial logistic regression Conditional logit: models for alternative-specific data
4
Marginal Change in Logit
Issue: How to best capture effect size in non-linear models? % Change in odds ratios for 1-unit change in X Change in actual probability for 1-unit change in X Either for hypothetical cases or an actual case Another option: marginal change The actual slope of the curve at a specific point Again, can be computed for real or hypothetical cases Use “adjust” (stata 9/10) or “margins” (stata 11) Recall from calculus: derivatives are slopes... So, a marginal change is just a derivative.
5
Marginal vs Discrete Change in Logit
Long and Freese 2006:169
6
Ordered Logit: Motivation
Issue: Many categorical dependent variables are ordered Ex: strongly disagree, disagree, agree, strongly agree Ex: social class Linear regression is often used for ordered categorical outcomes Ex: Strongly disagree=0, disagree=1, agree=2, etc. This makes arbitrary – usually unjustifiable – assumptions about the distance between categories Why not: Strongly disagree=0, disagree=3, agree=3.5? If numerical values assigned to categories do not accurately reflect the true distance, linear regression may not be appropriate
7
Ordered Logit: Motivation
Strategies to deal with ordered categorical variables 1. Use OLS regression anyway Commonly done; but can give incorrect results Possibly check robustness by varying coding of interval between outcomes 2. Collapse variables to dichotomy, use a binary model such as logit or probit Combine “strongly disagree” & “disagree”, “strongly agree” & “agree” Model “disagree” vs. “agree” Works fine, but “throws away” useful information.
8
Ordered Logit: Motivation
Strategies to deal with ordered categorical variables (cont’d): 3. If you aren’t confident about ordering, use multinomial logistic regression (discussed later) 4. Ordered logit / ordinal probit 5. Stereotype logit Not discussed.
9
Ordered Logit Ordered logit is often conceptualized as a latent variable model Observed responses result from individuals falling within ranges on an underlying continuous measure Example: There is some underlying variable “agreement”… If you fall below a certain (unobserved) threshold, you’ll respond “strongly disagree” Whereas logit looks at P(Y=1), ologit looks at probability of falling in particular ranges…
10
Ordered Logit Example: Environment Spending
Government spending on the environment GSS question: Are we spending too little money, about the right amount, too much? GSS variable “NATENVIR” from years 2000, 02, 04, 06 Recoded: 1 = too little, 2 = about right, 3 = too much
11
Ordered logit Example Government spending on environment
. ologit envspend educ incomea female age dblack class city suburb attendchurch Ordered logistic regression Number of obs = LR chi2(9) = Prob > chi2 = Log likelihood = Pseudo R = envspend | Coef. Std. Err z P>|z| [95% Conf. Interval] educ | income | female | age | dblack | class | city | suburb | attendchurch | /cut1 | /cut2 | Instead of a constant, ologit indicates “cutpoints”, which can be used to compute probabilities of falling into a particular value of Y
12
Ordered logit Example Ologit results can be shown as odds ratios
. ologit envspend educ incomea female age dblack class city suburb attendchur, or Ordered logistic regression Number of obs = LR chi2(9) = Prob > chi2 = Log likelihood = Pseudo R = envspend | Odds Ratio Std. Err z P>|z| [95% Conf. Interval] educ | incomea | female | age | dblack | class | city | suburb | attend | /cut1 | /cut2 | Women have 1.32 times the odds of falling in a higher category than men… a difference of (1-1.31)*100 = 32%.
13
Proportional Odds Assumption
The fact that you can calculate odds ratios highlights a key assumption of ordered logit: “Proportional odds assumption” Also known as the “parallel regression assumption” Which also applies to ordered probit Model assumes that variable effects on the odds of lower vs. higher outcomes are consistent Effect on odds of “too little” vs “about right” is same for “about right” vs “too much” Controlling for all other vars in the model If this assumption doesn’t seem reasonable, consider stereotype logit or multinomial logit.
14
Ologit Interpretation
Like logit, interpretation is difficult because effect of Xs on Y is nonlinear Effects vary with values of all X variables Interpretation strategies are similar to logit: You can produce predicted probabilities For each category of Y: Y= 1, Y=2, Y=3 For real or hypothetical cases You can look at effect of change in X on predicted probabilities of Y Given particular values of X variables You can present marginal effects.
15
Ordered logit vs. OLS Government spending on environment
. reg envspend educ incomea female age dblack class city suburb attendchur Source | SS df MS Number of obs = F( 9, 5159) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = envspend | Coef. Std. Err t P>|t| [95% Conf. Interval] educ | income | female | age | dblack | class | city | suburb | attendchur | _cons | In this case, OLS produced similar results to ordered logit. But, that doesn’t always happen… and you won’t know if you don’t check.
16
Multinomial Logistic Regression
What if you want have a dependent variable has several non-ordinal outcomes? Ex: Mullen, Goyette, Soares (2003): What kind of grad school? None vs. MA vs MBA vs Prof’l School vs PhD. Ex: McVeigh & Smith (1999). Political action Action can take different forms: institutionalized action (e.g., voting) or protest Inactive vs. conventional pol action vs. protest Other examples?
17
Multinomial Logistic Regression
Multinomial Logit strategy: Contrast outcomes with a common “reference point” Similar to conducting a series of 2-outcome logit models comparing pairs of categories The “reference category” is like the reference group when using dummy variables in regression It serves as the contrast point for all analyses Example: Mullen et al. 2003: Analysis of 5 categories yields 4 tables of results: No grad school vs. MA No grad school vs. MBA No grad school vs. Prof’l school No grad school vs. PhD.
18
Multinomial Logistic Regression
Imagine a dependent variable with M categories Ex: 2000 Presidential Election: j = 3; Voting for Bush, Gore, or Nader Probability of person “i” choosing category “j” must add to 1.0:
19
Multinomial Logistic Regression
Option #1: Conduct binomial logit models for all possible combinations of outcomes Probability of Gore vs. Bush Probability of Nader vs. Bush Probability of Gore vs. Nader Note: This will produce results fairly similar to a multinomial output… But: Sample varies across models Also, multinomial imposes additional constraints So, results will differ somewhat from multinomial logistic regression.
20
Multinomial Logistic Regression
We can model probability of each outcome as: i = cases, j categories, k = independent variables Solved by adding constraint Coefficients sum to zero
21
Multinomial Logistic Regression
Option #2: Multinomial logistic regression Choose one category as “reference”… Probability of Gore vs. Bush Probability of Nader vs. Bush Probability of Gore vs. Nader Let’s make Bush the reference category Output will include two tables: Factors affecting probability of voting for Gore vs. Bush Factors affecting probability of Nader vs. Bush.
22
Multinomial Logistic Regression
Choice of “reference” category drives interpretation of multinomial logit results Similar to when you use dummy variables… Example: Variables affecting vote for Gore would change if reference was Bush or Nader! What would matter in each case? 1. Choose the contrast(s) that makes most sense Try out different possible contrasts 2. Be aware of the reference category when interpreting results Otherwise, you can make BIG mistakes Effects are always in reference to the contrast category.
23
MLogit Example: Family Vacation
Mode of Travel. Reference category = Train Large families less likely to take bus (vs. train) . mlogit mode income familysize Multinomial logistic regression Number of obs = LR chi2(4) = Prob > chi2 = Log likelihood = Pseudo R = mode | Coef. Std. Err z P>|z| [95% Conf. Interval] Bus | income | family size | _cons | Car | income | family size | _cons | (mode==Train is the base outcome) Note: It is hard to directly compare Car vs. Bus in this table
24
MLogit Example: Car vs. Bus vs. Train
Mode of Travel. Reference category = Car . mlogit mode income familysize, base(3) Multinomial logistic regression Number of obs = LR chi2(4) = Prob > chi2 = Log likelihood = Pseudo R = mode | Coef. Std. Err z P>|z| [95% Conf. Interval] Train | income | family size | _cons | Bus | income | family size | _cons | (mode==Car is the base outcome) Here, the pattern is clearer: Wealthy & large families use cars
25
Stata Notes: mlogit Dependent variable: any categorical variable
Don’t need to be positive or sequential Ex: Bus = 1, Train = 2, Car = 3 Or: Bus = 0, Train = 10, Car = 35 Base category can be set with option: mlogit mode income familysize, baseoutcome(3) Exponentiated coefficients called “relative risk ratios”, rather than odds ratios mlogit mode income familysize, rrr
26
MLogit Example: Car vs. Bus vs. Train
Exponentiated coefficients: relative risk ratios Multinomial logistic regression Number of obs = LR chi2(4) = Prob > chi2 = Log likelihood = Pseudo R = mode | RRR Std. Err z P>|z| [95% Conf. Interval] Train | income | familysize | Bus | income | familysize | (mode==Car is the base outcome) exp(-.057)=.94. Interpretation is just like odds ratios… BUT comparison is with reference category.
27
Predicted Probabilities
You can predict probabilities for each case Each outcome has its own probability (they add up to 1) . predict predtrain predbus predcar if e(sample), pr . list predtrain predbus predcar | predtrain predbus predcar | | | 1. | | 2. | | 3. | | 4. | | 5. | | 6. | | 7. | | 8. | | 9. | | 10. | | This case has a high predicted probability of traveling by car This probabilities are pretty similar here…
28
Classification of Cases
Stata doesn’t have a fancy command to compute classification tables for mlogit But, you can do it manually Assign cases based on highest probability You can make table of all classifications, or just if they were classified correctly First, I calculated the “predicted mode” and a dummy indicating whether prediction was correct . gen predcorrect = 0 . replace predcorrect = 1 if pmode == mode (85 real changes made) . tab predcorrect predcorrect | Freq. Percent Cum. 0 | 1 | Total | 56% of cases were classified correctly
29
Predicted Probability Across X Vars
Like logit, you can show how probabilies change across independent variables However, “adjust” command doesn’t work with mlogit So, manually compute mean of predicted probabilities Note: Other variables will be left “as is” unless you set them manually before you use “predict” . mean predcar, over(familysize) Over | Mean predcar | 1 | 2 | 3 | 4 | 5 | 6 | Probability of using car increases with family size Note: Values bounce around because other vars are not set to common value. Note 2: Again, scatter plots aid in summarizing such results
30
Stata Notes: mlogit Like logit, you can’t include variables that perfectly predict the outcome Note: Stata “logit” command gives a warning of this mlogit command doesn’t give a warning, but coefficient will have z-value of zero, p-value =1 Remove problematic variables if this occurs!
31
Hypothesis Tests Individual coefficients can be tested as usual
Wald test/z-values provided for each variable However, adding a new variable to model actually yields more than one coefficient If you have 4 categories, you’ll get 3 coefficients LR tests are especially useful because you can test for improved fit across the whole model
32
LR Tests in Multinomial Logit
Example: Does “familysize” improve model? Recall: It wasn’t always significant… maybe not! Run full model, save results mlogit mode income familysize estimates store fullmodel Run restricted model, save results mlogit mode income estimates store smallmodel Compare: lrtest fullmodel smallmodel Yes, model fit is significantly improved Likelihood-ratio test LR chi2(2) = (Assumption: smallmodel nested in fullmodel) Prob > chi2 =
33
Multinomial Logit Assumptions: IIA
Multinomial logit is designed for outcomes that are not complexly interrelated Critical assumption: Independence of Irrelevant Alternatives (IIA) Odds of one outcome versus another should be independent of other alternatives Problems often come up when dealing with individual choices… Multinomial logit is not appropriate if the assumption is violated.
34
Multinomial Logit Assumptions: IIA
IIA Assumption Example: Odds of voting for Gore vs. Bush should not change if Nader is added or removed from ballot If Nader is removed, those voters should choose Bush & Gore in similar pattern to rest of sample Is IIA assumption likely met in election model? NO! If Nader were removed, those voters would likely vote for Gore Removal of Nader would change odds ratio for Bush/Gore.
35
Multinomial Logit Assumptions: IIA
IIA Example 2: Consumer Preferences Options: coffee, Gatorade, Coke Might meet IIA assumption Options: coffee, Gatorade, Coke, Pepsi Won’t meet IIA assumption. Coke & Pepsi are very similar – substitutable. Removal of Pepsi will drastically change odds ratios for coke vs. others.
36
Multinomial Logit Assumptions: IIA
Issue: Choose categories carefully when doing multinomial logit! Long and Freese (2006), quoting Mcfadden: “Multinomial and conditional logit models should only be used in cases where the alternatives “can plausibly be assumed to be distinct and weighed independently in the eyes of the decisionmaker.” Categories should be “distinct alternatives”, not substitutes Note: There are some formal tests for violation of IIA. But they don’t work well. Not recommended. See Long and Freese (2006) p. 243
37
Multinomial Logit Assumptions: IIA
Ways to cope with violations of IIA 1. Combine “similar” options to avoid substitutes Example: coffee, Gatorade, Coke, Pepsi Combine into; Coffee, Gatorate, Carbonated drinks 2. Or, model outcomes as a set of choices First, whether to have a carbonated drink… And, then conduct a subsequent analysis for the choice of Coke vs. Pepsi Nested logit 3. Use a model that doesn’t require IIA assumption Ex: Multinomial probit – which doesn’t make this assumption but is computationally intensive.
38
Multinomial Assumptions/Problems
Aside from IIA, assumptions & problems of multinomial logit are similar to standard logit Sample size You often want to estimate MANY coefficients, so watch out for small N Outliers Multicollinearity Model specification / omitted variable bias Etc.
39
Real World Multinomial Example
Gerber (2000): Russian political views Prefer state control or Market reforms vs. uncertain Older Russians more likely to support state control of economy (vs. being uncertain) Younger Russians prefer market reform (vs. uncertain)
40
Multinomial Example 2 McVeigh, Rory and Christian Smith “Who Protests in America: An Analysis of Three Political Alternatives – Inaction, Institutionalized Politics, or Protest.” Sociological Forum, 14, 4:
41
Alternative Specific Data
Most variables of interest pertain to “cases” Example: Travel to work by car, bus, or train? Individual cases vary in income… which affects choices BUT, the various “alternatives” have differences Ex: The cost of travel differs for car vs bus vs train Ex: Cost can vary for individuals and each alternative Train might be cheap for people in some cities, not others Ex: The time of the trip also varies Sometimes we wish to model the impact of these “alternative-specific” differences on choice Either alone, or in conjunction with case-specific variables.
42
Alternative Specific Data
Issue: Alternative specific data requires a different kind of dataset Case-specific multinomial data simply requires a dependent variable indicating the option chosen 1 line of data per case Dependent variable coded 1=bus, 2=car, 3=train Alternative specific data requires multiple lines of data for each case One line of data for each possible outcome With information on variables like cost, travel time, etc. Plus a dummy variable indicating which of the outcomes was actually chosen.
43
Case vs Alternative Specific Data
Example from Long and Freese 2006:294 Data from Greene & Hensher 1997 Case-specific data on travel modes: . list id mode income famsize | id mode income famsize | | | 1. | Car | 2. | Car | 3. | Car | 4. | Car | 5. | Car | 6. | Train | 7. | Car | 8. | Car | 9. | Car | 10. | Car | 11. | Car | 12. | Car | 13. | Car | 14. | Car | 15. | Train | Each line of data represents a case The dependent variable is coded in a single variable: Mode: Train = 1, Bus = 2, Car = 3
44
Case vs Alternative Specific Data
Alternative-specific data on travel modes: . list id mode choice train bus car time cost income famsize, nolab sepby(id) | id mode choice train bus car time cost income famsize | | | 1. | | 2. | | 3. | | 4. | | 5. | | 6. | | 7. | | 8. | | 9. | | Now there are 3 lines of data for each case… one for each possible choice Another dummy (“choice”) indicates the one actually chosen Alternative specific variables (e.g., travel cost) varies for car, bus, train
45
Analyzing alternative-specific data
Conditional logit models can be used for models with alternative-specific data Stata: clogit But: case-specific variables must be manually entered as interactions between X and each choice… Note: conditional logit with case & alternative specific data is called a “McFadden’s Choice Model” Stata now has simple options for these models You don’t have to create interaction variables asclogit – alternative specific conditional logit McFadden’s choice model Also: asmprobit – alternative specific multinomial probit
46
Example: McFaddens Choice Model
Mode of Travel. Reference category = car . asclogit choice time cost, casevars(income famsize) case(id) alternatives(mode) Alternative-specific conditional logit Number of obs = Case variable: id Number of cases = Wald chi2(6) = Log likelihood = Prob > chi2 = choice | Coef. Std. Err z P>|z| [95% Conf. Interval] mode | time | cost | Train | income | famsize | _cons | Bus | income | famsize | _cons | Car | (base alternative) Alternative-specific variables have intuitive effects… All things being equal, people avoid choices that are slow or costly
47
McFaddens Choice Model
Stata syntax: asclogit Ex: asclogit choice time cost, casevars(income famsize) case(id) alternatives(mode) Alternative specific variables are in main variable list Case-specific variables included in “casevars” option NOTE: A case ID variable must be specified “alternative” option identifies the alternatives Car vs train vs bus.
48
McFaddens Choice Model
Uses of alternative specific data 1. Political choice… depends on characteristics of the person AND the candidate Case-specific variables: education, income Alternative-specific: Candidate’s characteristics OR Agreement/similarity between person & candidate Ex: dummies indicating similar views on abortion 2. Type of college you attend None vs community vs 4-year public vs 4-year private Case-specific: GPA, family income Alternative-specific: cost, selectivity of admissions Other examples?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.