# VII. Ordinal & Multinomial

## Presentation on theme: "VII. Ordinal & Multinomial"— Presentation transcript:

VII. Ordinal & Multinomial
Logit Models

To what degree do the dietary & exercise habits of a sample of adults predict whether they are in the low, medium, or high-risk categories for cardiovascular disease? How well do the social traits of a sample of high school students predict whether their achievement test scores are low, medium-low, medium-high, or high?

To what extent do the institutional characteristics of a sample of political regimes predict whether their responsiveness to citizen demands is low, medium, or high? How helpful are the institutional characteristics of a sample of industrial firms in predicting whether the amount of pollution they emit is low, medium, or high?

These are examples of ordinal outcome variables.
The categories of an ordinal variable can be ranked, but the distances between the categories are not equal. Because the distances between the categories are not equal, analyzing ordinal outcome variables via OLS regression violates its assumptions & leads to erroneous conclusions. What statistical model avoids the assumption of equal intervals between ordinal categories?

Logit & probit versions of the ordinal regression model safely ignore the OLS assumption of equal intervals between a variable’s categories. But as Long & Freese (pages ) observe, “Simply because the values of a variable can be ordered does not imply that the variable should be analyzed as ordinal.” A categorical, multi-level variable could conceivably be ordered for one purpose but unordered for another.

As Long & Freese conclude, “Overall, when the proper ordering is ambiguous, the models for nominal outcomes [multinomial regression] …should be considered.” Multinomial models treat categories as nominal rather than ordinal: Which do you prefer—apple pie, hot fudge sundae, cheese cake, or cannoli? Which is your racial-ethnic identity: Black, White, Asian, Hispanic, or other?

Let’s use ordinal logistic regression to analyze respondent answers to this statement: “A working mother can establish just as warm & secure of a relationship with her child as a mother who does not work.” The responses are coded as: 1=strongly disagree (SD), 2=disagree (D), 3=agree (A), & 4=strongly agree (SA). These data are examined in Long/Freese, chapter 5. . use ordwarm2, clear

Let’s assume we’ve done the preparatory data analysis & transformations.
. ologit warm yr89 male white age ed prst, or nolog table

. ologit warm yr89 male white age ed prst, or nolog table
Ordered logit estimates Number of obs = 2293 LR chi2(6) = Prob > chi2 = Log likelihood = Pseudo R2 = warm | Odds Ratio Std. Err z P>|z| [95% Conf. Interval] yr89 | male | white | age | ed | prst |

What’s the interpretation?
Let’s see the coefficients as percentage change in odds: . listcoef, percent ologit (N=2293): Percentage Change in Odds Odds of: >m vs <=m warm b z P>z % %StdX SDofX yr male white age ed prst

Try fitting the model by means of ordinal probit:
. oprobit warm yr89 male white age ed prst, nolog table Of course we can’t obtain odds ratios via ordinal probit. Otherwise the only notable difference is that the logit coefficients are 1.7 times greater than the probit coefficients: the substantive conclusions are basically the same.

We could have used the robust &/or cluster options:
.ologit warm yr89 male white age ed prst, or robust nolog table .ologit warm yr89 male white age ed prst, or cluster(district) nolog table .oprobit warm yr89 male white age ed prst, robust nolog table .oprobit warm yr89 male white age ed prst, cluster(district) nolog table Recall that cluster invokes robust standard errors.

One possible problem with ologit or oprobit is perfect prediction: if the outcome variable does not vary within one of the categories of the explanatory variable, Stata will tell you. E.g.: . note: 40 observations completely determined. Standard errors questionable. We may receive the same message with binary outcome variables, but in that case Stata tells us which is the variable at fault & automatically drops the offending observations.

