📄 xtreg.hlp
字号:
{smcl}
{* 07apr2005}{...}
{cmd:help xtreg} {right:dialog: {bf:{dialog xtreg}}{space 15}}
{right:also see: {help xtreg postestimation}}
{hline}
{title:Title}
{p2colset 5 19 21 2}{...}
{p2col :{hi:[XT] xtreg} {hline 2}}Fixed-, between-, and random-effects, and population-averaged linear models{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
GLS random-effects (RE) model
{p 8 16 2}{cmd:xtreg} {depvar} [{indepvars}] {it:{help if}}
[{cmd:, re} {it:{help xtreg##reoptions:RE_options}}]
{phang}
Between-effects (BE) model
{p 8 16 2}{cmd:xtreg} {depvar} [{indepvars}] {it:{help if}}
{cmd:, be} [{it:{help xtreg##beoptions:BE_options}}]
{phang}
Fixed-effects (FE) model
{p 8 16 2}{cmd:xtreg} {depvar} [{indepvars}] {it:{help if}}
{cmd:, fe} [{it:{help xtreg##feoptions:FE_options}}]
{phang}
ML random-effects (MLE) model
{p 8 16 2}{cmd:xtreg} {depvar} [{indepvars}] {it:{help if}} {weight}
{cmd:, mle} [{it:{help xtreg##mleoptions:MLE_options}}]
{phang}
Population-averaged (PA) model
{p 8 16 2}{cmd:xtreg} {depvar} [{indepvars}] {it:{help if}} {weight}
{cmd:, pa} [{it:{help xtreg##paoptions:PA_options}}]
{marker reoptions}{...}
{synoptset 20 tabbed}{...}
{synopthdr :RE_options}
{synoptline}
{syntab:Model}
{synopt :{opth "i(varname:varname_i)"}}use {it:varname_i} as the panel ID variable{p_end}
{synopt :{opt re}}use random-effects estimator; the default{p_end}
{synopt :{opt sa}}use Swamy-Arora estimator of the variance components{p_end}
{syntab:SE/Robust}
{synopt :{opth vce(vcetype)}}{it:vcetype} may be {opt r:obust}, {opt boot:strap} or {opt jack:knife}{p_end}
{synopt :{opt r:obust}}synonym for {cmd:vce(robust)}{p_end}
{synopt :{opth cl:uster(varname)}}adjust standard errors for intragroup correlation{p_end}
{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synopt :{opt th:eta}}report theta{p_end}
{synoptline}
{p2colreset}{...}
{marker beoptions}{...}
{synoptset 20 tabbed}{...}
{synopthdr :BE_options}
{synoptline}
{syntab:Model}
{synopt :{opth "i(varname:varname_i)"}}use {it:varname_i} as the panel ID variable{p_end}
{synopt :{opt be}}use between-effects estimator{p_end}
{synopt :{opt w:ls}}use weighted least squares{p_end}
{syntab:SE}
{synopt :{opth vce(vcetype)}}{it:vcetype} may be {opt boot:strap} or {opt jack:knife}{p_end}
{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synoptline}
{p2colreset}{...}
{marker feoptions}{...}
{synoptset 20 tabbed}{...}
{synopthdr :FE_options}
{synoptline}
{syntab:Model}
{synopt :{opth "i(varname:varname_i)"}}use {it:varname_i} as the panel ID variable{p_end}
{synopt :{opt fe}}use fixed-effects estimator{p_end}
{syntab:SE/Robust}
{synopt :{opth vce(vcetype)}}{it:vcetype} may be {opt r:obust}, {opt boot:strap} or {opt jack:knife}{p_end}
{synopt :{opt r:obust}}synonym for {cmd:vce(robust)}{p_end}
{synopt :{opth cl:uster(varname)}}adjust standard errors for intragroup correlation{p_end}
{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synoptline}
{p2colreset}{...}
{marker mleoptions}{...}
{synoptset 20 tabbed}{...}
{synopthdr :MLE_options}
{synoptline}
{syntab:Model}
{synopt :{opth "i(varname:varname_i)"}}use {it:varname_i} as the panel ID variable{p_end}
{synopt :{opt nocon:stant}}suppress constant term{p_end}
{synopt :{opt mle}}use ML random-effects estimator{p_end}
{syntab:SE}
{synopt :{opth vce(vcetype)}}{it:vcetype} may be {opt boot:strap} or {opt jack:knife}{p_end}
{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{syntab:Max options}
{synopt :{it:{help xtreg##maximize_options:maximize_options}}}control the maximization process; seldom used{p_end}
{synoptline}
{p2colreset}{...}
{marker paoptions}{...}
{synoptset 20 tabbed}{...}
{synopthdr:PA_options}
{synoptline}
{syntab :Model}
{synopt :{opth "i(varname:varname_i)"}}use {it:varname_i} as the panel ID variable{p_end}
{synopt :{opt nocon:stant}}suppress constant term{p_end}
{synopt :{opt pa}}use population-averaged estimator{p_end}
{synopt :{opth off:set(varname)}}include {it:varname} in model with coefficient
constrained to 1{p_end}
{syntab :Correlation}
{synopt :{cmdab:c:orr(}{it:{help xtnbreg##correlation:correlation}}{cmd:)}}within-group correlation structure{p_end}
{synopt :{opt force}}estimate even if observations unequally spaced in time{p_end}
{syntab :SE/Robust}
{synopt :{opth vce(vcetype)}}{it:vcetype} may be {opt r:obust}, {opt boot:strap} or {opt jack:knife}{p_end}
{synopt :{opt r:obust}}synonym for {cmd:vce(robust)}{p_end}
{synopt :{opt nmp}}use divisor N-P instead of the default N{p_end}
{synopt :{opt rgf}}multiply the robust variance estimate by (N-1)/(N-P){p_end}
{synopt :{cmdab:s:cale(x2)}}set scale parameter to Pearson chi-squared statistic{p_end}
{synopt :{cmdab:s:cale(dev)}}set scale parameter to deviance divided by degrees of freedom{p_end}
{synopt :{cmdab:s:cale(phi)}}do not rescale the variance{p_end}
{synopt :{opt scale(#)}}set scale parameter to {it:#}{p_end}
{syntab :Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{syntab :Opt options}
{synopt :{it:{help xtreg##optimize_options:optimize_options}}}control the optimization process; seldom used{p_end}
{synoptline}
{p2colreset}{...}
{synoptset 20}{...}
{synopthdr :correlation}
{synoptline}
{synopt :{opt exc:hangeable}}exchangeable{p_end}
{synopt :{opt ind:ependent}}exchangeable{p_end}
{synopt :{opt uns:tructured}}unstructured{p_end}
{synopt :{opt fix:ed} {it:matname}}user-specified{p_end}
{synopt :{opt ar} {it:#}}autoregressive of order {it:#}{p_end}
{synopt :{opt sta:tionary} {it:#}}stationary of order {it:#}{p_end}
{synopt :{opt non:stationary} {it:#}}nonstationary of order {it:#}{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{it:depvar} and {it:indepvars} may contain time-series operators; see {help tsvarlist}.{p_end}
{p 4 6 2}
{opt bootstrap}, {opt by}, {opt jackknife}, {opt statsby}, and {opt xi} may be used with {cmd:xtreg}; see {help prefix}.{p_end}
{p 4 6 2}
{opt iweight}s, {opt fweight}s, and {opt pweight}s are allowed for the population-averaged model and {opt iweight}s are allowed for the maximum-likelihood (ML) random-effects model. {help weight:Weights} must be constant within panels.{p_end}
{p 4 6 2}
See {help xtreg postestimation} for features available after estimation.{p_end}
{title:Description}
{pstd}
{cmd:xtreg} fits cross-sectional time-series regression models. In
particular, {cmd:xtreg} with the {opt be} option fits random-effects models
using the between regression estimator; with the {opt fe} option, it fits
fixed-effects models (using the within regression estimator); and with the
{opt re} option, it fits random-effects models using the GLS estimator
(producing a matrix-weighted average of the between and within results). See
{helpb xtdata} for a faster way to fit fixed- and random-effects models.
{title:Options for RE model}
{dlgtab:Model}
{phang}
{opth "i(varname:varname_i)"}; see {help estimation options##i():estimation options}.
{phang}
{opt re}, the default, requests the GLS random-effects estimator.
{phang}
{opt sa} specifies that the small-sample Swamy-Arora estimator
individual-level variance component be used instead of the default consistent
estimator.
{dlgtab:SE/Robust}
{phang}
{opt vce(vcetype)}; see {it:{help vce_option}}
{phang}
{opt robust}, {opth cluster(varname)}; see
{help estimation options##robust:estimation options}.
{dlgtab:Reporting}
{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.
{phang}
{opt theta} specifies that the output should include the estimated value of
theta used in combining the between and fixed estimators. For balanced data,
this is a constant, and for unbalanced data, a summary of the values is
presented in the header of the output.
{title:Options for BE model}
{dlgtab:Model}
{phang}
{opth "i(varname:varname_i)"}; see {help estimation options##i():estimation options}.
{phang}
{opt be} requests the between regression estimator.
{phang}
{opt wls} specifies that, in the case of unbalanced data, weighted least
squares be used rather than the default OLS. Both methods produce consistent
estimates.
{dlgtab:SE}
{phang}
{opt vce(vcetype)}; see {it:{help vce_option}}
{dlgtab:Reporting}
{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.
{title:Options for FE model}
{dlgtab:Model}
{phang}
{opth "i(varname:varname_i)"}; see {help estimation options##i():estimation options}.
{phang}
{opt fe} requests the fixed-effects (within) regression estimator.
{dlgtab:SE}
{phang}
{opt vce(vcetype)}; see {it:{help vce_option}}.
{dlgtab:Reporting}
{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.
{title:Options for MLE model}
{dlgtab:Model}
{phang}
{opth "i(varname:varname_i)"}; see {help estimation options##i():estimation options}.
{phang}
{opt mle} requests the maximum-likelihood random-effects estimator.
{dlgtab:SE}
{phang}
{opt vce(vcetype)}; see {it:{help vce_option}}
{dlgtab:Reporting}
{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.
{dlgtab:Max options}
{phang}
{marker maximize_options}
{it:maximize_options}:
{opt iter:ate(#)}, [{opt no:}]{opt lo:g}, {opt tr:ace}, {opt tol:erance(#)},
{opt ltol:erance(#)}, {opt from(init_specs)}; see {help maximize}. These
options are seldom used.
{title:Options for PA model}
{dlgtab:Model}
{phang}
{opth "i(varname:varname_i)"}, {opt noconstant}; see
{help estimation options##i():estimation options}.
{phang}
{opt pa} requests the population-averaged estimator. For linear regression, this is the same as a random-effects estimator (both interpretations hold).
{pmore}
{cmd:xtreg, pa} is equivalent to
{cmd:xtgee, family(gaussian) link(id) corr(exchangeable)}, which are all
the defaults for the {cmd:xtgee} command. {cmd:xtreg, pa} allows all the
relevant {cmd:xtgee} options such as {cmd:robust}. Whether you use
{cmd:xtreg, pa} or {cmd:xtgee} makes no difference. See {helpb xtgee}.
{phang}
{opth offset(varname)}; see {help estimation options##offset():estimation options}.
{dlgtab:Correlation}
{phang}
{opt corr(correlation)}, {opt force}; see
{help estimation options##corr():estimation options}.
{dlgtab:SE/Robust}
{phang}
{opt vce(vcetype)}; see {it:{help vce_option}}.
{phang}
{opt robust} {opt nmp}; see {help estimation options##robust:estimation options}.
{phang}
{opt rgf} specifies that the robust variance estimate is multiplied by
(N-1)/(N-P), where N is the total number of observations and P is the number
of coefficients estimated. This option can only be used with
{cmd:family(gaussian)} when {opt robust} is either specified or implied by the
use of {opt pweight}s. Using this option implies that the robust variance
estimate is not invariant to the scale of any weights used.
{phang}
{cmd:scale(x2}|{cmd:dev}|{it:#}|{cmd:phi)} overrides the default scale
parameter of {cmd:scale(1)}; see
{help estimation options##scale():estimation options}.
{dlgtab:Reporting}
{phang}
{opt level(#)}; see {help estimation options##level():estimation options}.
{dlgtab:Opt options}
{phang}
{marker optimize_options}
{it:optimize_options} control the iterative optimization process. These options
are seldom used.
{pmore}
{opt iter:ate(#)} specifies the maximum number of iterations. When the number
of iterations equals #, the optimization stops and presents the current results,
even if the convergence tolerance has not been reached. The default value of
{opt iterate()} is 100.
{pmore}
{opt tol:erance(#)} specifies the tolerance for the coefficient vector. When
the relative change in the coefficient vector from one iteration to the next is
less than or equal to #, the optimization process is stopped.
{cmd:tolerance(1e-6)} is the default.
{pmore}
{opt nolog} suppress the display of the iteration log.
{pmore}
{opt tr:ace} specifies that the current estimates should be printed at each
iteration.
{title:Examples}
{cmd:. iis id}
{phang}{cmd:. xtreg ln_w grade age* ttl_exp tenure*, be}
{phang}{cmd:. xtreg ln_w grade age* ttl_exp tenure*, fe}
{phang}{cmd:. xtreg ln_w grade age* ttl_exp tenure*, re}{p_end}
{cmd:. xttest0}
{phang}{cmd:. predict ln_w_hat if e(sample)}{p_end}
{phang}{cmd:. predict ui, u}
{phang}{cmd:. xtreg ln_w grade age* ttl_exp tenure*, mle}
{phang}{cmd:. xtreg ln_w grade age* ttl_exp tenure*, mle}
{phang}{cmd:. xtreg ln_w grade age* ttl_exp tenure*, pa robust}
{title:Also see}
{psee}
Manual: {bf:[XT] xtreg}
{psee}
Online: {help xtreg postestimation};{break}
{help xt}; {helpb prais}, {helpb regress}
{helpb xtdata}, {helpb xtdes},
{helpb xtgee}, {helpb xtgls}, {helpb xtivreg}, {helpb xtmixed},
{helpb xtregar}, {helpb xtsum}, {helpb xttab}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -