Announcement

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

  • clogit vs. xtlogit, fe

    Is there a difference between clogit and xtlogit, fe? It appears to me they both do conditional logistic regression with fixed effects.

  • #2


    At the command line in Stata, type
    Code:
    viewsource xtlogit.ado
    and then scroll down until you come to
    Code:
    `vv' clogit `dep' `ind' if `touse' [`weight'`exp'] , /*
                            */ group(`ivar') `options' `offarg' `log' `from2' /*
                            */ nodisplay `collopt'
    So, to answer your question: apparently not.

    Comment


    • #3
      The documentation for clogit in the Stata Base Reference Manual PDF included with Stata and accessible from Stata's Help menu has more to say about this. In particular

      Biostatisticians and epidemiologists call these models conditional logistic regression for matched case–control groups ... Economists and other social scientists typically call the model fit by clogit a fixed-effects logit model for panel data ...
      and it goes on to present data example described as an economist would, and then described as a biostatistician would.

      Comment


      • #4
        clogit supports the svy: prefix as well as other prefix commands that xtlogit can't handle. There may be other differences in the options and post-estimation commands that are supported. (But if somebdody wanted to, I bet it would be possible to modify the code for xtlogit to get rid of such differences.)

        Overall it seems like clogit can do more, but xtlogit, fe may be perfectly adequate for most needs.

        Similarly, many random effects models can be estimated with either XT or me commands; but, if the data are svyset, you will want to use me commands.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          To further clarify, any differences between clogit and xtlogit, fe appear to represent programming decisions, e.g. xtlogit, fe could have supported the svy: prefix but other xt commands don't so somebody decided xtlogit, fe wouldn't either.

          Incidentally I am not sure why xt commands do not support the svy: prefix. Is svy: statistically inappropriate with xt, or has nobody gotten around to programming it? If you need svy: there is often an me command you can use instead.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            One difference is that clogit supports clustered and bootstrap-clustered SEs, while xtlogit does not. That seems strange if xtlogit calls clogit. Does anyone know why the two commands don't support the same types of SEs?

            Comment


            • #7
              I'm a little confused; the following is from the help file for xtlogit:
              SE/Robust
              vce(vcetype) vcetype may be oim, robust, cluster
              clustvar, bootstrap, or jackknife
              while the following is from the help for -clogit-
              SE/Robust
              vce(vcetype) vcetype may be oim, robust, cluster
              clustvar, opg, bootstrap, or jackknife
              the only difference I see is the "opg" is included for -clogit- but not for -xtlogit-

              Comment


              • #8
                I don't think the the helpfile for xtlogit is correct. If you try to cluster standard errors, you get an error message. Try this:
                webuse union, clear
                xtset idcode
                xtlogit union age grade i.not_smsa south##c.year, fe vce(cluster idcode)
                vcetype 'cluster' not allowed

                Comment


                • #9
                  Paul, which version/release of Stata are you running? We assume it is 15.1 (fully updated) if you do not say otherwise. Older releases did indeed not allow clustered standard errors for xtlogit (presumably because they just forgot to implement them). I cannot readily remember when StataCorp changed this.

                  Best
                  Daniel

                  Comment


                  • #10
                    My post in #9 is misleading.

                    Rich quotes the help for the random-effects model while Paul want the fixed-effects estimator. I am surprised to find that in Stata 15, still xtlogt, fe still does not allow clustered standard errors; this is documented.

                    I have no clue why this is the case. Given that StataCorp added clustered standard errors for the random-effects model at some point between Stata 12 and 15, it seems odd to not do the same for the fixed-effects estimator. I suggest contacting tech-support about this.

                    Best
                    Daniel

                    Comment


                    • #11
                      Dear all,

                      Originally posted by paulvonhippel View Post
                      One difference is that clogit supports clustered and bootstrap-clustered SEs, while xtlogit does not. That seems strange if xtlogit calls clogit. Does anyone know why the two commands don't support the same types of SEs?
                      has anyone found a reliable answer to this question?
                      I would like to use the vce(cluster) option to take into account serial correlation in my panel data (Stata 15.1). I am considering to use clogit instead of xtlogit, fe (since the latter does not offer the vce(cluster) option).

                      This brings me to another question: Is serial correlation even a problem in fixed effects analysis of binary dependent variables? And is the vce(cluster) option in the clogit command a solution to this problem?

                      I know this question has been around in statalist for years already, but I was unable to find a definitive answer to my question.

                      Best,
                      Antonino

                      Comment


                      • #12
                        I believe the reason xtlogit, fe does not allow clustering because if you have to cluster at the panel identifier level then you are admitting that the model is wrong, and the FE logit estimator has no known robustness properties. In fact, the estimator works very poorly with serial correlation in the idiosyncratic errors. This is much different than the linear model estimated by FE, which is still consistency in the presence of any kind of heteroskedasticity or serial correlation. The FE logit estimator is not at all robust. This is why I often recommend the correlated random effects probit, which, when estimated using pooled probit, is fully robust -- unlike FE logit. I have slides about this in various places on the internet. But the basic idea follows, where the z variables don't change over time and the x variables do.

                        Code:
                        egen x1bar = mean(x1), by(id)
                        egen x2bar = mean(x2), by(id)
                        ...
                        egen xKbar = mean(xK), by(id)
                        
                        probit y x1 ... xK x1bar ... xKbar z1 ... zJ i.year, vce(cluster id)
                        margins, dydx(*)
                        If you're using clogit for panel data that does not help in the sense that you still have the same inconsistent estimators. If you're willing to live with that then it does "solve" the problem.

                        Comment


                        • #13
                          Hi Jeff,

                          Thank you for your helpful explanation.
                          I have two follow-up questions:

                          1) Is there a way to test for heteroskedasticity/serial correlation in the idiosyncratic errors when you have a binary dependent variable? I've heard of the xtserial command, but it seems to work with linear panel data models only.

                          2) I assume the inconsistency problem also arises when estimating a correlated random effects/hybrid model via GLMM and applying a logit link (such as in the user-written xthybrid command)?

                          Best,
                          Antonino

                          Comment


                          • #14
                            Hi! Dr Jeff Wooldridge!

                            Thank you for your advice on Correlated Random Effects (CRE) Probit.

                            I would like to ask, how may I add the mean of dummy/Binary variables in CRE Probit? Is it possible to estimate a CRE Probit with binary explanatory variables?

                            regards,



                            Comment


                            • #15
                              Originally posted by Jeff Wooldridge View Post
                              This is much different than the linear model estimated by FE, which is still consistency in the presence of any kind of heteroskedasticity or serial correlation.
                              If this is true, then why aren't linear probability models applied instead?

                              Comment

                              Working...
                              X