Announcement

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

  • Problem with margins in a survey.

    Dear Statalists,

    I am working with survey database. I have run the next logit regression for a subsample of my data, where the dependent variable (fin11) is a binary one. Furthermore, i am including fixed effects at industry level (i.isic).

    Code:
    svyset, clear
    svyset idstd [pweight=wt], strata(strata) singleunit(scaled)
    svy, subpop(if loan_duration<=4 & k8==100): logit fin11 i.n_outcome lcar1 lnemployees i.ownership i.k9 ln_dlabproduc_2 k7 k21  k3a i.isic
    This is the ouput of the regression:

    Code:
    note: 11b.isic != 0 predicts success perfectly
          11b.isic dropped and 1 obs not used
    note: 12.isic != 0 predicts failure perfectly
          12.isic dropped and 1 obs not used
    note: 65.isic != 0 predicts failure perfectly
          65.isic dropped and 2 obs not used
    note: 71.isic != 0 predicts success perfectly
          71.isic dropped and 1 obs not used
    note: 93.isic != 0 predicts success perfectly
          93.isic dropped and 1 obs not used
    note: 74.isic omitted because of collinearity
    
    Survey: Logistic regression
    
    Number of strata   =     1,023                  Number of obs     =    122,771
    Number of PSUs     =   122,771                  Population size   =  7,992,600
                                                    Subpop. no. obs   =     27,735
                                                    Subpop. size      =  1,453,296
                                                    Design df         =    121,748
                                                    F(  46, 121703)   =       3.59
                                                    Prob > F          =     0.0000
    
    ---------------------------------------------------------------------------------------------------------
                                            |             Linearized
                                      fin11 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------------------------------+----------------------------------------------------------------
                                1.n_outcome |  -.3410065   .1234849    -2.76   0.006    -.5830349   -.0989782
                                      lcar1 |    .097119   .1033377     0.94   0.347    -.1054212    .2996592
                                lnemployees |   .2238808   .0475924     4.70   0.000     .1306004    .3171612
                                            |
                                  ownership |
                                   Foreign  |   .3300358   .1857271     1.78   0.076    -.0339862    .6940577
                                            |
                                         k9 |
    State-owned banks or government agency  |   .4543845    .174829     2.60   0.009     .1117225    .7970466
           Non-bank financial institutions  |  -.1643362   .2303354    -0.71   0.476    -.6157898    .2871173
                                     Other  |  -1.502558     .30923    -4.86   0.000    -2.108644   -.8964726
                                            |
                            ln_dlabproduc_2 |   .0548861   .0094919     5.78   0.000     .0362822    .0734899
                                         k7 |  -.2306878   .1387156    -1.66   0.096     -.502568    .0411924
                                        k21 |   .2545136    .117209     2.17   0.030      .024786    .4842413
                                        k3a |  -.5454588   .1690183    -3.23   0.001     -.876732   -.2141857
                                            |
                                       isic |
                                        11  |          0  (empty)
                                        12  |          0  (empty)
                                        15  |   .5761103   .8422641     0.68   0.494    -1.074713    2.226934
                                        16  |   .5525625   .9970459     0.55   0.579    -1.401631    2.506756
                                        17  |   .2459134   .8569859     0.29   0.774    -1.433765    1.925592
                                        18  |   .4972503   .8647682     0.58   0.565    -1.197681    2.192182
                                        19  |   .6810023   .9549176     0.71   0.476     -1.19062    2.552625
                                        20  |   .5277384   .9299466     0.57   0.570    -1.294942    2.350418
                                        21  |  -.2068407   .9720362    -0.21   0.831    -2.112016    1.698334
                                        22  |   .1737072    .925783     0.19   0.851    -1.640812    1.988227
                                        23  |   1.525126   1.239943     1.23   0.219    -.9051413    3.955392
                                        24  |   .3956102   .8714038     0.45   0.650    -1.312327    2.103547
                                        25  |   .8913126   .8912435     1.00   0.317      -.85551    2.638135
                                        26  |    .949387   .8757977     1.08   0.278     -.767162    2.665936
                                        27  |   .2927997   .9028069     0.32   0.746    -1.476687    2.062286
                                        28  |   .7221179   .8472834     0.85   0.394    -.9385435    2.382779
                                        29  |   .4974671   .8955593     0.56   0.579    -1.257814    2.252749
                                        30  |   3.646133    1.43535     2.54   0.011     .8328701    6.459396
                                        31  |   .4336457   .8994272     0.48   0.630    -1.329217    2.196508
                                        32  |   1.546787   1.064917     1.45   0.146    -.5404316    3.634006
                                        33  |   .4358964   .9968934     0.44   0.662    -1.517998    2.389791
                                        34  |   .3470953   .9126551     0.38   0.704    -1.441694    2.135884
                                        35  |   1.621231   1.055895     1.54   0.125    -.4483058    3.690768
                                        36  |   .7194533   .9259729     0.78   0.437    -1.095438    2.534345
                                        37  |   1.731182   1.203947     1.44   0.150    -.6285341    4.090899
                                        45  |   .6625817   .8719648     0.76   0.447    -1.046455    2.371618
                                        50  |   .9029901   .8975743     1.01   0.314    -.8562407    2.662221
                                        51  |   .5655833   .8539491     0.66   0.508    -1.108143    2.239309
                                        52  |   .6118768   .8502834     0.72   0.472    -1.054665    2.278418
                                        55  |   .6197807   .8848717     0.70   0.484    -1.114553    2.354115
                                        60  |   .8436712   .8972863     0.94   0.347    -.9149952    2.602338
                                        61  |   2.158662   1.097073     1.97   0.049     .0084165    4.308908
                                        62  |   1.178337    1.22349     0.96   0.336    -1.219683    3.576358
                                        63  |   .5864199   .8711842     0.67   0.501    -1.121087    2.293927
                                        64  |   .6458872   1.009906     0.64   0.522    -1.333513    2.625287
                                        65  |          0  (empty)
                                        70  |   2.118628   1.332885     1.59   0.112    -.4938037     4.73106
                                        71  |          0  (empty)
                                        72  |   .5602221   .9209123     0.61   0.543    -1.244751    2.365195
                                        74  |          0  (omitted)
                                        93  |          0  (empty)
                                            |
                                      _cons |  -1.411011   .8950048    -1.58   0.115    -3.165206    .3431832
    ---------------------------------------------------------------------------------------------------------
    Note: 222 strata omitted because they contain no subpopulation members.
    Note: Variance scaled to handle strata with a single sampling unit.
    It can be see that some of the levels of the industry fixed effects are not estimated, because for those omitted industries there is only one observation for which the covariates and the dependent variable do not take missing value.
    I am interested on obtaining average marginal effects of all covariates, so I run the next code:

    Code:
     margins, dydx(*)
    And this is the output:
    Code:
    Average marginal effects                        Number of obs     =     34,083
    Model VCE    : Linearized
    
    Expression   : Pr(fin11), predict()
    dy/dx w.r.t. : 1.n_outcome lcar1 lnemployees 1.ownership 2.k9 3.k9 4.k9 ln_dlabproduc_2 k7 k21 k3a 12.isic
                   15.isic 16.isic 17.isic 18.isic 19.isic 20.isic 21.isic 22.isic 23.isic 24.isic 25.isic 26.isic
                   27.isic 28.isic 29.isic 30.isic 31.isic 32.isic 33.isic 34.isic 35.isic 36.isic 37.isic 45.isic
                   50.isic 51.isic 52.isic 55.isic 60.isic 61.isic 62.isic 63.isic 64.isic 65.isic 70.isic 71.isic
                   72.isic 74.isic 93.isic
    
    ---------------------------------------------------------------------------------------------------------
                                            |            Delta-method
                                            |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------------------------------+----------------------------------------------------------------
                                1.n_outcome |  -.0723683   .0266629    -2.71   0.007    -.1246271   -.0201094
                                      lcar1 |   .0203329   .0216112     0.94   0.347    -.0220248    .0626906
                                lnemployees |   .0468718    .009898     4.74   0.000     .0274719    .0662717
                                            |
                                  ownership |
                                   Foreign  |   .0665421   .0357958     1.86   0.063     -.003617    .1367013
                                            |
                                         k9 |
    State-owned banks or government agency  |   .0935447    .034765     2.69   0.007     .0254059    .1616834
           Non-bank financial institutions  |  -.0362868    .051395    -0.71   0.480    -.1370201    .0644465
                                     Other  |  -.3274578   .0584824    -5.60   0.000    -.4420823   -.2128332
                                            |
                            ln_dlabproduc_2 |    .011491   .0019731     5.82   0.000     .0076238    .0153581
                                         k7 |  -.0482969    .028923    -1.67   0.095    -.1049856    .0083917
                                        k21 |   .0532851   .0244308     2.18   0.029     .0054011    .1011692
                                        k3a |  -.1141976   .0351164    -3.25   0.001    -.1830252   -.0453699
                                            |
                                       isic |
                                        11  |          0  (empty)
                                        12  |          .  (not estimable)
                                        15  |          .  (not estimable)
                                        16  |          .  (not estimable)
                                        17  |          .  (not estimable)
                                        18  |          .  (not estimable)
                                        19  |          .  (not estimable)
                                        20  |          .  (not estimable)
                                        21  |          .  (not estimable)
                                        22  |          .  (not estimable)
                                        23  |          .  (not estimable)
                                        24  |          .  (not estimable)
                                        25  |          .  (not estimable)
                                        26  |          .  (not estimable)
                                        27  |          .  (not estimable)
                                        28  |          .  (not estimable)
                                        29  |          .  (not estimable)
                                        30  |          .  (not estimable)
                                        31  |          .  (not estimable)
                                        32  |          .  (not estimable)
                                        33  |          .  (not estimable)
                                        34  |          .  (not estimable)
                                        35  |          .  (not estimable)
                                        36  |          .  (not estimable)
                                        37  |          .  (not estimable)
                                        45  |          .  (not estimable)
                                        50  |          .  (not estimable)
                                        51  |          .  (not estimable)
                                        52  |          .  (not estimable)
                                        55  |          .  (not estimable)
                                        60  |          .  (not estimable)
                                        61  |          .  (not estimable)
                                        62  |          .  (not estimable)
                                        63  |          .  (not estimable)
                                        64  |          .  (not estimable)
                                        65  |          .  (not estimable)
                                        70  |          .  (not estimable)
                                        71  |          .  (not estimable)
                                        72  |          .  (not estimable)
                                        74  |          .  (not estimable)
                                        93  |          .  (not estimable)
    ---------------------------------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.

    It can be seen that I do not get the margins of the industry fixed effects, even for those industries that did not be omitted in the logit regression. However, I got it for the covariates. Is this issue a major problem? I mean, it is legitimate to use the margins that I have got for the covariates?
    Finally, I have a doubt regarding subpop command. The number of observations in th elogit regression is 122,771, meanwhile in the margins estimation 34,083, why such a big difference?

    Thank you,
    Ibai
    Last edited by Ibai Ostolozaga Falcon; 21 Jun 2023, 00:57.
Working...
X