[XT] xtdata -- Faster specification searches with xt data
Syntax
xtdata [varlist] [if] [in] [, options]
options Description
-------------------------------------------------------------------------
Main
re convert data to a form suitable for random-effects
estimation
ratio(#) ratio of random effect to pure residual (standard
deviations)
be convert data to a form suitable for between estimation
fe convert data to a form suitable for fixed-effects
(within) estimation
nodouble keep original variable type; default is to recast type
as double
clear overwrite current data in memory
-------------------------------------------------------------------------
A panel variable must be specified; use xtset.
Menu
Statistics > Longitudinal/panel data > Setup and utilities > Faster
specification searches with xt data
Description
xtdata produces a transformed dataset of the variables specified in
varlist or of all the variables in the data. Once the data are
transformed, Stata's regress command may be used to perform specification
searches more quickly than xtreg; see [R] regress and [XT] xtreg. Using
xtdata, re also creates a variable named constant. When using regress
after xtdata, re, specify noconstant and include constant in the
regression. After xtdata, be and xtdata, fe, you need not include
constant or specify regress's noconstant option.
Options
+------+
----+ Main +-------------------------------------------------------------
re specifies that the data be converted into a form suitable for
random-effects estimation. re is the default if be, fe, or re is not
specified. ratio() must also be specified.
ratio(#) (use with xtdata, re only) specifies the ratio sigma_u/sigma_e,
which is the ratio of the random effect to the pure residual. This
is the ratio of the standard deviations, not the variances.
be specifies that the data be converted into a form suitable for between
estimation.
fe specifies that the data be converted into a form suitable for
fixed-effects (within) estimation.
nodouble specifies that transformed variables keep their original types,
if possible. The default is to recast variables to double.
Remember that xtdata transforms variables to be differences from
group means, pseudodifferences from group means, or group means.
Specifying nodouble will decrease the size of the resulting dataset
but may introduce roundoff errors in these calculations.
clear specifies that the data may be converted even though the dataset
has changed since it was last saved on disk.
Examples
---------------------------------------------------------------------------
Setup
. webuse xtdatasmpl
Perform between transformation
. xtdata ln_w grade age* ttl_exp* tenure* black not_smsa south, be
Equivalent to xtreg, be
. regress ln_w grade age* ttl_exp* tenure* black not_smsa south
---------------------------------------------------------------------------
Setup
. webuse xtdatasmpl, clear
Perform within transformation
. xtdata, fe
Equivalent to xtreg, fe
. regress ln_w grade age* ttl_exp* tenure* black not_smsa south
---------------------------------------------------------------------------
Setup
. webuse xtdatasmpl, clear
Perform random-effects transformation
. xtdata, re ratio(.88719358)
Equivalent to xtreg, re
. regress ln_w grade age* ttl_exp* tenure* black not_smsa south
constant, noconstant
---------------------------------------------------------------------------
Warnings
1. xtdata is intended for use during the specification search phase of
analysis. Final results should be estimated with xtreg on
unconverted data.
2. Using regress after xtdata, fe, produces standard errors that are too
small, but only slightly.
3. Interpret significance tests and confidence intervals loosely. After
xtdata, fe and re, an incorrect (but close to correct) distribution
is being assumed.
4. You should ignore the summary statistics reported at the top of
regress's output.
5. After converting the data, you may form linear, but not nonlinear
combinations of regressors.