Title

mlogitplot -- Creates an odds ratios plot for mlogit

General syntax

mlogitplot [ varlist ] [ , options ]

where varlist contains variables from mlogit. If no variables
are named, all variables are graphed.

Overview

mlogitplot creates plots of the coefficients from a multinomial logit
model fit by mlogit. Each category is plotted with the distance
between categories corresponding to the magnitude of the coefficients for the
contrast between those categories.
If marginal effects were computed with mchange, the size of the
effect can be indicated by the area of the symbols used to
represent outcome categories.

Table of contents

Amount of change
Base category and outcome symbols
Axes and plot region
Lines among outcomes and vertical offsets
Labels and notes
Tweaking defaults

Options

Amount of change

The odds ratios can be computed for a unit change in the independent variable,
a standard deviation change, or a change over the range. For factor variables
specified with the i. syntax in the model, changes from 0 to 1 are plotted.
For non-factor variables (i.e., those not specified as i.varname), the amount of change can
be selected with the amount() option.

amount( var1-amount var2-amount ...)

amount Description

bin Binary change from 0 to 1 [0 to 1].

one Change of one unit [Unit change].

range Change over predictor's range [Range change].

sd Change of a standard deviation [SD change].

The default labels are shown in brackets above. You can specify the labels
to use for each type of change with these options. Using the string "_none_"
will remove the label.

binlabel(string)

marglabel(string)

onelabel(string)

rangelabel(string)

sdlabel(string)

Base categories and symbols for outcome categories

Each outcome is represented by a marker that can be the
first letter of the outcome variable's value labels, the numeric value
of the category (use option values), or symbols specified with symbol().
You can align categories for different base values from the mlogit
and let the size of the marker correspond to discrete change.

