Announcement

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

  • xtlogit and vce cluster

    Hallo,
    Does anyone know how do I run a xtlogit and add cluster command [vce(cluster)] at the same time in order to correct the standard errors?
    Thanks for your help!

  • #2
    Maria:
    unfortunately, as you already know, -xtlogit- does not support -vce(cluster clusterid).
    Hence, you may want to consider:
    -bootstrap- (really time consuming when dataset and replications are large) or -jacknife- options;
    -logit with clustered standard errors-
    Just out of curiosity: why considering clustered standard errors for -xtlogit-?
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Hi Carlo,
      thank you for the quick response. I'm running a binary logistic regression with data that contains different projects implemented in different countries. My dependent variable is the result of these projects. Considering the clustered nature of the data (projects implemented within countries), I want to use a cluster adjusted robust standard errors. However, there could still be unobserved country heterogeneity that affects both the explanatory variables and project outcomes. Therefore, in addition to regular regression
      models, I want to add country fixed effects, which observe the variation within countries.

      I tried the bootstrap option but the ouput (result in stata) is very confusing. For example one independent variable in my regression is a dummy for the region a project is implemented in, but the output does not show any result for this variable:

      xtlogit RDO_binary log_lendingprojectcost projectlength sharelargestsubsector cddapproach lendinginstrumenttypedummy evaltypedummy absta
      > ndeval followup i.sector log_pop_mean free_first enroll_first log_eco_first gdp_first i.regionn, fe vce(bootstrap)
      (running xtlogit on estimation sample)

      Bootstrap replications (50)
      ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
      .................................................. 50

      Conditional fixed-effects logistic regression Number of obs = 2,160
      Group variable: countrycodem~1 Number of groups = 105

      Obs per group:
      min = 2
      avg = 20.6
      max = 78

      Wald chi2(23) = 106.09
      Log likelihood = -1063.5908 Prob > chi2 = 0.0000



      regionn |
      East Asia and Pacific | 0 (omitted)
      Europe and Central Asia | 0 (omitted)
      Latin America and the Caribbean | 0 (omitted)
      Middle East and North Africa | 0 (omitted)
      South Asia | 0 (omitted)
      --------------------------------------------------------------------------------------------------------------


      Another option would be to run logit with clustered standard error and a fixed effect model. But if I run the two different regression I'm not sure what about to do with the result. As I want to interpret result which take into account the variation within and between the countries. You would really help me if you could provide me with any solution. Thank you very much Carlo! Regards, Maria




      Comment


      • #4
        Maria:
        thansk for providing further details.
        As per the nested structure of your data, why not considering -meqrlogit-?
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Hi Carlo, Thanks for your response. I have never worked with meqrlogit and I'm not sure if all my other specifications which I have already done will work with this option. (for example calculation of marginal effects). Furthermore when I try to use the meqrlogit option stata shows me always an error as I did not specified the random-effects correctly. But I only want to control for fixed effects so I do not really understand... Is there any easy option with the meqrlogit to control for variance between and within countries?


          Comment


          • #6
            Hi Carlo, just to explain clearer what my problem with the meqroption and stata was:
            If I type:
            meqrlogit RDO_binary log_lendingprojectcost projectlength sharelargestsubsector cddapproach lendinginstrumenttypedummy evaltypedummy abstandeval followup i.sector log_pop_mean free_first enroll_first log_eco_first gdp_first i.regionn || countrycodemerge1: projectid1, covariance(unstructured)

            Stata shows me: "initial values not feasible"

            Do I have to many variables? Or what is the problem here?

            Comment


            • #7
              Maria:
              it is probably due to the fact that your model is too heavy.
              Anyway, see this old Stata thread on that toic (no matter if it refers to -xtmelogit- the retired brother of -merqrlogit-) http://www.stata.com/statalist/archi.../msg00906.html
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Thank you for your quick response. I will try this option. But one last question. Do you knwo why the xtlogit option with bootstrap does not work? Why do I get no results for the region dummy? I there anything I have to do to make it work? Thank you!

                Comment


                • #9
                  Maria:
                  perhaps you inadvertently type -i.regionn-.
                  However, if your variable is indeed -region-,Stata should have said:
                  Code:
                  variable regionn not found
                  r(111);
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    Thanks but i.regionn is the correct name of my variable. Stata gives me an output the problem is just that this output is confusing with omiited values for the variable region. But you mentioned in your first statement "bootstrap- (really time consuming when dataset and replications are large) or -jacknife- options" so what do you exactly mean with time consuming? Is there anything special I have to do with my data using the bootstrap option? Cause before using it I did not changes anything in my data. This is the complete output: (Is there anything I did wrong in the specification?)

                    . xtlogit RDO_binary log_lendingprojectcost projectlength sharelargestsubsector cddapproach lendinginstrumenttypedummy evaltypedummy absta
                    > ndeval followup i.sector log_pop_mean free_first enroll_first log_eco_first gdp_first i.regionn, fe vce(bootstrap)
                    (running xtlogit on estimation sample)

                    Bootstrap replications (50)
                    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
                    .................................................. 50

                    Conditional fixed-effects logistic regression Number of obs = 2,160
                    Group variable: countrycodem~1 Number of groups = 105

                    Obs per group:
                    min = 2
                    avg = 20.6
                    max = 78

                    Wald chi2(23) = 106.09
                    Log likelihood = -1063.5908 Prob > chi2 = 0.0000

                    (Replications based on 105 clusters in countrycodemerge1)
                    --------------------------------------------------------------------------------------------------------------
                    | Observed Bootstrap Normal-based
                    RDO_binary | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                    ---------------------------------------------+----------------------------------------------------------------
                    log_lendingprojectcost | .0317535 .0513117 0.62 0.536 -.0688155 .1323226
                    projectlength | -.0270301 .0254437 -1.06 0.288 -.0768988 .0228386
                    sharelargestsubsector | -.002448 .0026045 -0.94 0.347 -.0075527 .0026566
                    cddapproach | .010393 .1821903 0.06 0.955 -.3466933 .3674794
                    lendinginstrumenttypedummy | .0831818 .2375616 0.35 0.726 -.3824304 .548794
                    evaltypedummy | -.2997464 .2442455 -1.23 0.220 -.7784589 .1789661
                    abstandeval | -.0771528 .0517002 -1.49 0.136 -.1784834 .0241779
                    followup | .0404732 .1252864 0.32 0.747 -.2050835 .28603
                    |
                    sector |
                    Education | 1.236855 .235537 5.25 0.000 .7752114 1.6985
                    Energy and extractives | .3859522 .2404062 1.61 0.108 -.0852354 .8571397
                    Financial sector | 1.158345 .363173 3.19 0.001 .4465393 1.870151
                    Health | 1.037173 .2461785 4.21 0.000 .5546718 1.519674
                    Social support | .6306545 .230625 2.73 0.006 .1786379 1.082671
                    Industry trade and services | .6918419 .2901713 2.38 0.017 .1231167 1.260567
                    Information and communications technologies | 1.057616 .513153 2.06 0.039 .051855 2.063378
                    Public administration | .5136912 .1652883 3.11 0.002 .1897322 .8376503
                    Transportation | .2682727 .24825 1.08 0.280 -.2182884 .7548338
                    Water sanitation and waste management | .4939492 .2603619 1.90 0.058 -.0163509 1.004249
                    |
                    log_pop_mean | -2.196543 1.502823 -1.46 0.144 -5.142021 .7489349
                    free_first | .0870279 .1093535 0.80 0.426 -.127301 .3013569
                    enroll_first | .0009238 .009047 0.10 0.919 -.0168081 .0186557
                    log_eco_first | -.2078863 .66152 -0.31 0.753 -1.504442 1.088669
                    gdp_first | .00331 .0143579 0.23 0.818 -.024831 .0314509
                    |
                    regionn |
                    East Asia and Pacific | 0 (omitted)
                    Europe and Central Asia | 0 (omitted)
                    Latin America and the Caribbean | 0 (omitted)
                    Middle East and North Africa | 0 (omitted)
                    South Asia | 0 (omitted)
                    --------------------------------------------------------------------------------------------------------------

                    .

                    Comment


                    • #11
                      Maria:
                      -jacknife- is less time consuming that -bootstrap- with -xtlogit-.
                      There's nothing more i can add about that.
                      Perhaps the gsping -bootstrap- you came across is still due to the heaviness of your model.
                      As an aside, please use CODE delimiters for posting what you typed and what Stata gave you back (as recommeded by FAQ). Thanks.
                      Kind regards,
                      Carlo
                      (StataNow 18.5)

                      Comment

                      Working...
                      X