Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: xtreg and stepwise

From   "Rodrigo A. Alfaro" <>
To   <>
Subject   st: Re: xtreg and stepwise
Date   Thu, 20 Jul 2006 16:49:13 -0400


You can use the regular regression but you need to adjust the degree of
freedom of the error variance. The adjustment is q=(N-K-1)/(N-K-n),
where N is the total sample, K the regressor and n the cross-sectional
size. As you can see the adjustment changes for every iteration of -sw-

Note that q = 1 + (n-1)/(N-K-n). In case that n is large (usually this is
the case for most of panel data) such that K/n and 1/n and very small
I think that you can approximate q by 1 + 1/(T-1).

Then you can use -xtdata, fe- and -sw reg - (with iweight or in short
iw) to deal with your problem.

Below is an example where:
T1 is a regression with -xtreg-,
T2 is a wrong regression (without adjustment),
T3 has a fixed adjustment (valid for balanced panel-data) and
T4 has a more accurate adjustment which is the one I recommend you.

I hope this helps you.

*** Illustration ***
qui {
webuse nlswork, clear
bysort idcode: egen double ti=count( idcode)
g w=(ti-1)/ti
sum year
local w= 1/(1+1/(r(max)-r(min)))
qui xtreg ln_w age ttl_exp tenure, fe i( idcode)
est store T1
xtdata ln_w age ttl_exp tenure w, fe clear
reg ln_w age ttl_exp tenure
est store T2
reg ln_w age ttl_exp tenure [iw=`w']
est store T3
reg ln_w age ttl_exp tenure [iw=w]
est store T4
est table T*, se p
*** End Illustration ***

----- Original Message ----- 
From: "Valérie Orozco" <>
To: <>
Sent: Thursday, July 20, 2006 6:09 AM
Subject: st: xtreg and stepwise

I'm using "xtreg" for time-series regression with fixed effects. I have
a lot of variables and I am wondering if it is possible to do a stepwise
regression to keep the most significant ones...Unfortunately, the
command "sw" does not work with "xtreg". Does someone have any idea?

Thank you.



Valérie Orozco
ESR INRA - BP52627 - 31326 Castanet Tolosan Cedex

*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index