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" <[email protected]>
To   <[email protected]>
Subject   st: Re: xtreg and stepwise
Date   Thu, 20 Jul 2006 16:49:13 -0400

Valerie

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.
Rodrigo.


*** 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
preserve
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
restore
}
est table T*, se p
*** End Illustration ***





----- Original Message ----- 
From: "Val�rie Orozco" <[email protected]>
To: <[email protected]>
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



-- 

***********************
Val�rie Orozco
INRA ESR Toulouse - FRANCE
ESR INRA - BP52627 - 31326 Castanet Tolosan Cedex
[email protected]
05-61-28-50-97
***********************




*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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