Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: RE: st: RE: Problem with xi and xtivreg2 |

Date |
Mon, 20 Jun 2011 18:58:34 +0100 |

Juan, The key part of the error message looks like > Warning - singleton groups detected. 1584207 observation(s) not used. My guess is that these are all or virtually all the observations in your dataset. After they all get thrown out, -xtivreg2- gives the misleading error message that too few variables are specified, but actually there are too few observations. Singleton groups are panels where there is one observation. In FE or FD estimation, -xtivreg2- throws these out - you can't have any within variation in a group if you have only one observation for that gorup. What happens when you simply omit the year dummies? It's possible that they have nothing to do with the problem. --Mark > -----Original Message----- > From: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of > Juan Pablo Cote Baron > Sent: Monday, June 20, 2011 6:00 PM > To: statalist@hsphsun2.harvard.edu > Subject: Re: RE: st: RE: Problem with xi and xtivreg2 > > Hi Mark, > > Thank you very much for your help. Unfortunately, the problem > persists. This is the result when I don't instrument y: > > . xtivreg2 x w _Iyear_2004 _Iyear_2005 y, fe robust > Warning - singleton groups detected. 1584207 observation(s) not used. > too few variables specified > r(102); > > The same happens if I include the instrument z as a regressor: > > . xtivreg2 x w _Iyear_2004 _Iyear_2005 y z, fe robust > Warning - singleton groups detected. 1584207 observation(s) not used. > too few variables specified > r(102); > > The error message appears even when I just run: > > xtivreg2 x _Iyear_2004 _Iyear_2005, fe robust > > (with no more regressors than the year dummies). I have also > tried similar regressions with other independent variables > but the outcome has always been the same. It is really strange to me. > > Thanks as always, > > Juan. > > > ----- Mensaje original ----- > De: "Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk> > Fecha: Domingo, 19 de Junio de 2011, 4:10 pm > Asunto: RE: st: RE: Problem with xi and xtivreg2 > A: statalist@hsphsun2.harvard.edu > > > Juan, > > > > > -----Original Message----- > > > From: owner-statalist@hsphsun2.harvard.edu > > > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of > > > Juan Pablo Cote Baron > > > Sent: 19 June 2011 19:43 > > > To: statalist@hsphsun2.harvard.edu > > > Subject: Re: st: RE: Problem with xi and xtivreg2 > > > > > > Hi Mark, > > > > > > Thanks for your response. I tried what you suggested but it > > > didn't work. Having created the year dummies first, I typed: > > > > > > xtivreg2 x w _Iyear_2004 _Iyear_2005 (y = z), fe robust > > > > > > but I keep getting the same error message. I wonder what the > > > problem could be. > > > > I wonder if it's a collinearity problem involving your > other variables > > and/or instruments. > > > > Maybe try > > > > xtivreg2 x w _Iyear_2004 _Iyear_2005 y, fe robust > > > > i.e., don't instrument y. > > > > And also try > > > > xtivreg2 x w _Iyear_2004 _Iyear_2005 y z, fe robust > > > > i.e., treat z as a regressor instead of an instrument. It > > may not make > > any economic sense, but it might help trace the problem. > > > > And can you also show us the actual output? > > > > --Mark > > > > > > > > Thanks again, > > > > > > Juan. > > > > > > > > > >----- Mensaje original ----- > > > >2011/6/19 Schaffer, Mark E <M.E.Schaffer@hw.ac.uk> > > > > > > >Juan, > > > > > > >> -----Original Message----- > > > >> From: owner-statalist@hsphsun2.harvard.edu > > > >> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of > > > Juan Pablo > > > >> Cote Baron > > > >> Sent: 19 June 2011 00:40 > > > >> To: statalist@hsphsun2.harvard.edu > > > >> Subject: st: Problem with xi and xtivreg2 > > > >> > > > >> Dear statalist users, > > > >> > > > >> I have a problem when using the xi: xtivreg2... combination. > > > >> I need to regress "x" on "w", an instrumented variable "y" > > > >> and on year dummies. I typed this: > > > >> > > > >> xi: xtivreg2 x w i.year (y = z), fe robust > > > >> > > > >> but it doesn't work. Instead, I get the error message "too > > few > > > >> variables specified r(102)", but I don't know what the > > > problem could > > > >> be (the syntax works when I use it with another > > > cathegorical variable > > > >> different from year) . > > > > > > >What happens if you first use -xi- on its own to create the > > year > > > >dummies, and then use the year dummies in the estimation > > > without -xi-? > > > > > > >--Mark > > > > > > >> > > > >> Thanks in advance, > > > >> > > > >> Juan Pablo Cote. > > > >> > > > >> > > > > > > > > > > > > -- > > Heriot-Watt University is a Scottish charity > > registered under charity number SC000278. > > > > > > * > > * For searches and help try: > > * http://www.stata.com/help.cgi?search > > * http://www.stata.com/support/statalist/faq > > * http://www.ats.ucla.edu/stat/stata/ > > -- Heriot-Watt University is a Scottish charity registered under charity number SC000278. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: RE: RE: st: RE: Problem with xi and xtivreg2***From:*Juan Pablo Cote Baron <jp.cote63@uniandes.edu.co>

**References**:**Re: st: RE: Problem with xi and xtivreg2***From:*Juan Pablo Cote Baron <jp.cote63@uniandes.edu.co>

**RE: st: RE: Problem with xi and xtivreg2***From:*"Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk>

**Re: RE: st: RE: Problem with xi and xtivreg2***From:*Juan Pablo Cote Baron <jp.cote63@uniandes.edu.co>

- Prev by Date:
**RE: st: Programming question** - Next by Date:
**st: RE: Ousout problem psmatch2** - Previous by thread:
**Re: RE: st: RE: Problem with xi and xtivreg2** - Next by thread:
**Re: RE: RE: st: RE: Problem with xi and xtivreg2** - Index(es):