In the case of logistic regression (i. e
In the case of logistic regression (i.e. a binary outcome variable),we may decide it wise to drop the offending variable from the model & re-estimate the model. In ordinal categorical regression, we cross-tab the explanatory variables with the outcome variable to identify the culprit. Then we re-categorize or drop the offending variable or—if we deem it wise—drop only the observations at fault (see Long/Freese, page 145).

. ologit warm yr89 male white age ed prst, or nolog table . estimates store full . ologit warm yr89 male white age, nolog . lrtest full . likelihood-ratio test LR chi2(2) = (Assumption: . nested in full) Prob > chi2 =

We can also use the Wald-test to do the same thing (although, as mentioned previously, the likelihood ratio test is the preferred alternative): . test ed prst ( 1) ed = 0 ( 2) prst = 0 chi2( 2) = Prob > chi2 = The Wald-test & likelihood ratio test yield the same conclusion (as they usually do).

. linktest, nolog Next step: test the model specification:
Ordered logit estimates Number of obs = 2293 LR chi2(2) = Prob > chi2 = Log likelihood = Pseudo R = warm Coef. Std. Err z P>z [95% Conf. Interval] _hat _hatsq _cut (Ancillary parameters) _cut _cut No problems here.

An aspect of model specification testing for ologit & oprobit models concerns the proportional odds (or, parallel regression) assumption: similar to OLS, the assumption is that the slope coefficients are identical across levels of the outcome variable—each probability curve is assumed to differ only in being shifted to the left or right (see Long/Freese, pages ). There are two ways of testing this assumption: . omodel logit warm yrs89 male white age ed prst . ologit warm yrs89 male white age ed prst . brant

. omodel logit warm yrs89 male white age ed prst
Ordered logit estimates Number of obs = 2293 LR chi2(6) = Prob > chi2 = Log likelihood = Pseudo R = warm Coef. Std. Err. z P>z [95% Conf. Interval] yr male white age ed prst _cut (Ancillary parameters) _cut _cut Approximate likelihood-ratio test of proportionality of odds across response categories: chi2(12) = Prob > chi2 =

. brant Brant Test of Parallel Regression Assumption Variable chi2 p>chi2 df All yr male white age ed prst A significant test statistic provides evidence that the parallel regression assumption has been violated. Both tests say that the model violates the parallel odds (or regression) assumption.

What should we do in response to this model violation?
Most basically, recall the difference between statistical & practical significance. We need to explore changes to the explanatory variables or alternatives that safely ignore the parallel odds assumption: e.g., generalized ordered logit (gologit2, which is downloadable); or else multinomial logit (mlogit). Then compare the results across the kinds of models: Are there practically significant differences? If not, perhaps stick with the ologit model.

One more thing: Brant test is more likely to yield significant results as samples get larger.

. gologit2 warm yr89 male white age ed prst, auto
. findit gologit2 . view help gologit . gologit2 warm yr89 male white age ed prst, auto . linktest Conclusion: gologit2 works fine, but the relative ease & clarity of interpreting ologit vs. gologit2 must be considered. On gologit2 & its various options, see: gologit2 (generalized ordered ologit):

There are no diagnostics for gologit2 beyond linktest.
So let’s return to the ologit model to find out how its diagnostics work.

. ologit warm yr89 male white age ed prst, or nolog table
.predict pSD pD pA pSA if e(sample) .su pSD-pSA Variable Obs Mean Std. Dev. Min Max pSD pD pA pSA

.dotplot pSD-pSA

The rest of the diagnostics for ologit or oprobit are mere approximations of diagnostics for the overall model based on sequentially re-estimating the model in higher-versus-lower binary segments: in this example, category D(2) versus SD(1), category A(3) versus D(2), & category SD(4) versus A(3). This is extremely tedious & time consuming. Here, nonetheless, is how to do it.

We must first recode the outcome variable so that the base value=0.
We must use not ologit but rather logit regression. And using logit regression, we estimate an ordinal series of binary outcome variables: e.g., 0/1, 1/2, & 2/3.

. recode warm 1=0 2=1 3=2 4=3 . logit warm yr89 male white age ed prst if warm~=2 & warm~=3, nolog . predict p1 if e(sample) [note: p1=pD in original coding] . predict db, db . predict dd, dd . predict dx2, dx2 . predict n, n . su p1-n Then plot the graphs & proceed as discussed under logistic regression.

. drop db-n . logit warm yr89 male white age ed prst if warm~=0 & warm~=1, nolog . predict p2 if e(sample) . predict db, db . predict dd, dd . predict dx2, dx2 . predict n, n . su p2-n Again, plot the graphs & proceed as discussed under logistic regression.

. drop db-n . ologit warm yr89 male white age ed prst if warm~=1 & warm~=2, nolog . predict p3 if e(sample) . predict db, db . predict dd, dd . predict dx2, dx2 . predict n, n . su p3-n Continue plotting graphs & proceed as discussed under logistic regression.

At best, though, they represent approximations.
Such diagnostics can alert us to problems of model fit, outliers & influence. At best, though, they represent approximations. At this point we typically would explore predicted probabilities (postgr3, prchange, prtab, prvalue, & prgen-graphs). We’ll look only at postgr3, specifying a separate graph for outcomes 2, 3 & 4.

. xi3:ologit warm yr89 male white age ed prst, or nolog table
. postgr3 age, by(male) outcome(2) table Female: top line.

. postgr3 age, by(male) outcome(3) table
Female: top line.

. postgr3 age, by(male) outcome(4) table
Female: top line.

There are other ordered logit models, such as ordered continuation-ratio (ocratio), which predicts likelihoods of reaching higher versus lower categories that require passing through the lower categories to reach the higher ones. E.g., earning a Ph.D. versus an M.A. versus a B.A. versus a high school degree versus less than a high school degree.

But let’s turn our attention to the multinomial logit model.

An outcome is nominal when the categories are assumed to be unordered.
Marital status: divorced, never married, married, or widowed. Occupation: professional, white collar, blue collar, craft, or menial. Race-ethnicity, religion, political affiliation, and citizenship are among the other examples of nominal variables.

We use a multinomial logit model to compare nominal outcomes, or when the assumption of parallel regressions (i.e. parallel odds) is violated. Among the other versions is the conditional logit model (see Long/Freese, chapter 6), which uses the characteristics of the outcomes to predict which choice is made (e.g., your voting options are George Bush Sr., George Bush Jr., or Jeb Bush: which would you choose given the array of choices?)

Multinomial logit models include a lot of parameters, & interpreting the results can be overwhelming. Advice: keep the categories of the outcome variable to the fewest number possible. The STATA-based approaches developed by Long & Freese (chapter 6) are helpful in grappling with the complexities. Here’s an example: . u nomocc2, clear

We’ll pretend that we’ve done the background exploratory analysis & transformations.
The research question: how effective are the variables white, ed & exper in predicting whether a sample of respondents work in menial jobs, blue collar jobs, craft jobs, white collar jobs, or professional jobs? . mlogit occ white ed exper, rrr base(5) nolog

. mlogit occ white ed exper, rrr base(5) nolog
Multinomial logistic regression Number of obs = LR chi2(12) = Prob > chi2 = Log likelihood = Pseudo R =

------------------------------------------------------------------------------
occ | RRR Std. Err. z P>|z| [95% Conf. Interval] Menial | white | ed | exper | BlueCol | white | ed | exper |

Craft | white | ed | exper | WhiteCol | white | ed | exper | (Outcome occ==Prof is the comparison group) rrr (relative risk ratio): mlogit’s relative risk ratio coefficients are an approximation of the real thing; see Statalist on this. The default is to display logit coefficients; ‘outreg,’ ‘estimates,’ & other table commands can display odds ratios.

. listcoef, factor help Or: . listcoef, percent help
If you feel more comfortable using odds ratios or percentage change in odds: . quietly mlogit occ white ed exper, base(5) . listcoef, factor help Or: . qui mlogit occ white ed exper, base(5) . listcoef, percent help

We can change the comparison group via base( ), or not specify base( ) & let Stata choose the comparison group.

We can display the results in terms of odds ratios or percentage change in odds either for all the explanatory variables together or for them individually: . listcoef, factor help . listcoef white, factor help . listcoef, percent help . listcoef white, percent help And to simplify the output, we can display only those explanatory variables that attain a specified level of statistical significance: . listcoef white, pvalue(.10)

Recall that cluster invokes robust standard errors.
And we could have specified the robust &/or cluster options in the multinomial equation. Recall that cluster invokes robust standard errors.

The problem of perfect prediction: mlogit does not give us a warning message, but rather lists the culprit variables as z=0 (and p>|z|=1). What to do: re-estimate the model, excluding the problem variable & deleting the observations that imply perfect prediction. Identify the problem observations by doing a cross-tab of the problem variable with the outcome variable.

Model specification & related tests: linktest is not an option for mlogit, but Long & Freese have developed mlogtest to greatly facilitate the battery of tests for a multinomial logit model. . mlogtest, lr wald lrcom sm set These & other options can be specified either individually or collectively.

**** Likelihood-ratio tests for independent variables
Ho: All coefficients associated with given variable(s) are 0. occ chi2 df P>chi2 white ed exper **** Wald tests for independent variables occ chi2 df P>chi2 white ed exper

**** Small-Hsiao tests of IIA assumption
Ho: Odds(Outcome-J vs Outcome-K) are independent of other alternatives. Omitted lnL(full) lnL(omit) chi df P>chi2 evidence Menial against Ho BlueCol against Ho Craft against Ho WhiteCol against Ho

**** LR tests for combining outcome categories
Ho: All coefficients except intercepts associated with given pair of outcomes are 0 (i.e., categories can be collapsed). Categories tested chi df P>chi2 Menial- BlueCol Menial- Craft Menial-WhiteCol Menial- Prof BlueCol- Craft BlueCol-WhiteCol BlueCol- Prof Craft-WhiteCol Craft- Prof WhiteCol- Prof

How to test for the joint significance of, say, ‘ethnicity’ (with ‘white’ as the base category)?
We can do so using either a likelihood ratio test (which is preferred) or a Wald test: . mlogtest, lr set(black hispanic asian) . mlogtest, wald set(black hispanic asian) These tests of joint significance can be specified together with the other mlogtest options.

Other Fit & Influence Diagnostics
. mlogit occ white ed exper, base(5) nolog . predict prM prB prC prW prP if e(sample) . su prM-prP Note: M, B, C, W & P are labels attached to the coded responses 1, 2, 3, 4 & 5.

As for the influence-diagnostic graphs, which are mere approximations as diagnostic tools:
Re-code the outcome variable so that the reference group=0. Use not mlogit but rather logit to estimate the model for each binary outcome Estimate the logit model for (at least) each outcome-level versus the base-level (e.g., menial vs. professional, craft versus professional, white collar vs. professional).

How to explore predicted probabilities
How to explore predicted probabilities? Returing to the original coding of ‘occ’: . mlogit occ white ed exper, base(5) nolog Then use postgr3, prchange, prtab, prvalue & prgen to predict & graph probabilities. We could also use prchange & mlogview to graph the predictions in another format.

. xi3: mlogit occ white ed exper, base(5) nolog
. postgr3 ed, by(white) outcome(1) table Nonwhite: top line.

. postgr3 ed, by(white) outcome(2) table
Nonwhite: top line.

. postgr3 ed, by(white) outcome(3)
Nonwhite: bottom line.

. postgr3 ed, by(white) outcome(4) table
Nonwhite: bottom line.

See their particular commands for mlogit.
Predicted probabilities: Long & Freese’s suite of commands (e.g., prvalue, x(…) delta save; prvalue, x(…) delta diff) is relevant. See their particular commands for mlogit. Remember to see Long & Freese’s final chapter to learn how to predict probabilities based on curvilinear explanatory variables.

Finally, consider regression models for another, common form of categorical outcome variable: counts (see Long/Freese, chapter 7). E.g., the number of homicides, suicides, hospitalizations, accidents, alcoholic drinks consumed, academic publications, or wars. OLS regression is commonly but inappropriately applied to such problems. Instead use count models such as poisson & negative binomial regression. That’s all!