*! version 1.0.5 21sept2019

[XT] rho_xtregar -- rho of BFN in a fixed-effects or random-effects linear model with an AR(1) disturbance

Syntax

Fixed-effects (FE) model or Random-effects (RE) model

rho_xtregar depvar [indepvars] [if] [using filename] [, approx approx_balanced approx_unbalanced nodisplay]

options Description

approx Instead of rho_BFN, it computes the appropriate approximation, taking account whether the panel is balanced or unbalanced.
approx_balanced	(seldom used) Force the command to compute the approximation of rho_BFN appropriate to the balanced case.
approx_unbalanced (seldom used) Force the command to compute the approximation of rho_BFN appropriate to the unbalanced case.
nodisplay Do not display the message regarding the number of units with at least two successive observations.

A panel variable and a time variable must be specified; use xtset.
Weights are not allowed

Description

rho_xtregar estimates the autoregressive parameter for cross-sectional time-series regression models
when the disturbance term is first-order autoregressive.
It generalizes to the unbalanced case the method exposed in Bargava, Franzini and Narendranathan(1982).
As such, it returns r(rho_BFN).
rho_xtregar can accommodate unbalanced panels whose observations are unequally spaced over time.

Remark:
rho_xtregar uses only on those individuals that have at least two successive observations.
When such condition is too stringent, see for instance Magnac, Pistolesi and Roux (2018).

Technical remarks:
rho_xtregar requires the user-written command: moremata. You can access it on ssc:
.ssc install moremata, replace
In very long panels (T>70), computation of rho_BFN may require an increase in maxvar (set it higher than T*T).

Example

Setup:
. webuse grunfeld
. xtset company time
Estimation of rho:
. rho_xtregar invest mvalue kstock
. local rhoBFN = r(rho_BFN)
Fixed-effects model:
. xtregar invest mvalue kstock, fe rhof(`rhoBFN')
Comparison with xtregar:
. xtregar invest mvalue kstock, fe
. dis "rho_BFN = " `rhoBFN' " ; rho_xtregar = " `e(rho_ar)'

To make a Monte-Carlo simulation:
. scalar the_rho = e(rho_ar)
. scalar the_sigma_eta = e(sigma_e)
. scalar the_sigma_c_i = e(sigma_u)
. scalar the_sigma_epsilon = the_sigma_eta / sqrt(1-the_rho*the_rho)
. matrix the_sd = (the_sigma_eta,the_sigma_epsilon,the_sigma_c_i)
. gen rho_emp = 0
. gen rho_emp2 = 0
. set seed 89
. forvalues i = 1/10 {
. drawnorm eta epsilon0 c_i, means(0,0,0) sds(the_sd)
. bysort company: gen epsilon= epsilon0 if _n==1
. bysort company: replace epsilon=eta + the_rho * epsilon[_n-1] if _n>1
. bysort company: replace c_i = c_i[1]
. gen y = c_i + epsilon
. xtregar y, fe
. replace rho_emp = e(rho_ar) if _n==`i'
. rho_xtregar y
. replace rho_emp2 = r(rho_BFN) if _n==`i'
. drop epsilon epsilon epsilon0 y eta c_i
. }
. keep if _n<=10
. collapse (mean)rho_emp rho_emp2
. display "true value: " the_rho "; xtregar gives: " rho_emp[1] " ; rho_xtregar gives: " rho_emp2[1]

Stored results

rho_xtregar stores the following in r() :

Scalars
r(rho_BFN) rho of BFN (or its approximation when an option is supplied)

Formula

Let d_p define the generalisation of the Durbin-Watson statistic of Cazenave-Lacroutz and Vieu (2019):
and r_d = (1-d_p/2)

rho_BFN is defined by: rho_d = g_N(rho_BFN)
with g_N:r-> $1 - \frac{(1-r) \sum_^N \frac{1+K_i}}$
where: $K_i = \sum_^ \mathbb{1}_ $

rho_BFN_approx_balanced is defined by:
rho_BFN_approx_balanced = rho_d / (2-T)
In a balanced panel, its bias converges towards zero (when T -> infinity) in $1/T^2$. Suggested for fast computations when T is large (e.g. T=10).

rho_BFN_approx_unbalanced is defined by:
rho_BFN_approx_unbalanced = $\frac{\frac{1} \sum_^N \frac{1+K_i}-1+\rho_d}{\frac{1} \sum_^N \frac{1+K_i}}$
It should not be used in balanced panels, as its bias converges towards zero much slower than rho_BFN_balanced (in $1/T$).

References

Bhargava, A., L. Franzini, and W. Narendranathan. 1982. Serial correlation and the fixed effects
model. Review of Economic Studies 49: 533-549.

Magnac, T., Pistolesi, N., & Roux, S. 2018. Post-Schooling Human Capital Investments and the Life Cycle of Earnings. Journal of Political Economy, 126(3), 1219-1249.

Cazenave-Lacroutz, A. and V. Lin. 2019. rho_xtregar: a new command to improve the estimation of rho in AR(1) panels.
Mimeo.

Authors

Alexandre Cazenave-Lacroutz and Vieu Lin

Centre de Recherche en Economie et en Statistiques (Crest) et Institut National de la Statistique et des Etudes Economiques (Insee)

alexandre.cazenave-lacroutz@polytechnique.org

https://sites.google.com/view/acazenave-lacroutz/english

https://github.com/ACL90/rho_xtregar