Stata 15 help for asmprobit_postestimation

[R] asmprobit postestimation -- Postestimation tools for asmprobit

Postestimation commands

The following postestimation commands are of special interest after asmprobit:

Command Description ------------------------------------------------------------------------- estat alternatives alternative summary statistics estat covariance covariance matrix of the latent-variable errors for the alternatives estat correlation correlation matrix of the latent-variable errors for the alternatives estat facweights covariance factor weights matrix estat mfx marginal effects -------------------------------------------------------------------------

The following standard postestimation commands are also available:

Command Description ------------------------------------------------------------------------- contrast contrasts and ANOVA-style joint tests of estimates estat ic Akaike's and Schwarz's Bayesian information criteria (AIC and BIC) estat summarize summary statistics for the estimation sample estat vce variance-covariance matrix of the estimators (VCE) 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 pwcompare pairwise comparisons of estimates test Wald tests of simple and composite linear hypotheses testnl Wald tests of nonlinear hypotheses -------------------------------------------------------------------------

Syntax for predict

predict [type] newvar [if] [in] [, statistic altwise]

predict [type] {stub*|newvarlist} [if] [in] , scores

statistic Description ------------------------------------------------------------------------- Main pr probability alternative is chosen; the default xb linear prediction stdp standard error of the linear prediction ------------------------------------------------------------------------- These statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted only for the estimation sample.

Menu for predict

Statistics > Postestimation

Description for predict

predict creates a new variable containing predictions such as probabilities, linear predictions, and standard errors.

Options for predict

+------+ ----+ Main +-------------------------------------------------------------

pr, the default, calculates the probability that alternative j is chosen in case i.

xb calculates the linear prediction for alternative j and case i.

stdp calculates the standard error of the linear predictor.

altwise specifies that alternativewise 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 alternativewise deletion.

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* syntax to have predict generate enumerated variables with prefix stub.

Syntax for estat

Alternative summary statistics

estat alternatives

Covariance matrix of the latent-variable errors for the alternatives

estat covariance [, format(%fmt) border(bspec) left(#)]

Correlation matrix of the latent-variable errors for the alternatives

estat correlation [, format(%fmt) border(bspec) left(#)]

Covariance factor weights matrix

estat facweights [, format(%fmt) border(bspec) left(#)]

Marginal effects

estat mfx [if] [in] [, estat_mfx_options]

estat_mfx_options Description ------------------------------------------------------------------------- Main

varlist(varlist) display marginal effects for varlist at(mean [atlist]|median [atlist]) calculate marginal effects at these values

Options level(#) set confidence interval level; default is level(95) noesample do not restrict calculation of means and medians to the estimation sample nowght ignore weights when calculating means and medians -------------------------------------------------------------------------

Menu for estat

Statistics > Postestimation

Description for estat

estat alternatives displays summary statistics about the alternatives in the estimation sample and provides a mapping between the index numbers that label the covariance parameters of the model and their associated values and labels for the alternative variable.

estat covariance computes the estimated variance-covariance matrix of the latent-variable errors for the alternatives. The estimates are displayed, and the variance-covariance matrix is stored in r(cov).

estat correlation computes the estimated correlation matrix of the latent-variable errors for the alternatives. The estimates are displayed, and the correlation matrix is stored in r(cor).

estat facweights displays the covariance factor weights matrix and stores it in r(C).

estat mfx computes the simulated probability marginal effects.

Options for estat

Options for estat are presented under the following headings:

Options for estat covariance, estat correlation, and estat facweights Options for estat mfx

Options for estat covariance, estat correlation, and estat facweights

format(%fmt) sets the matrix display format. The default for estat covariance and estat facweights is format(%9.0f); the default for estat correlation is format(%9.4f).

border(bspec) sets the matrix display border style. The default is border(all). See [P] matlist.

left(#) sets the matrix display left indent. The default is left(2). See [P] matlist.

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 = #] [...]]

The default is to calculate the marginal effects at the means of the independent variables at the estimation sample, at(mean).

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. For example, in the travel dataset, income is a case-specific variable, whereas termtime and travelcost are alternative-specific variables. The following would be a legal syntax for estat mfx:

. estat mfx, at(mean air:termtime=50 travelcost=100 income=60)

at(mean [atlist]) or at(median [atlist]) has no effect on computing marginal effects for factor variables, which are calculated as the discrete change in the probability as the factor variable changes from the base level to the level specified in option at(). If a factor level is not specified in the at() option, the first level that is not the base is used.

The mean and median computations respect any if or in qualifiers, so you can restrict the data over which the means or medians are computed. You can even restrict the values to a specific case; for example,

. estat mfx if case==21

+---------+ ----+ Options +----------------------------------------------------------

level(#) specifies the confidence level, as a percentage, for confidence intervals. The default is level(95) or as set by set level.

noesample specifies that the whole dataset be considered instead of only those marked in the e(sample) defined by the asmprobit command.

nowght specifies that weights be ignored when calculating the means or medians.

Remarks

Simulated probability marginal effects cannot be computed for a variable that is specified in both the alternative-specific and case-specific variable lists. Computations assume that these two variable lists are mutually exclusive. For example, estat mfx exits with an error message if your model has independent variables that are the interaction between alternative-specific variables (indepvars specified in asmprobit) and case-specific variables (varlist specified in the casevars() option). Marginal effect computations can proceed if you specify a variable list in the varlist() option of estat mfx that excludes the variables that are used in both the alternative-specific and case-specific variable lists.

Examples

--------------------------------------------------------------------------- Setup . webuse travel . asmprobit choice travelcost termtime, case(id) alternatives(mode) casevars(income)

Obtain correlation matrix of the alternatives . estat correlation

Obtain variance-covariance matrix of the alternatives . estat covariance

Calculate probability alternative is chosen . predict p

Calculate marginal effects for the case-specific variable income and the alternative-specific variables termtime and travelcost . estat mfx, at(air: termtime=50 travelcost=100 income=60)

--------------------------------------------------------------------------- Setup . webuse travel, clear . asmprobit choice travelcost termtime, case(id) alternatives(mode) casevars(income) . estimates store full . asmprobit choice travelcost termtime, case(id) alternatives(mode) casevars(income) correlation(exchangeable)

Perform likelihood-ratio test to compare models . lrtest full . ---------------------------------------------------------------------------

Stored results

estat mfx stores the following in r():

Scalars

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

Matrices

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; columns 3 and 4, their z statistics and the p-values for the z statistics; and columns 5 and 6, the confidence intervals. Column 7 contains the values of the independent variables used to compute the probabilities r(pr_alt).


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index