Announcement

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

  • logit with fixed effect, cross sectional data

    hello, I need your help. I want to estimate a logit on cross-sectional data. in addition, I also want to control the effects of countries, industries and years.

    I would like to know how to have similar results
    Country FE YES YES YES YES
    Industry FE YES YES YES YES
    Year FE YES YES YES YES
    Cluster country YES YES YES YES
    Method LOGIT LOGIT LOGIT LOGIT
    Your suggestions are very much appreciated.

    Thanks



  • #2
    Have you tried
    Code:
    xtset country
    xtlogit outcome_var i.industry i.year, fe vce(cluster country)

    Comment


    • #3
      Thank you so much.

      I have tried the command and this is what i get : '' vcetype 'cluster' not allowed ''
      r(198);

      Comment


      • #4
        When i replace xtlogit with logit i find this :

        Iteration 0: log pseudolikelihood = -2452.6923
        Iteration 1: log pseudolikelihood = -2188.2405
        Iteration 2: log pseudolikelihood = -2187.3913
        Iteration 3: log pseudolikelihood = -2187.3912

        Logistic regression Number of obs = 3573
        Wald chi2(20) = 1725.79
        Prob > chi2 = 0.0000
        Log pseudolikelihood = -2187.3912 Pseudo R2 = 0.1082

        (Std. Err. adjusted for 24 clusters in codekpays)

        Robust
        self_rationing Coef. Std. Err. z P>z [95% Conf. Interval]
        corrupt .2165579 .1106258 1.96 0.050 -.0002648 .4333805
        overdraft_facility -.5900607 .1376564 -4.29 0.000 -.8598623 -.320259
        bank_account .2090347 .1370699 1.53 0.127 -.0596173 .4776867
        access_finance 1.160006 .1646246 7.05 0.000 .8373479 1.482664
        credit_commercial .0138696 .0031138 4.45 0.000 .0077666 .0199726
        fonds_propre .0016878 .0017423 0.97 0.333 -.001727 .0051027
        log_ventes -.0396352 .0223901 -1.77 0.077 -.0835189 .0042485
        moyenne_en .4669297 .156668 2.98 0.003 .1598661 .7739933
        petite_en .6708125 .1898767 3.53 0.000 .298661 1.042964
        female_manager .0463935 .1250372 0.37 0.711 -.1986748 .2914618
        experience_manager -.0074564 .0054827 -1.36 0.174 -.0182023 .0032894
        1.manufacturing .2766 .0892249 3.10 0.002 .1017223 .4514777
        a14ya
        2011 .8276756 .4104214 2.02 0.044 .0232645 1.632087
        2012 .306179 .5162335 0.59 0.553 -.7056201 1.317978
        2013 .4692419 .4176778 1.12 0.261 -.3493915 1.287875
        2014 .5327559 .4047374 1.32 0.188 -.2605147 1.326027
        2015 .6714686 .391274 1.72 0.086 -.0954143 1.438352
        2016 .6765817 .3626455 1.87 0.062 -.0341905 1.387354
        2017 .5783316 .3743454 1.54 0.122 -.1553719 1.312035
        2018 .8387466 .6286813 1.33 0.182 -.3934461 2.070939
        _cons -1.031423 .4335584 -2.38 0.017 -1.881182 -.1816645

        Comment


        • #5
          If you want to get feedback on some regression results, always show exactly what you typed at Stata, and exactly what Stata returned.

          You can also do what you want by manually including the fixed effects with factor variable notation, i.year i.industry i.country.

          For some reason unbeknown to me, - xtlogit, fe- indeed does not accept the option for cluster-robust variance. You can get cluster robust variance by bootstrap. Or by switching to -logit- with factor variable notation as in the previous sentence.

          Comment


          • #6
            It looks like you have firm-level data. Is that correct? With N > 3,000 and 24 countries, you should just put in the i.country into the logit command. But, as Joro says, the quality of our responses generally increases with more information. You didn't even show the actually state command.

            There's a good reason xtlogit, fe does not support clustering, but Stata is uneven in this. It is known that the so-called fixed effects logit estimator is inconsistent in the presence of serial correlation (unlike, say, FE Poisson or FE OLS). So needing to cluster is admitting your estimators are inconsistent. However, Stata allows this with xtprobit, re and xttobit, re and one is making the same admission. I think it should be allowed with the understanding that needing to cluster means you're not using the best estimation method for a binary response.

            Comment


            • #7
              What you are saying is very interesting, Professor Wooldridge, I either have forgotten the fact that -xtlogit- is inconsistent with autocorrelation, or I have never known this fact...

              But this is very bad news, because we are out of options if we want to "properly account" for the binary dependent variable's nature. There is no fixed effects probit, and the fixed effects logit has this very undesirable lack of robustness to something that is almost guaranteed to exist in panel data.

              Then the question is what do we do if we want to do something that "accounts properly" for the binary nature of the dependent variable, and yet we want our procedure to be robust to correlation within panels...

              Is just going with the -xtpoisson- a reasonable alternative option here? Nothing in a textbook Poisson process says that in our sample we have to observe values larger than 1. Can we just go with the -xtpoisson- when we have a binary dependent variable?



              Originally posted by Jeff Wooldridge View Post
              It looks like you have firm-level data. Is that correct? With N > 3,000 and 24 countries, you should just put in the i.country into the logit command. But, as Joro says, the quality of our responses generally increases with more information. You didn't even show the actually state command.

              There's a good reason xtlogit, fe does not support clustering, but Stata is uneven in this. It is known that the so-called fixed effects logit estimator is inconsistent in the presence of serial correlation (unlike, say, FE Poisson or FE OLS). So needing to cluster is admitting your estimators are inconsistent. However, Stata allows this with xtprobit, re and xttobit, re and one is making the same admission. I think it should be allowed with the understanding that needing to cluster means you're not using the best estimation method for a binary response.

              Comment


              • #8
                Originally posted by Jeff Wooldridge View Post
                It looks like you have firm-level data. Is that correct?
                Indeed, this is the data collected at the firm level.

                Comment


                • #9
                  Originally posted by Joro Kolev View Post
                  If you want to get feedback on some regression results, always show exactly what you typed at Stata, and exactly what Stata returned.
                  xi: logit self_rationing corrupt overdraft_facility bank_account access_finance credit_commercial fonds_propre log_ventes moyenne_en petite_en female_manager experience_manager i.manufacturing i.year , vce(cluster country)
                  Last edited by Abdramane Cherif; 25 Apr 2021, 05:59.

                  Comment


                  • #10

                    My database has this structure:

                    * Example generated by -dataex-. To install: ssc install dataex

                    input str23 Country byte(access_finance corrupt overdraft_facility bank_account manufacturing)
                    "Rwanda" 0 0 1 1 1
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 1 0 . 1 0
                    "Rwanda" 0 0 1 1 1
                    "Rwanda" 0 1 . 1 0
                    "Rwanda" 1 0 0 0 0
                    "Rwanda" 1 0 1 1 0
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 0 1 . . 0
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 0 0 0
                    "Rwanda" 0 1 0 1 0
                    "Rwanda" 0 0 0 1 1
                    "Rwanda" 0 0 0 0 0
                    "Rwanda" 1 0 0 1 0
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 1 0 0 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 1 1 1 1 1
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 1 0 1 1 0
                    "Rwanda" 1 0 1 1 0
                    "Rwanda" 1 0 1 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 1 0 0
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 1 0 1 1 1
                    "Rwanda" 1 0 0 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 1 0 0
                    "Rwanda" 0 0 0 1 1
                    "Rwanda" 0 0 1 0 0
                    "Rwanda" 0 0 1 0 0
                    "Rwanda" 1 0 1 0 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 0 1 0
                    "Rwanda" 0 0 1 0 0
                    "Rwanda" 0 0 1 1 0
                    "Rwanda" 0 0 0 1 0
                    "Togo" 1 1 0 1 0
                    "Togo" 0 0 1 1 0
                    "Togo" 1 0 1 0 0
                    "Togo" 0 0 0 0 0
                    "Togo" 1 0 0 0 0
                    "Togo" 0 0 1 0 0
                    "Togo" 1 0 0 1 0
                    "Togo" 0 1 1 1 0
                    "Togo" 1 0 1 1 0
                    "Togo" 0 0 1 1 0
                    "Togo" 1 0 0 0 0
                    "Senegal" 0 0 1 0 0
                    "Senegal" 0 0 0 1 0
                    "Senegal" 0 0 0 1 0
                    "Senegal" 0 0 0 1 0
                    "Senegal" 0 0 . 0 0
                    "Senegal" 1 0 1 0 0
                    "Senegal" 1 0 1 0 0
                    "Senegal" 0 0 1 0 0
                    "Niger" 0 0 0 0 0
                    "Niger" . 0 0 0 1
                    "Niger" 0 0 0 1 0
                    "Niger" 0 0 0 0 0
                    "Niger" 0 0 0 0 0
                    "Niger" 0 0 0 1 0
                    "Niger" 0 0 0 1 0
                    "Niger" 0 0 1 1 0
                    "Niger" 1 1 1 1 0
                    "Niger" 0 0 1 1 0
                    "Niger" 0 0 1 1 0
                    "Congo" 0 0 0 1 0
                    "Congo" 0 0 1 0 0
                    "Congo" 0 0 1 0 0
                    "Congo" 1 1 0 0 0
                    "Congo" 1 0 0 0 0
                    "Congo" 0 0 0 1 1
                    "Congo" 0 0 . . 0
                    "Congo" 0 0 0 0 0
                    "Congo" 0 0 1 1 1
                    "Congo" 1 0 0 1 0
                    "Tchad" 0 . 0 0 1
                    "Tchad" 1 0 0 . 0
                    "Tchad" 0 0 1 1 1
                    "Tchad" 0 0 0 0 0
                    "Tchad" 0 0 1 0 0
                    "Tchad" 1 1 1 1 0
                    "Tchad" 1 0 0 1 0
                    "Tchad" 0 0 0 1 1
                    "Gambia" 0 0 1 1 0
                    "Gambia" 0 0 0 0 0
                    "Gambia" 0 0 0 1 0
                    "Gambia" 0 1 1 1 0
                    "Gambia" 1 1 1 1 0
                    "Gambia" 0 1 1 1 1
                    "Keyna" 1 1 1 1 0
                    "Keyna" 1 1 0 1 0
                    end
                    [/CODE]

                    Comment


                    • #11
                      My database has this structure:

                      Code:
                       * Example generated by -dataex-. To install: ssc install dataex
                      
                      input str23 Country byte(access_finance corrupt overdraft_facility bank_account manufacturing)
                      "Rwanda" 0 0 1 1 1
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 1 0 . 1 0
                      "Rwanda" 0 0 1 1 1
                      "Rwanda" 0 1 . 1 0
                      "Rwanda" 1 0 0 0 0
                      "Rwanda" 1 0 1 1 0
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 0 1 . . 0
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 0 0 0
                      "Rwanda" 0 1 0 1 0
                      "Rwanda" 0 0 0 1 1
                      "Rwanda" 0 0 0 0 0
                      "Rwanda" 1 0 0 1 0
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 1 0 0 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 1 1 1 1 1
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 1 0 1 1 0
                      "Rwanda" 1 0 1 1 0
                      "Rwanda" 1 0 1 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 1 0 0
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 1 0 1 1 1
                      "Rwanda" 1 0 0 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 1 0 0
                      "Rwanda" 0 0 0 1 1
                      "Rwanda" 0 0 1 0 0
                      "Rwanda" 0 0 1 0 0
                      "Rwanda" 1 0 1 0 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 0 1 0
                      "Rwanda" 0 0 1 0 0
                      "Rwanda" 0 0 1 1 0
                      "Rwanda" 0 0 0 1 0
                      "Togo" 1 1 0 1 0
                      "Togo" 0 0 1 1 0
                      "Togo" 1 0 1 0 0
                      "Togo" 0 0 0 0 0
                      "Togo" 1 0 0 0 0
                      "Togo" 0 0 1 0 0
                      "Togo" 1 0 0 1 0
                      "Togo" 0 1 1 1 0
                      "Togo" 1 0 1 1 0
                      "Togo" 0 0 1 1 0
                      "Togo" 1 0 0 0 0
                      "Senegal" 0 0 1 0 0
                      "Senegal" 0 0 0 1 0
                      "Senegal" 0 0 0 1 0
                      "Senegal" 0 0 0 1 0
                      "Senegal" 0 0 . 0 0
                      "Senegal" 1 0 1 0 0
                      "Senegal" 1 0 1 0 0
                      "Senegal" 0 0 1 0 0
                      "Niger" 0 0 0 0 0
                      "Niger" . 0 0 0 1
                      "Niger" 0 0 0 1 0
                      "Niger" 0 0 0 0 0
                      "Niger" 0 0 0 0 0
                      "Niger" 0 0 0 1 0
                      "Niger" 0 0 0 1 0
                      "Niger" 0 0 1 1 0
                      "Niger" 1 1 1 1 0
                      "Niger" 0 0 1 1 0
                      "Niger" 0 0 1 1 0
                      "Congo" 0 0 0 1 0
                      "Congo" 0 0 1 0 0
                      "Congo" 0 0 1 0 0
                      "Congo" 1 1 0 0 0
                      "Congo" 1 0 0 0 0
                      "Congo" 0 0 0 1 1
                      "Congo" 0 0 . . 0
                      "Congo" 0 0 0 0 0
                      "Congo" 0 0 1 1 1
                      "Congo" 1 0 0 1 0
                      "Tchad" 0 . 0 0 1
                      "Tchad" 1 0 0 . 0
                      "Tchad" 0 0 1 1 1
                      "Tchad" 0 0 0 0 0
                      "Tchad" 0 0 1 0 0
                      "Tchad" 1 1 1 1 0
                      "Tchad" 1 0 0 1 0
                      "Tchad" 0 0 0 1 1
                      "Gambia" 0 0 1 1 0
                      "Gambia" 0 0 0 0 0
                      "Gambia" 0 0 0 1 0
                      "Gambia" 0 1 1 1 0
                      "Gambia" 1 1 1 1 0
                      "Gambia" 0 1 1 1 1
                      "Keyna" 1 1 1 1 0
                      "Keyna" 1 1 0 1 0
                      end
                      Last edited by Abdramane Cherif; 25 Apr 2021, 06:41.

                      Comment


                      • #12
                        Why did you originally xtset your data at the country level? Shouldn't it have been at the firm level? You have a panel of firms, right?

                        You could use the correlated random effects approach for unbalanced "panels" that I discuss in my 2019 Journal of Econometrics paper. You can include industry and country dummies if you want. This is the answer to Joro's comment on how we don't have anything that can be done. In my view, for this kind of data structure, the CRE probit is our best option.

                        Comment


                        • #13
                          Originally posted by Jeff Wooldridge View Post
                          Why did you originally xtset your data at the country level? Shouldn't it have been at the firm level? You have a panel of firms, right?

                          You could use the correlated random effects approach for unbalanced "panels" that I discuss in my 2019 Journal of Econometrics paper. You can include industry and country dummies if you want. This is the answer to Joro's comment on how we don't have anything that can be done. In my view, for this kind of data structure, the CRE probit is our best option.
                          Thank you
                          I don't know if it's a panel, since I don't have the time dimension. I rather think that it is a cross sectional data, and I have merged several data collections on firms from several countries.
                          moreover, when I integrate the country and industry effects I have a problem of multicolinearity.

                          Comment

                          Working...
                          X