Announcement

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

  • clogit vs. reg____i.id i.time

    Dear Statalist Members,

    I just red an interesting paper which analyses the effect of gdp on the likelihood of democratization.
    The dataset is a cross country dataset covering years from 1800-2000. The dependent variable y is a dichotomous measure of democracy, thus a binary response model can be applied. In his paper, the author writes that a conditional logit FE model is applied.

    In his dofile, however, he writes the following:
    reg y x i.country i.year, rob cluster(id)
    Obviously he includes country and year dummies, but he uses the "reg" command which, I thought, is for cross-sectional analysis and not for panel data.

    Is his command the same as writing: clogit y x i.year, group(country) vce(cluster country) ?

    I tried to estimate both methods, but when I want to run the clogit command, Stata makes a lot of iterations that are all indicated as "not concave". Thus, I guess the clogit command does not work.

    Any help is highly appreciated since I need this kind of estimation for my master thesis.

    Best,
    Lisa

  • #2
    They can't be exactly the same because one uses regress and the other uses logit. The author is using a linear probabilty model, which I personally don't like but some economists and others do. What is id, and why do they cluster on it when you don't?
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

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

    Comment


    • #3
      Thanks for your response.
      Clustering is on the country level as well.
      I would prefer the logit model, but the implementation does not seem to work as convergence is not achieved when I limit the iterations.
      Do you have any suggestions how to fit the model into clogit?

      Comment


      • #4
        It still seems odd to me that they use id as the cluster variable and you use country. In any event, I would probably try to simplify things, e.g. Drop the cluster options, maybe drop x or i.year, see if it worked, and if so then make it more complicated. Maybe they used reg because they encountered the same problems you did.
        -------------------------------------------
        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
          Thank you, Richard. I will try this!
          Sorry, I made a typo with the regression, they also use country as the cluster variable.

          Comment


          • #6
            Incidentally, you can use reg for fixed effects models with panel data. For example,

            Code:
            webuse nlswork,clear
            keep if idcode <=10
            xtreg ln_w age, fe
            reg ln_w age i.idcode
            test age
            I am not sure why you would want to. But, the authors are using now outdated syntax -- maybe the xt commands weren't around when they did their analysis, or maybe they didn't know about them.

            I think you could do something like

            Code:
            xtset country year
            xtreg y x i.year, rob cluster(country) fe
            and you could replicate their results.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

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

            Comment


            • #7
              Incidentally I would probably xtset the data and use xtlogit instead of clogit. It shouldn't matter in this specific case (indeed, I think clogit calls xtlogit) but it will make life easier if you want to use commands like xtreg or other xt 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


              • #8
                This is a good idea, I will try this - Thanks a lot for your help!

                Comment


                • #9
                  Hope it works. Incidentally, Statalist etiquette is to use real names. I don't think we have ever banned somebody who refused to do so, but people who do use real names are probably more likely to get help. I also think there can be some professional benefit in that people can become more aware of you and your work. If you want to change your user id you can write to the forum administrators; or, you can keep your id but attach a signature, like I do with my messages.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  StataNow Version: 19.5 MP (2 processor)

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

                  Comment


                  • #10
                    Incidentally, if I am reading the docs right, once you xtset then vce(robust) and vce(cluster panelvar) do the same thing. So, I think you can replicate the original analysis via

                    Code:
                     
                     xtset country year xtreg y x i.year, vce(robust) fe
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    StataNow Version: 19.5 MP (2 processor)

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

                    Comment

                    Working...
                    X