Stata 15 help for xtreg_postestimation

[XT] xtreg postestimation -- Postestimation tools for xtreg

Postestimation commands

The following postestimation commands are of special interest after xtreg:

Command Description ------------------------------------------------------------------------- xttest0 Breusch and Pagan LM test for random 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 + forecast dynamic forecasts and simulations hausman Hausman's specification test lincom point estimates, standard errors, testing, and inference for linear combinations of coefficients * lrtest likelihood-ratio test margins marginal means, predictive margins, marginal effects, and average marginal effects marginsplot graph the results from margins (profile plots, interaction plots, etc.) nlcom point estimates, standard errors, testing, and inference for nonlinear combinations of coefficients predict predictions, residuals, influence statistics, and other diagnostic measures 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 ------------------------------------------------------------------------- * estat ic and lrtest are not appropriate after xtreg with the pa or re option. + forecast is not appropriate with mi estimation results.

Syntax for predict

For all but the population-averaged model

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

Population-averaged model

predict [type] newvar [if] [in] [, PA_statistic nooffset]

statistic Description ------------------------------------------------------------------------- Main xb a + xb, fitted values; the default stdp standard error of the fitted values ue u_i + e_it, the combined residual * xbu a + xb + u_i, prediction including effect * u u_i, the fixed- or random-error component * e e_it, the overall error component ------------------------------------------------------------------------- Unstarred statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted only for the estimation sample. Starred statistics are calculated only for the estimation sample, even when if e(sample) is not specified.

PA_statistic Description ------------------------------------------------------------------------- Main mu predicted value of depvar; considers the offset() rate predicted value of depvar xb linear prediction stdp standard error of the linear prediction score first derivative of the log likelihood with respect to xb ------------------------------------------------------------------------- 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 fitted values, standard errors, predicted values, linear predictions, and equation-level scores.

Options for predict

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

xb calculates the linear prediction, that is, a + xb. This is the default for all except the population-averaged model.

stdp calculates the standard error of the linear prediction. For the fixed-effects model, this excludes the variance due to uncertainty about the estimate of u_i.

mu and rate both calculate the predicted value of depvar. mu takes into account the offset(), and rate ignores those adjustments. mu and rate are equivalent if you did not specify offset(). mu is the default for the population-averaged model.

ue calculates the prediction of u_i + e_it.

xbu calculates the prediction of a + xb + u_i, the prediction including the fixed or random component.

u calculates the prediction of u_i, the estimated fixed or random effect.

e calculates the prediction of e_it.

score calculates the equation-level score.

nooffset is relevant only if you specified offset(varname) for xtreg, pa. It modifies the calculations made by predict so that they ignore the offset variable; the linear prediction is treated as xb rather than xb + offset.

Syntax for margins

margins [marginlist] [, options]

margins [marginlist] , predict(statistic ...) [predict(statistic ...) ...] [options]

For all but the population-averaged model

statistic Description ------------------------------------------------------------------------- xb a + xb, fitted values; the default stdp not allowed with margins ue not allowed with margins xbu not allowed with margins u not allowed with margins e not allowed with margins -------------------------------------------------------------------------

Population-averaged model

statistic Description ------------------------------------------------------------------------- mu predicted value of depvar; considers the offset() rate predicted value of depvar xb linear prediction stdp not allowed with margins score not allowed with margins -------------------------------------------------------------------------

Statistics not allowed with margins are functions of stochastic quantities other than e(b).

For the full syntax, see [R] margins.

Menu for margins

Statistics > Postestimation

Description for margins

margins estimates margins of response for fitted values, probabilities, and linear predictions.

Syntax for xttest0

xttest0

Menu for xttest0

Statistics > Longitudinal/panel data > Linear models > Lagrange multiplier test for random effects

Description for xttest0

xttest0, for use after xtreg, re, presents the Breusch and Pagan (1980) Lagrange multiplier test for random effects, a test that Var(v_i)=0.

Examples

Setup . webuse nlswork . xtset idcode

Fit random-effects model . xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, re

Store random-effects results for later use . estimates store random_effects

Breusch and Pagan Lagrangian multiplier test for random effects . xttest0

Fit fixed-effects model . xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, fe

Hausman specification test . hausman . random_effects

Reference

Breusch, T. S., and A. R. Pagan. 1980. The Lagrange multiplier test and its applications to model specification in econometrics. Review of Economic Studies 47: 239-253.


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