I am running a fixed-effect model using xtivreg2 in stata, where my panel variable is firms and my time variable is years. It is survey data that tracks firms over year through different iterations of the survey. Let me begin by saying that in my original dataset, the panel variable idpanel is always repeated at least once. That is, there are no firms which are observed for only one year. There are also no missing idpanel. The command is:
xtivreg2 depvar var1 var2 (var3= instrument), fe ro
What happens is that xtivreg2 gives me a warning:
Warning - singleton groups detected. 4552 observation(s) not used.
Such that the number of observations for the first-stage regression is 17489, and the same for the second stage. Therefore this command is dropping observations during the first-stage regression part. So I proceeded to replicate the first stage regression using:
xtreg var3 var1 var2 instrument, fe ro
And the number of observations, 26,370, is significantly higher than its first-stage regression counterpart in xtivreg2. The coefficients are also different.
After some exploring, I've noticed that the reason is because in the first-stage regression of xtivreg2 the command drops observations whenever there is a missing in any of the covariates or the dependent variables. Afterwards it recalculates the panel, and of course it finds now some firms for which the observation has been dropped in a given year because of the aforementioned missings, but not in other years, hence it has become a singleton.
My question therefore is: why. From a theoretical point of view, a replication of the first-stage regression using xtreg should present the same results (coefficients) as the first-stage calculated within xtivreg2, no?. In my case it doesn't. Thank you all in advance.
Related Posts with fixed effect model in xtivreg2 and singletons
Appending symmetric files diagonallyDear All, I have many symmetric and square datasets in separate Stata files. The dimensions of the…
IVprobit (opposit signs of first step regression to a simple regression)Hi All Code: ivprobit Y (X=religioniv) CONTROLS i.isic i.ccode, vce(robust) When I use ivprobit mo…
Missing variables when downloading with wbopendataHi all, I am trying to re-download the complete WDI dataset, so as to have data from more recent yea…
Optimal lag for xtscc command (Regression with Driscoll-Kraay standard errors)I have to estimate a panel data model( 19 country and and 37 year) with xtscc command, i want to kno…
Identifying duplicates within groups based on two variables in reverse orderDear all, I matched 2 datasets using the joinby command on the variable "project_id". The result is…
Subscribe to:
Post Comments (Atom)
0 Response to fixed effect model in xtivreg2 and singletons
Post a Comment