Title

mchangeplot -- Plots of marginal effects for models with
nominal or ordinal outcomes

General syntax

mchangeplot [ varlist ] [ , options ]

where varlist contains variables from the regression model for which
marginal effects were computed using mchange. If no variables
are named, all variables are graphed. Effects from models such as
mlogit, ologit, oprobit, and slogit can be plotted.
To plot odds ratios along with discrete changes for mlogit, see mlogitplot.

Overview

mchange computes marginal effects for regression models with
ordinal and nominal outcomes. In the graphs created by mchangeplot, variables are arranged vertically with
marginal effects plotted on the horizonal axis, with each outcome
represented by a marker. Statistical significance of effects can be
indicated and many options are available to customize the graph.

Table of contents

Amount of change
Symbols for outcome categories
Axes and plot region
Labels and notes
Tweaking defaults

Options

Amount of change

Marginal effects can be a marginal or instantaneous change or one of
several types of discrete changes. 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].

marg Marginal change [Marginal].

one Change of one unit [Unit change].

range Change over a 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)

Symbols for outcome categories

Eech outcome category is represented by a marker that can the
first letter of the outcome's value label or the numeric value
of the category.

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.

significance(level) Add * to indicate significance of two-tailed
test that effect is 0 at the given level. Level must be between .01 and .99}

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(#) choses the lightest shade and
is by default .25. Experiment with various numbers to create the shades you want.

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

Axis and graph region

These options control how the x-axes are displayed.
The x-axis contains the scale for the marginal effects.
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.

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

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().

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

Plot region and labeling

decimals(#)
Number of decimal digits on the x-axis scale for probabilities.

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 below.

Labels and notes

You can customize labels on the y-axis and add text to your graph
using standard graph options.

Variable labeling

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

Adding notes and titles

The title text can be a simple text string or use Stata's title_options.

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

titlebottom(text)
Replace the default label at the bottom 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.

amountlabelspaces(#)
The number of spaces at the end of the labels for amount labels at
the y-axis. Negative values can be used to move the labels closer to
the axis.

leftmargin(#)
When spaces are added to the label, the default left margin might be too
small to show all of the text. You can increase this margin with
the leftmargin(#) option. This adds a graphregion(margin(l+#))
option to the graph.

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

Examples

Example 1: Simple plot of all variables

. spex mlogit

. mchange

. mchangeplot

Example 2: Change value symbols

. spex mlogit

. mchange black income

. mchangeplot black income, symbols(SDem Dem Ind Rep SRep) msizefactor(0.75)

Example 3: Adjust axes labels

. spex mlogit

. mchange black income

. mchangeplot black income, min(-0.3) max(0.3) ntics(7)

Example 4: Changing aspect ratio and scaling

If you are plotting effects for a few variables, you are likely to prefer the look
of the graph if you changes the aspect ratio. When you do this, "white space"
(which might be colored depending on your scheme) appears at the top and bottom of
the graph. To trim this off, you need to change the ysize of the graph. This will affect
the size of markers and text, so you also need to adjust these. The following
example shows how to do this so that the "trimmed" graph looks like the graph
before trimming.

* determine default xsize and ysize

viewsource scheme-s2manual.scheme

* assign defaults to locals

local xdefault = 3.12

local ydefault = 2.392

* aspect ratio on ysize for your graph

local asp = .4

local ynew = 1.5

* compute ratio used to adjust scale

local ratio = `ydefault'/`ynew'

* make graph

mchangeplot age income, ///

aspect(`asp') xsize(`xdefault') ysize(`ynew') scale(*`ratio')