-------------------------------------------------------------------------------
help for xtarsim
-------------------------------------------------------------------------------
 Simulate panel dataset

xtarsim newdepvar newindepvar newindeffect newtimeffect , nid(#) time(#) gamma(real) beta(real) rho(real) snratio(real) [sigma(real) oneway(effect_type load) twoway(effect_type load) unbd(N_1 T_1) seed(#)]

xtarsim creates panel datasets for use in Monte Carlo experiments as pseudo-random realizations from (possibly) dynamic twoway linear panel data models.

Description

xtarsim creates a dataset from the following general panel data model

y[i,t] = y[i,t-1]gamma + x[i,t]beta + u[i] + u[t] + e[i,t]

x[i,t] = x[i,t-1]rho + v[i,t] i={1,...,N}; t={1,...,T},

where

gamma, beta and rho are real numbers chosen by the user.

e[i,t] are iid Normal(0,sigma^2), with sigma chosen by the user.

v[i,t] are iid Normal(0,sigma_v^2), with sigma_v being uniquely determined once choosing the model parameters and the signal to noise ratio of the y[i,t] regression. Attention should be paid to supply parameter values that ensure a finite positive variance for v[i,t]. When this does not happen an error message is issued by xtarsim.

e[i,t] and v[i,t] are not correlated, so that x[i,t] is a strictly exogenous regressor in the first equation of the model.

u[i] and u[t] are, respectively, the individual and time effects, and may or may not be correlated with x[i,t].

If correlated, individual effects are determined as u[i]=load_1*(1-gamma)*(1+x[i]-x), where x[i] and x, respectively, are the group mean and the overall mean of x[i,t], and load_1 is a load factor chosen by the user. Correlated time effects, instead, are determined as contrasts to the first period, u[t]=load_2*(1-gamma)*(x[t]-x[1]), where again load_2 is a load factor chosen by the user. Such normalisation is convenient in that the constant term in xtreg, in its one-way fixed effect version as well as two-way fixed effect version excluding the first time indicator, can be interpreted as an estimate for load_1*(1-gamma) (see the example file static2way_bias.do available for download). If not correlated, both effects are taken to be iid Normal(0,load^2*(1-gamma)^2) with a specific load factor for each effect.

Following Kiviet (1995) start-up values y[i,0] and x[i,0] are obtained according to the model using the McLeod and Hipel (1978) procedure. This avoids wasting random numbers in generating start-up values and also small-sample non-stationarity problems. This procedure has been also applied by Bun and Kiviet (2003), Bruno (2005a) and (2005b).

Options

nid(#) specifies the number of individuals in the panel.

time(#) specifies the number of time observations for each individual.

gamma(real) specifies the value for the gamma parameter. Since the model is stationary it must be picked up from within (1,-1).

beta(real) specifies the value for the beta parameter, which can be any real number.

rho(real) specifies the value for the rho parameter. Since the model is stationary it must be picked up from within (1,-1).

snratio(real) specifies the value for the signal to noise ratio.

sigma(real) specifies the value for the standard deviation of e[i,t]. The default is unity.

oneway(effect_type load) specifies 1) whether the individual effect is or is not correlated with x[i,t] and 2) the load factor load. Allowed effect_type is corr for correlated effects and rand for not correlated effects. load may be any real number. The default is oneway(rand 1).

twoway(effect_type load) specifies 1) whether the time effect is or is not correlated with x[i,t] and 2) the load factor load. Allowed effect_type is corr for correlated effects and rand for not correlated effects. load may be any real number. The default is no time effect.

unbd(N_1 T_1) determines a specific form of unbalancedess, such that the last T_1 time observations are missing for the first N_1 individuals. The default is no ubalancedness.

seed(#) sets the random-number seed.

Examples

(Create a panel from a static one-way random effect Data Generation Process (DGP)) . xtarsim y x eta, n(200) t(10) g(0) b(.8) r(.2) sn(9) seed(1234)

. describe

. xtdes

(Create a panel from a dynamic one-way fixed effect DGP) . xtarsim y x eta, n(200) t(10) g(.2) b(.8) r(.2) one(corr 1) sn(9) seed(1234)

. xtdes

(Demonstrate, on this dataset, the expected good perfomance of the basic Arellano-Bond estimator in terms of estimation error and specification tests) . xtabond y x,noco

(Create a panel from a dynamic two-way fixed effect DGP) . xtarsim y x eta theta, n(200) t(10) g(.2) b(.8) r(.2) two(corr 5) sn(9) seed(1234)

. describe

. xtdes

(Demonstrate, on this dataset, the expected poor perfomance of the basic Arellano-Bond estimator in terms of estimation error and specification tests) . xtabond y x,noco

(Demonstrate the expected better perfomance of the two-way Arellano-Bond estimator) . tab tvar,gen(time)

. xtabond y x time*,noco

(Make the foregoing dataset unbalanced: the last 5 time observations are missing for the first 50 individuals in the sample) . xtarsim y x eta theta, n(200) t(10) g(.2) b(.8) r(.2) two(corr 5) sn(9) unbd(50 5) seed(1234)

. xtdes

For examples of xtarsim in Monte Carlo experiments download the do files dyn_bias.do and static2way_bias.do. The former, upon setting up a dynamic one-way random effect DGP, estimates the unconditional small-sample biases of the dynamic one-way fixed effect and random effect estimators by 1000 Monte Carlo simulations. The latter sets up a static two-way fixed effect DGP and estimates the unconditional small-sample biases of the one-way and two-way fixed effect estimators using 1000 Monte Carlo simulations.

References

Bruno, G.S.F. 2005a. Approximating the bias of the LSDV estimator for dynamic unbalanced panel data models. Economics Letters, 87, 361-366: http://dx.doi.org/doi:10.1016/j.econlet.2005.01.005.

Bruno, G.S.F. 2005b. Estimation and inference in dynamic unbalanced panel data models with a small number of individuals. CESPRI WP n.165 , Università Bocconi-CESPRI, Milan.

Bun, M.J.G., Kiviet, J.F., 2003. On the diminishing returns of higher order terms in asymptotic expansions of bias. Economics Letters, 79, 145-152.

Kiviet, J.F., 1995. On Bias, Inconsistency and Efficiency of Various Estimators in Dynamic Panel Data Models. Journal of Econometrics, 68, 53-78.

Kiviet, J.F., 1999. Expectation of Expansions for Estimators in a Dynamic Panel Data Model; Some Results for Weakly Exogenous Regressors. In: Hsiao, C., Lahiri, K., Lee, L.-F., Pesaran, M.H. (Eds.), Analysis of Panel Data and Limited Dependent Variables. Cambridge University Press, Cambridge.

McLeod, A.I., K.W. Hipel 1978. Smulation Procedures for Box-Jenkins Models. Water Resources Research, 14, 969-975.

Author

Giovanni S.F. Bruno Istituto di Economia Politica, Università Bocconi Milan, Italy giovanni.bruno@unibocconi.it