Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • No of obs. in fixed effects models

    Dear Statalisters,

    y is my dependent variable (it takes values 0,1,2,3,4,...,45). xlist includes my independent variables. id is my unique company identifier.

    When I run firm fixed effects using the following command
    xtreg y $xlist, robust i(id) fe

    I get 189,714 observations.

    However, when I run Poisson fixed effects using the following command
    xtpoisson y $xlist, robust i(id) fe

    I get only 189,587 observations and Stata returns this message:
    " note: 1 group (127 obs) dropped because of all zero outcomes "

    Does anyone know why I might get fewer observations in the second regression?? Both regressions are firm fixed effects and the variables are identical. I can't see why the number of obs. is different in the two regressions. I would expect e.g. to get 189,587 obs. in both regressions "because of all zero outcomes" as stata says. I think I'm missing something.

    Thank you all in advance.

  • #2
    In non-linear models (like poisson) fixed-effects (in the sense of within-unit-variance estimators) are different from those in linear models. While in linear models, we usually subtract the unit-means from each observation and run OLS on the resulting data, in non-linear models the fixed effect are conditioned out f the likelihood, which is then maximized. The mathematical details can be re reviewed in any decent statistics book covering longitudinal data or discrete choice, but the main point regarding your question is that conditional likelihood estimators can only use observations for which the outcome(response/endogenous/left-hand/dependent variable ...) varies.

    Best
    Daniel

    Comment


    • #3
      Hi Nikos,

      If you run "xtivreg2 y $xlist, robust i(id) fe" , does the obs. count differ from that of xtreg_fe?

      (xtivreg2 is from ssc btw, you can get it with "ssc install xtivreg2"

      Comment


      • #4
        Daniel, thank you very much for your reply. You are absolutely right.

        Sergio, thanks a lot for replying! I installed xtivreg2 together with ivreg2 and ranktest. This regression

        xtivreg2 y $xlist, robust i(id) fe

        returns 189,714 observations. (same as xtreg_fe)

        Is this helpful in relation to my question?

        Comment


        • #5
          Indeed. The difference may be caused by either the problem that Daniel explained, or also partly due to individuals only present once in the regression ("singletons").

          xtivreg2 drops singletons from the regression, with a message on the first line such as "
          Warning - singleton groups detected. 40 observation(s) not used.". That would tell you if singletons are relevant in explaining your difference. Note however that xtivreg2 will still report 189,714 observations in the table (!), but it's the first line what you care about in this case.

          Cheers

          Comment


          • #6
            Hi Sergio,

            No, I don't get this message. So, I have the problem explained by Daniel.

            Thank you very much for your help, and for explaining this in detail.

            Comment

            Working...
            X