Code:
logit vaccinated male age ib0.race_rc native ib1.marstat numchild h14hhres proxy work insurance ib1.wealthquint1 ib0.cenreg masks_toomuch malechild reduccat##keducat, or allbaselevels
Code:
. logit vaccinated male age ib0.race_rc native ib1.marstat numchild h14hhres proxy work insurance ib1.wealthquint1 ib0.cenreg masks_toomuch malechild reduccat##keducat, or allbaselevels Iteration 0: log likelihood = -1695.4695 Iteration 1: log likelihood = -1512.5555 Iteration 2: log likelihood = -1487.5511 Iteration 3: log likelihood = -1487.39 Iteration 4: log likelihood = -1487.39 Logistic regression Number of obs = 4,225 LR chi2(31) = 416.16 Prob > chi2 = 0.0000 Log likelihood = -1487.39 Pseudo R2 = 0.1227 ------------------------------------------------------------------------------------ vaccinated | Odds ratio Std. err. z P>|z| [95% conf. interval] -------------------+---------------------------------------------------------------- male | 1.194619 .1258765 1.69 0.091 .9717147 1.468657 age | 1.032606 .0068076 4.87 0.000 1.019349 1.046035 | race_rc | NH-White | 1 (base) NH-Black | 1.482211 .2115324 2.76 0.006 1.120551 1.960598 NH-Other | .6913389 .1741085 -1.47 0.143 .4220095 1.132556 Hispanic | 2.474591 .5055626 4.43 0.000 1.658065 3.69322 | native | .6683936 .1335477 -2.02 0.044 .451813 .9887939 | marstat | Married | 1 (base) Sep/Divorce | .6733267 .0915843 -2.91 0.004 .5157598 .879031 Widowed | .4842703 .0656398 -5.35 0.000 .3712896 .6316301 Never-married | .8865486 .2507104 -0.43 0.670 .509317 1.543181 | numchild | .9417637 .0249689 -2.26 0.024 .8940753 .9919957 h14hhres | .9002094 .0360627 -2.62 0.009 .8322315 .9737398 proxy | .2817702 .082959 -4.30 0.000 .1582282 .5017721 work | .9485741 .1070232 -0.47 0.640 .7603861 1.183337 insurance | 1.623376 .3575462 2.20 0.028 1.054249 2.499741 | wealthquint1 | 1 | 1 (base) 2 | 1.166197 .1657533 1.08 0.279 .8826515 1.540829 3 | 1.137073 .1702812 0.86 0.391 .8478471 1.524963 4 | 1.289984 .2071102 1.59 0.113 .94172 1.767042 5 | 2.729461 .5490092 4.99 0.000 1.840198 4.048454 | cenreg | NE | 1 (base) MW | .6457031 .1185107 -2.38 0.017 .4506149 .9252525 South | .4683402 .080053 -4.44 0.000 .3350166 .6547215 West | .5105215 .0963674 -3.56 0.000 .3526461 .739076 | masks_toomuch | .2888079 .030219 -11.87 0.000 .2352583 .3545465 malechild | .9438558 .0907005 -0.60 0.548 .7818237 1.139469 | reduccat | HS | 1 (base) Some Col | 1.199936 .3153607 0.69 0.488 .7168853 2.008474 Col+ | 1.658133 .775249 1.08 0.279 .6632017 4.145653 | keducat | HS | 1 (base) Some Col | 1.021394 .1725488 0.13 0.900 .7334933 1.422299 Col+ | 1.68241 .279711 3.13 0.002 1.214547 2.330501 | reduccat#keducat | HS#HS | 1 (base) HS#Some Col | 1 (base) HS#Col+ | 1 (base) Some Col#HS | 1 (base) Some Col#Some Col | .8684592 .2829902 -0.43 0.665 .4585458 1.644812 Some Col#Col+ | .8416305 .2599964 -0.56 0.577 .459376 1.541965 Col+#HS | 1 (base) Col+#Some Col | .8178248 .4299102 -0.38 0.702 .2918802 2.291479 Col+#Col+ | .7731643 .382879 -0.52 0.603 .2929193 2.040778 | _cons | 1.207807 .7189185 0.32 0.751 .3761315 3.878422 ------------------------------------------------------------------------------------ Note: _cons estimates baseline odds.
Part of my confusion is that when I run the code with only the interaction and no main effects, I receive output that I would expect. What is the correct approach and why is there a difference?
Code:
logit vaccinated male age ib0.race_rc native ib1.marstat numchild h14hhres proxy work insurance ib1.wealthquint1 ib0.cenreg masks_toomuch malechild reduccat#keducat, or allbaselevels
Code:
. logit vaccinated male age ib0.race_rc native ib1.marstat numchild h14hhres proxy work insurance ib1.wealthquint1 ib0.cenreg masks_toomuch malechild reduccat#keducat, or allbaselevels Iteration 0: log likelihood = -1695.4695 Iteration 1: log likelihood = -1512.5555 Iteration 2: log likelihood = -1487.5511 Iteration 3: log likelihood = -1487.39 Iteration 4: log likelihood = -1487.39 Logistic regression Number of obs = 4,225 LR chi2(31) = 416.16 Prob > chi2 = 0.0000 Log likelihood = -1487.39 Pseudo R2 = 0.1227 ------------------------------------------------------------------------------------ vaccinated | Odds ratio Std. err. z P>|z| [95% conf. interval] -------------------+---------------------------------------------------------------- male | 1.194619 .1258765 1.69 0.091 .9717147 1.468657 age | 1.032606 .0068076 4.87 0.000 1.019349 1.046035 | race_rc | NH-White | 1 (base) NH-Black | 1.482211 .2115324 2.76 0.006 1.120551 1.960598 NH-Other | .6913389 .1741085 -1.47 0.143 .4220095 1.132556 Hispanic | 2.474591 .5055626 4.43 0.000 1.658065 3.69322 | native | .6683936 .1335477 -2.02 0.044 .451813 .9887939 | marstat | Married | 1 (base) Sep/Divorce | .6733267 .0915843 -2.91 0.004 .5157598 .879031 Widowed | .4842703 .0656398 -5.35 0.000 .3712896 .6316301 Never-married | .8865486 .2507104 -0.43 0.670 .509317 1.543181 | numchild | .9417637 .0249689 -2.26 0.024 .8940753 .9919957 h14hhres | .9002094 .0360627 -2.62 0.009 .8322315 .9737398 proxy | .2817702 .082959 -4.30 0.000 .1582282 .5017721 work | .9485741 .1070232 -0.47 0.640 .7603861 1.183337 insurance | 1.623376 .3575462 2.20 0.028 1.054249 2.499741 | wealthquint1 | 1 | 1 (base) 2 | 1.166197 .1657533 1.08 0.279 .8826515 1.540829 3 | 1.137073 .1702812 0.86 0.391 .8478471 1.524963 4 | 1.289984 .2071102 1.59 0.113 .94172 1.767042 5 | 2.729461 .5490092 4.99 0.000 1.840198 4.048454 | cenreg | NE | 1 (base) MW | .6457031 .1185107 -2.38 0.017 .4506149 .9252525 South | .4683402 .080053 -4.44 0.000 .3350166 .6547215 West | .5105215 .0963674 -3.56 0.000 .3526461 .739076 | masks_toomuch | .2888079 .030219 -11.87 0.000 .2352583 .3545465 malechild | .9438558 .0907005 -0.60 0.548 .7818237 1.139469 | reduccat#keducat | HS#HS | 1 (base) HS#Some Col | 1.021394 .1725488 0.13 0.900 .7334933 1.422299 HS#Col+ | 1.68241 .279711 3.13 0.002 1.214547 2.330501 Some Col#HS | 1.199936 .3153607 0.69 0.488 .7168853 2.008474 Some Col#Some Col | 1.06439 .2106292 0.32 0.753 .7222025 1.56871 Some Col#Col+ | 1.699069 .3044057 2.96 0.003 1.195941 2.413863 Col+#HS | 1.658133 .775249 1.08 0.279 .6632017 4.145653 Col+#Some Col | 1.385074 .3465041 1.30 0.193 .8482579 2.261612 Col+#Col+ | 2.156864 .4052279 4.09 0.000 1.492453 3.11706 | _cons | 1.207807 .7189185 0.32 0.751 .3761315 3.878422 ------------------------------------------------------------------------------------ Note: _cons estimates baseline odds.
Example data
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(vaccinated male) float(age race_rc) double(native marstat) byte(numchild h14hhres) double proxy byte work float insurance byte(wealthquint1 cenreg masks_toomuch malechild) 1 0 75 0 1 2 2 2 0 0 1 5 0 0 1 1 0 74 0 1 2 1 1 0 0 1 5 0 0 0 1 1 85 0 1 1 2 2 0 0 1 5 0 0 0 1 0 78 0 1 1 2 2 0 0 1 5 0 0 0 1 0 86 0 1 1 3 2 0 0 1 5 0 0 1 1 0 86 1 1 4 2 1 0 0 1 1 0 0 1 0 0 82 0 0 3 3 5 0 0 1 4 0 0 0 1 0 83 2 0 1 3 2 0 0 1 4 3 1 0 1 1 81 2 0 1 3 2 0 0 1 4 3 0 0 1 1 81 0 1 1 1 2 0 0 1 4 3 0 1 1 0 81 0 1 1 1 2 0 0 1 4 3 0 1 1 0 81 1 0 3 4 1 0 0 1 3 0 0 1 1 0 74 1 1 3 5 4 0 1 1 1 2 0 1 1 1 83 3 1 1 . 2 0 0 1 4 3 0 1 1 0 72 0 1 1 . 2 0 0 1 4 3 0 1 1 1 85 0 1 1 4 6 0 0 1 4 3 1 0 1 0 80 0 1 1 4 6 0 1 1 4 3 0 0 1 1 89 0 0 1 5 2 0 0 1 5 3 1 1 0 0 82 1 1 4 1 1 0 1 1 1 3 0 0 1 0 82 0 1 3 3 2 0 0 1 3 2 0 1 1 0 81 0 0 2 2 1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1 4 0 1 1 1 1 82 0 1 1 2 2 0 0 1 5 2 0 0 1 0 77 0 1 1 2 2 0 1 1 5 2 0 0 1 0 93 1 1 . . . . . . . . 1 1 1 0 82 1 1 3 6 4 0 0 1 2 2 0 1 1 1 84 0 1 3 3 1 0 0 1 2 2 0 0 1 0 76 0 1 3 3 2 0 0 1 5 0 0 1 1 0 80 0 1 2 2 3 0 0 1 2 2 0 0 1 1 90 1 1 . . . . . . . . 1 1 1 1 83 0 1 1 3 2 0 0 1 5 1 0 0 1 0 82 0 1 1 3 2 0 0 1 5 1 0 0 end label values race_rc race label def race 0 "NH-White", modify label def race 1 "NH-Black", modify label def race 2 "NH-Other", modify label def race 3 "Hispanic", modify label values marstat mar label def mar 1 "Married", modify label def mar 2 "Sep/Divorce", modify label def mar 3 "Widowed", modify label def mar 4 "Never-married", modify label values cenreg cen label def cen 0 "NE", modify label def cen 1 "MW", modify label def cen 2 "South", modify label def cen 3 "West", modify
0 Response to Multiple omitted categories when interacting?
Post a Comment