help asclogit postestimation dialogs: predict estat
also see: asclogit
-------------------------------------------------------------------------------
Title
[R] asclogit postestimation -- Postestimation tools for asclogit
Description
The following postestimation commands are of special interest after
asclogit:
command description
-------------------------------------------------------------------------
estat alternatives alternative summary statistics
estat mfx marginal effects
-------------------------------------------------------------------------
The following standard postestimation commands are also available:
command description
-------------------------------------------------------------------------
estat AIC, BIC, VCE, and estimation sample summary
estimates cataloging estimation results
hausman Hausman's specification test
lincom point estimates, standard errors, testing, and inference for
linear combinations of coefficients
lrtest likelihood-ratio test
nlcom point estimates, standard errors, testing, and inference for
nonlinear combinations of coefficients
predict predicted probabilities, estimated linear predictor and its
standard error
predictnl point estimates, standard errors, testing, and inference for
generalized predictions
test Wald tests of simple and composite linear hypotheses
testnl Wald tests of nonlinear hypotheses
-------------------------------------------------------------------------
Special-interest postestimation commands
estat alternatives displays summary statistics about the alternatives in
the estimation sample.
estat mfx computes probability marginal effects.
Syntax for predict
predict [type] newvar [if] [in] [, statistic options]
predict [type] {stub*|newvarlist} [if] [in] , scores
statistic description
-------------------------------------------------------------------------
Main
pr probability that each alternative is chosen; the default
xb linear prediction
stdp standard error of the linear prediction
-------------------------------------------------------------------------
options description
-------------------------------------------------------------------------
Main
* k(condspec) condition on condspec alternatives chosen by each case
when computing probabilities
altwise use alternative-wise deletion instead of casewise
deletion when computing probabilities
nooffset ignore the offset() variable specified in asclogit
-------------------------------------------------------------------------
*k(condspec) may be used only with pr.
These statistics are available both in and out of sample; type predict
... if e(sample) ... if wanted only for the estimation sample.
Menu
Statistics > Postestimation > Predictions, residuals, etc.
Options for predict
+------+
----+ Main +-------------------------------------------------------------
pr computes the probability of choosing each alternative conditioned on
each case choosing k(condspec) alternatives. This is the default
statistic with default k(1); one alternative per case is chosen.
xb computes the linear prediction.
stdp computes the standard error of the linear prediction.
k(#|observed) conditions the probability on choosing # alternatives per
case, or use k(observed) to condition on the observed number of
alternatives chosen. The default is k(1). This option may be used
only with the pr option.
altwise specifies that alternative-wise deletion be used when marking out
observations due to missing values in your variables. The default is
to use casewise deletion. The xb and stdp options always use
alternative-wise deletion.
nooffset is relevant only if you specified offset(varname) for asclogit.
It modifies the calculations made by predict so that they ignore the
offset variable; the linear prediction is treated as xb rather than
as xb + offset.
scores calculates the scores for each coefficient in e(b). This option
requires a new variable list of length equal to the number of columns
in e(b). Otherwise, use the stub* option to have predict generate
enumerated variables with prefix stub.
Syntax for estat alternatives
estat alternatives
Menu
Statistics > Postestimation > Reports and statistics
Syntax for estat mfx
estat mfx [if] [in] [, options]
options description
-------------------------------------------------------------------------
Main
varlist(varlist) display marginal effects for varlist
at(mean [atlist]|median [atlist]) calculate marginal effects at these
values
k(#) condition on the number of
alternatives chosen to be #
Options
level(#) set confidence interval level;
default is level(95)
nodiscrete treat indicator variables as
continuous
noesample do not restrict calculation of means
and medians to the estimation
sample
nowght ignore weights when calculating
means and medians
-------------------------------------------------------------------------
Menu
Statistics > Postestimation > Reports and statistics
Options for estat mfx
+------+
----+ Main +-------------------------------------------------------------
varlist(varlist) specifies the variables for which to display marginal
effects. The default is all variables.
at(mean [atlist]|median [atlist]) specifies the values at which the
marginal effects are to be calculated. atlist is
[[alternative:variable = #] [variable = #] [alternative:offset =
#] [...]]
The default is to calculate the marginal effects at the means of the
independent variables by using the estimation sample, at(mean). If
offset() is used during estimation, the means of the offsets (by
alternative) are computed by default.
After specifying the summary statistic, you can specify a series of
specific values for variables. You can specify values for
alternative-specific variables by alternative, or you can specify one
value for all alternatives. You can specify only one value for
case-specific variables. You specify values for the offset()
variable (if present) the same way as for alternative-specific
variables. For example, in the choice dataset (car choice), income
is a case-specific variable, whereas dealer is an
alternative-specific variable. The following would be a legal syntax
for estat mfx:
. estat mfx, at(mean American:dealer=18 income=40)
When nodiscrete is not specified, at(mean [atlist]) or at(median
[atlist]) has no effect on computing marginal effects for indicator
variables, which are calculated as the discrete change in the
simulated probability as the indicator variable changes from 0 to 1.
The mean and median computations respect any if or in qualifiers, so
you can restrict the data over which the statistic is computed. You
can even restrict the values to a specific case; e.g.,
. estat mfx if case==21
k(#) computes the probabilities conditioned on # alternatives chosen.
The default is one alternative chosen.
+---------+
----+ Options +----------------------------------------------------------
level(#) sets the confidence level; default is level(95).
nodiscrete specifies that indicator variables be treated as continuous
variables. An indicator variable is one that takes on the value 0 or
1 in the estimation sample. By default, the discrete change in the
simulated probability is computed as the indicator variable changes
from 0 to 1.
noesample specifies that the whole dataset be considered instead of only
those marked in the e(sample) defined by the asclogit command.
nowght specifies that weights be ignored when calculating the medians.
Examples
Setup
. webuse choice
Fit alternative-specific logit model
. asclogit choice dealer, casev(sex income) case(id) altern(car)
Predict probability each alternative is chosen
. predict p if e(sample)
Predict probability each alternative is chosen, conditional on each case
choosing two alternatives
. predict p2, k(2)
Obtain summary statistics about the alternatives
. estat alt
Obtain marginal effects assuming each person is female and there is one
dealership of each nationality in each city
. estat mfx, varlist(sex income) at(sex=0 dealer=1)
Saved results
estat mfx saves the following in r():
r(pr_alt) scalars containing the computed probability of each alternative
evaluated at the value that is labeled X in the table output. Here
alt are the labels in the macro e(alteqs).
r(alt) matrices containing the computed marginal effects and associated
statistics. There is one matrix for each alternative, where alt are
the labels in the macro e(alteqs). Column 1 of each matrix contains
the marginal effects; column 2, their standard errors; column 3,
their z statistics; and columns 4 and 5, the confidence intervals.
Column 6 contains the values of the independent variables used to
compute the probabilities r(pr_alt).
Also see
Manual: [R] asclogit postestimation
Help: [R] asclogit