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).
This is the ouput of the regression:
It can be see that some of the levels of the industry fixed effects are not estimated, might be because I have a dummy variable that only takes the same value in a single industry.
I am interested on obtaining average marginal effects of all covariates, so I run the next code:
And this is the output:
It can be seen that I do not get the margins of the industry fixed effects, but I got it for the covariates. Is this issue a major problem? I mean, what could be causing this "problem"?
Finally, I have a doubt regarding subpop command. The number of observations in th elogit regression is 122,435, meanwhile in the margins estimation 33,364, why such a big difference?
Thank you,
Ibai
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 k8==100 & loan_duration<=3): logit fin11 i.n_outcome lcar1 lnemployees i.ownership i.k9 k7 k21 k2c k3a i.isic
Code:
. svy, subpop(if k8==100 & loan_duration<=3): logit fin11 i.n_outcome lcar1 lnemployees i.ownership i.k9 k7 k21 k2c k3a i
> .isic /*Only micro variables*/
(running logit on estimation sample)
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: 74.isic != 0 predicts failure perfectly
74.isic dropped and 1 obs not used
note: 93.isic != 0 predicts success perfectly
93.isic dropped and 1 obs not used
note: 72.isic omitted because of collinearity
Survey: Logistic regression
Number of strata = 1,023 Number of obs = 122,435
Number of PSUs = 122,435 Population size = 8,053,231
Subpop. no. obs = 25,571
Subpop. size = 1,365,637
Design df = 121,412
F( 46, 121367) = 2.93
Prob > F = 0.0000
---------------------------------------------------------------------------------------------------------
| Linearized
fin11 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
----------------------------------------+----------------------------------------------------------------
1.n_outcome | -.5290526 .1453492 -3.64 0.000 -.8139347 -.2441706
lcar1 | .0856082 .1152074 0.74 0.457 -.1401964 .3114128
lnemployees | .2337162 .0556075 4.20 0.000 .1247263 .342706
|
ownership |
Foreign | .3864742 .1959367 1.97 0.049 .0024415 .7705069
|
k9 |
State-owned banks or government agency | .5365416 .1888164 2.84 0.004 .1664645 .9066187
Non-bank financial institutions | -.0156541 .2525021 -0.06 0.951 -.510554 .4792459
Other | -.9625027 .4206039 -2.29 0.022 -1.786879 -.1381261
|
k7 | -.1550218 .1587332 -0.98 0.329 -.4661362 .1560925
k21 | .2372392 .1157189 2.05 0.040 .010432 .4640463
k2c | .0396068 .2063014 0.19 0.848 -.3647404 .4439541
k3a | -.6486476 .1958693 -3.31 0.001 -1.032548 -.264747
|
isic |
11 | 0 (empty)
12 | 0 (empty)
15 | .4093842 .4702355 0.87 0.384 -.5122697 1.331038
16 | .5014592 .6681139 0.75 0.453 -.8080331 1.810951
17 | .1552368 .5141449 0.30 0.763 -.8524787 1.162952
18 | .0936465 .5096458 0.18 0.854 -.9052509 1.092544
19 | .8201754 .6731193 1.22 0.223 -.4991274 2.139478
20 | .2221122 .6308589 0.35 0.725 -1.014361 1.458585
21 | -.7575825 .6488916 -1.17 0.243 -2.029399 .5142343
22 | -.2264747 .6188005 -0.37 0.714 -1.439314 .986364
23 | .5691912 .9113761 0.62 0.532 -1.217091 2.355473
24 | .2438126 .5182789 0.47 0.638 -.7720056 1.259631
25 | .7963638 .5543106 1.44 0.151 -.2900758 1.882803
26 | .8156183 .54468 1.50 0.134 -.2519456 1.883182
27 | -.0681296 .5860489 -0.12 0.907 -1.216776 1.080517
28 | .4656937 .4812548 0.97 0.333 -.4775578 1.408945
29 | .0404533 .5759919 0.07 0.944 -1.088481 1.169388
30 | .1739123 1.200853 0.14 0.885 -2.179741 2.527565
31 | .2288474 .6038738 0.38 0.705 -.9547352 1.41243
32 | 1.099094 .841879 1.31 0.192 -.5509745 2.749163
33 | .1711341 .7744631 0.22 0.825 -1.346801 1.689069
34 | .2133599 .59799 0.36 0.721 -.9586907 1.38541
35 | .3154521 .6239074 0.51 0.613 -.9073962 1.5383
36 | .5405704 .6106504 0.89 0.376 -.6562944 1.737435
37 | 4.389489 .9015118 4.87 0.000 2.62254 6.156437
40 | -.4289746 1.273609 -0.34 0.736 -2.925227 2.067278
45 | .1355272 .5410039 0.25 0.802 -.9248315 1.195886
50 | .3037491 .5686715 0.53 0.593 -.8108377 1.418336
51 | .3227871 .4895057 0.66 0.510 -.6366359 1.28221
52 | .3529228 .5059105 0.70 0.485 -.6386535 1.344499
55 | .2119145 .5971252 0.35 0.723 -.958441 1.38227
60 | .6793623 .6200976 1.10 0.273 -.5360188 1.894743
61 | 1.197038 .8424316 1.42 0.155 -.4541141 2.84819
62 | .9338751 .9477057 0.99 0.324 -.9236125 2.791363
63 | .228811 .5288919 0.43 0.665 -.8078084 1.26543
64 | .0321283 .7168183 0.04 0.964 -1.372824 1.43708
65 | 0 (empty)
70 | 1.431296 1.14142 1.25 0.210 -.8058695 3.668461
71 | 0 (empty)
72 | 0 (omitted)
74 | 0 (empty)
93 | 0 (empty)
|
_cons | -.1895044 .5747165 -0.33 0.742 -1.315939 .9369305
---------------------------------------------------------------------------------------------------------
Note: 221 strata omitted because they contain no subpopulation members.
Note: Variance scaled to handle strata with a single sampling unit.
I am interested on obtaining average marginal effects of all covariates, so I run the next code:
Code:
margins, dydx(*)
Code:
Average marginal effects Number of obs = 33,364
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 k7 k21 k2c 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 40.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 | -.1141856 .0323293 -3.53 0.000 -.1775505 -.0508207
lcar1 | .0180814 .0243065 0.74 0.457 -.0295589 .0657216
lnemployees | .0493633 .0116403 4.24 0.000 .0265486 .0721781
|
ownership |
Foreign | .0782693 .0377003 2.08 0.038 .0043773 .1521613
|
k9 |
State-owned banks or government agency | .1118159 .0379885 2.94 0.003 .037359 .1862728
Non-bank financial institutions | -.0034603 .0558708 -0.06 0.951 -.1129661 .1060455
Other | -.2151779 .0895576 -2.40 0.016 -.3907094 -.0396464
|
k7 | -.0327422 .0335125 -0.98 0.329 -.0984261 .0329416
k21 | .0501074 .02441 2.05 0.040 .0022643 .0979506
k2c | .0083654 .0435627 0.19 0.848 -.0770167 .0937475
k3a | -.1370013 .041 -3.34 0.001 -.2173606 -.0566419
|
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)
40 | . (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.
Finally, I have a doubt regarding subpop command. The number of observations in th elogit regression is 122,435, meanwhile in the margins estimation 33,364, why such a big difference?
Thank you,
Ibai
