[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: autocorrelation
Thushyanthan Baskaran <firstname.lastname@example.org> wrote that he has panel data with
some form of within panel serial correlation and conditional
If the panel-level effect is independent of the covariates in the model,
Thushyanthan could type
. xtgee y x1 x2, i(panel_id) corr(unstructured) robust
The above command will estimate the parameters of a linear panel-data model
with arbitrary within panel correlation and the estimated VCE will be robust
to conditional heteroskedasticity over the panels.
If the panel-level effect is not indepedent of the covariates in the model,
i.e. Thushyanthan is interested in a fixed-effect type model, then
Thushyanthan should difference the data before estimating the model to
remove the panel-level effect. For example, assuming that the dataset is
. gen double Dy = D.y
. gen double Dx1 = D.x1
. gen double Dx2 = D.x2
. xtgee Dy Dx1 Dx2, i(panel_id) corr(unstructured) robust noconstant
would provide consistent estimates of the parameters of interest and a
heteroskedasticity robust VCE.
In Stata 9 one can type
. xtgee D.y D.x1 D.x2, i(panel_id) corr(unstructured) robust noconstant
The -noconstant- option is specified because an intercept in the differenced
data is a time trend in the undifferenced data. However, some researchers are
so averse to estimating a regression model without an intercept that they
do not specify the -noconstant- option.
I hope that this helps.
* For searches and help try: