Statalist The Stata Listserver


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

st: xtivreg2 and singleton-cases


From   "Rodrigo A. Alfaro" <[email protected]>
To   <[email protected]>
Subject   st: xtivreg2 and singleton-cases
Date   Tue, 11 Jul 2006 15:15:47 -0400

Hello,

I realized that -xtivreg2- controls for singleton-cases. Now I am not
sure if this involves a different results than regular Stata comands.

Below is a program (just copy+paste in an empty do-file) where I
create artificial data and run some estimation to show the differences

First, a simple Fixed-Effects model estimated using different commands
(S11, S12, S13 and S14). Easy to see in the first table that all parameters
as well standard errors are the same. 

In the second table I put Robust SE (S21 and S22) and Robust SE+
Autocorrelation correction (S31 and S32) and again everything is fine.

But, if I restrict the sample (if t<3) I got that the new simple FE (R11, 
R12, R13 and R14) are almost the same (only the # of observations
is lower in xtivreg2 due to singleton cases). A minor difference.

The big one is in last table, where the Robust SE (R21 and R22) are 
not longer similar. Same for Robust SE with autocorrelation correction
(R31 and R32). Funny thing is that R22 is similar to R31!!

Any comment is welcome. 
Rodrigo.


***************************************************
qui {
 /// Artifical data
 clear
 input id time y x
 1      1   25     .6 
 1      2   26     .7 
 1      3   27     .8 
 2      1   28     .5 
 2      2   23      . 
 2      3   24     .5 
 3      1   25     .3 
 3      2   26     .7 
 3      3   28     .6 
 3      4    .     .5 
 4      1   20     .4 
 4      2    .     .6 
 4      3   22     .7 
 4      4   23      .
 end
 tsset id time

 /// Set 1
 xtivreg2 y x, fe small
 est store S11
 xtivreg y (x=x), fe small
 est store S12
 xtreg y x, fe
 est store S13 
 areg y x, a(id)
 est store S14

 /// Set 2
 xtivreg2 y x, fe robust small
 est store S21
 areg y x, a(id) robust
 est store S22

 /// Set 3
 xtivreg2 y x, fe bw(2) robust small
 est store S31
 xi: newey y x i.id, lag(1) force
 est store S32

 /// Restricted Set 1
 xtivreg2 y x if time<3, fe small
 est store R11
 xtivreg y (x=x) if time<3, fe small
 est store R12
 xtreg y x if time<3, fe 
 est store R13
 areg y x if time<3, a(id)
 est store R14

 /// Restricted Set 2
 xtivreg2 y x if time<3, fe robust small
 est store R21
 areg y x if time<3, a(id) robust
 est store R22

 /// Restricted Set 3
 xtivreg2 y x if time<3, fe bw(2) robust small
 est store R31
 xi: newey y x i.id if time<3, lag(1) force
 est store R32 
}

est table S1*, se stats(N F) title(Fixed Effects)
est table S2* S3*, se stats(N F) title(Fixed Effects + Robust SE)
est table R1*, se stats(N F) title(Fixed Effects & t<3)
est table R2* R3*, se stats(N F) title(Fixed Effects + Robust SE & t<3)
*
*   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