baseoutcome(#)
Odds ratios are shown relative to this category. See mlogit's
option baseoutcome() for details.

Appearance of the symbols

mchange
Symbols for categories are proportional to the size of the discrete
change coefficients for that variable. Negative changes will be underlined.
Option nosign suppresses the underlining.

values
Represent categories by their numeric value.
By default outcomes are indicated by the first letter of their
value label.

symbols(catsym1 catsym2 ...)
Each category is represented by the symbols specified. For example,
sym(A1 A2 A3 A4) would use A1, A2, etc. as the markers.

mcolors(colorstylelist)
Specify the colors of the markers. Different colors can be used
for each marker, such as mcol(red orange green blue). Colors use
Stata's colorstyle. The color option rainbow picks colors in
the order of the rainbow.

mshades
Using the single color selected by mcolor(), uses shades of that
color for each symbol. mshadesmin(#) chooses the lightest shade and
is by default .25. Experiment with various numbers to create the shades you want.

msizefactor(#)
Adjust the size of the markers by this factor.

Lines among outcomes and vertical offsets

In odds ratios plots it is useful to indicate whether the odds ratio for outcomes A
and B is significant. This is done by drawing lines connecting A and B if the
coefficient is not significant (i.e., the outcomes are "linked").
When connecting lines are added it is necessary to add a vertical offset to
the markers to avoid overlapping lines. The vertical offset has no substantive
meaning.

When to draw lines

linepvalues([# [#]...])
Lines connect outcomes if the odds ratios is not significant at this value.
If multiple values are used, lines are drawn to represent each level.
The appearance of the line is control with lcolor() and lwidth().
The default value is .10.

Appearance of lines

lcolor(colorstyelist)
Specify the colors of the connecting lines.
Different colors can be used if multiple line p-values are specified.
Colors use Stata's colorstyle.
The color option rainbow picks colors in the order of the rainbow.

lshades
Using the single color selected by lcolor(), uses shades of that
color for lines indicating different p-values.
lshadesmin(#) choses the lightest shade and
is by default .25. Experiment with various numbers to create the shades you want.

lwidth(linewidthlist)
Specify the line widths for the connecting lines.
Different widths can be used if multiple line p-values are specified.
Widths use Stata's linewidthstyle.

linegapfactor(number)
No lines are shown in a circular region around each outcome symbol.
You can change the size of this region with this option. Larger numbers
move the lines further away from the symbol.

Vertical offsets

packed
Do not use any vertical offset.

offsetlist(# # #...)
The vertical offset for each outcome for each variable are specified to
precisely locate each plot symbol. The scale of offsets is from -5 to 5.
The offsets are entered in the order: var1-outcome1 var1-outcome2 ...
var2-outcome1 var2-outcome2 ...

Axis and graph region

These options control how the x-axes are displayed. In an mlogitplot, the
bottom x-axis is in units of the beta coefficients while the
upper x-axis is in units of the odds ratio. No options are required
but the graph often benefits by setting the values of the tic marks
with min(), max(), gap() and ntics().
Setting the aspect ratio with aspectratio() is useful
depending on the number of variables in the
graph and the graph scheme being used.

x-axis, x-tics and x-lines

max(#)
Maximum value on the x-axis.

ormax(#)
Maximum value on the x-axis for the odds ratio.
Cannot be used with max(#) or gap(#).

min(#)
Minimum value on the x-axis.

ormin(#)
Minimum value on the x-axis for the odds ratio.
Cannot be used with min(#) or gap(#).

ntics(#)
Number of tic markers on x-axis; alternatively use gap().

gap(#)
Numerical gap between tic marks; alternatively use ntics().
For gap to work as expected, the gap needs to divide evenly into the
range; you might need to specify min() and max().

xline(numlist [, line-options])
Add vertical lines at specified values. Values and line-options
are passed to graph's xline() option.

leftmargin(#)
Adds space to the left margin where # is the percent of the graph
width to add. This command is equivalent to the graphregion(margin(l+#))
option from graph.
See region_options.
This option prevents truncation of value labels with factor variables.

graphregion(string)
Specify the graphregion() option from graph.

aspectratio(#)
Set the aspect ratio of the plot region. Ratio is height/width.

xsize(#)
Set size of x-axis in inches.

ysize(#)
Set size of y-axis in inches. Changing the ysize will remove "white space" that sometimes
appears at the top and bottom of the graph, especially with small aspect ratios. Changing
the ysize affects the size of the text which can be adjusted by scale()

scale(#)
Make text, markers, and line widths smaller or larger. See example in the help
file for mchangeplot.

decimals(#)
Number of decimal digits on the lower x-axis scale. That scale is in
units of the beta's.

ordecimals(#)
Number of decimal digits on the upper x-axis scale. That scale is in
units of odds ratios (i.e., exp(beta)).

Labels and notes

You can customize labels on the y-axis and add text to your graph
using standard graph options. The title text can be a simple text string or use Stata's title_options.

varlabels
Use a variable's label rather than its name on the left axis.

title(text)
Add a title at the top using graphs's title() option.

titlebottom(text)
Replace the default label for the logit coefficients at the bottom of the graph.

titletop(text)
Replace the default label for the odds ratios scale at the top of the graph.

subtitle(text)
Add a subtitle.

note(text)
Add a note.

caption(text)
Add a caption.

provenance(string)
Add a caption to show provenance information; this is a caption() with
convenient options automatically used.

Adjusting defaults controling the graph

The defaults that control the graph work in most cases.
Depending on the number of variables or categories along with the
graph scheme you are using you might want to adjust some of the
defaults that control how the graph appears.

offsetfactor(#)
Multiply the vertical offsets in an OR-plot by this factor. Values
greater than one increase the spread; less than one decrease the spread.

offsetsequence(# #...)
By default offsets are rotated among the values 1 2 0. You can use
other values to change the pattern of offsets.

amountlabelspaces(#)
The amount of change listed below a variable's name on the
y-axis. The amount of spacing between this label and the y-axis can be modified.
Negative values move the label closer to the axis; positive values move the label
further from the axis.

graphoptions(string)
Graphing options that are passed through to graph.

Examples

Example 1: mlogitplot with adjusted axes and value labels

. spex mlogit

. mlogitplot age female, symbols(D d I r R) min(-.1) max(.6) gap(.1) base(3)

Example 2: mlogitplot with added marginal effects

. spex mlogit

. mchange black income

. mlogitplot black income, mchange varlabel ///

title("OR plot with marginal effects") aspect(.3)

Example 3: Adjusting symbol offsets, changing significance of connecting lines

. spex mlogit

. mlogitplot age income, symbols(D d i r R) base(3) ///

ormin(.5) ormax(2) ntics(5) aspect(.3) ///

offsetlist(2 -2 0 2 -2 2 -2 0 2 -2) linepvalue(.05)