I'm attempting to do some post estimation on a model with an interaction term. I want to test/contrast a specific subgroup (described below after the marginal table) of patients to determine if their postoperative length of stay is significantly different. Below is my code/output and the groups of interest.
Code:
xtmixed post_operative_los age_year sex ib1.race ib2.ethnicity ib0.insurance i.open##i.perf year i.post_iv##i.post_op ib3.region || hospital_number :, mle vari
> ance robust nostderr
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log pseudolikelihood = -212226.72
Iteration 1: log pseudolikelihood = -212226.72 (backed up)
Mixed-effects regression Number of obs = 94,745
Group variable: hospital_num~r Number of groups = 46
Obs per group:
min = 191
avg = 2,059.7
max = 6,358
Wald chi2(21) = 4495.79
Log pseudolikelihood = -212226.72 Prob > chi2 = 0.0000
(Std. Err. adjusted for 46 clusters in hospital_number)
------------------------------------------------------------------------------------
| Robust
post_operative_los | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------------+----------------------------------------------------------------
age_year | -.0245202 .0035618 -6.88 0.000 -.0315012 -.0175391
sex | .0731537 .014544 5.03 0.000 .044648 .1016595
|
race |
2 | .3538417 .0401767 8.81 0.000 .2750968 .4325866
3 | .1088548 .0466723 2.33 0.020 .0173788 .2003308
4 | .3558918 .1211113 2.94 0.003 .1185181 .5932656
5 | .0751263 .1512244 0.50 0.619 -.2212681 .3715206
6 | .00734 .0303526 0.24 0.809 -.05215 .06683
|
ethnicity |
1 | .0832976 .0282652 2.95 0.003 .0278988 .1386964
3 | -.0009093 .0497022 -0.02 0.985 -.0983239 .0965052
|
insurance |
1 | .1357891 .0234376 5.79 0.000 .0898523 .1817259
2 | .143156 .0703809 2.03 0.042 .005212 .2810999
|
1.open | .419797 .1544747 2.72 0.007 .1170322 .7225618
1.perf | 2.727641 .1067416 25.55 0.000 2.518431 2.93685
|
open#perf |
1 1 | 1.496406 .2097454 7.13 0.000 1.085313 1.9075
|
year | .0038202 .0126195 0.30 0.762 -.0209136 .0285539
1.post_iv | .8388155 .08747 9.59 0.000 .6673774 1.010254
1.post_op | .6839905 .0599004 11.42 0.000 .5665878 .8013931
|
post_iv#post_op |
1 1 | 1.121246 .140226 8.00 0.000 .8464083 1.396084
|
region |
0 | -.0405478 .1405433 -0.29 0.773 -.3160076 .2349119
1 | -.0952114 .1549485 -0.61 0.539 -.3989048 .208482
2 | -.1613537 .1281015 -1.26 0.208 -.412428 .0897206
|
_cons | -6.567582 25.37871 -0.26 0.796 -56.30895 43.17378
------------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Robust
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
hospital_n~r: Identity |
var(_cons) | .1170936 . . .
-----------------------------+------------------------------------------------
var(Residual) | 5.156716 . . .
------------------------------------------------------------------------------Code:
contrast post_iv@post_op, effects
Contrasts of marginal linear predictions
Margins : asbalanced
---------------------------------------------------
| df chi2 P>chi2
----------------+----------------------------------
post_operativ~s |
post_iv@post_op |
0 | 1 91.96 0.0000
1 | 1 126.73 0.0000
Joint | 2 139.22 0.0000
---------------------------------------------------
------------------------------------------------------------------------------------
| Contrast Std. Err. z P>|z| [95% Conf. Interval]
-------------------+----------------------------------------------------------------
post_operative_los |
post_iv@post_op |
(1 vs base) 0 | .8388155 .08747 9.59 0.000 .6673774 1.010254
(1 vs base) 1 | 1.960062 .1741152 11.26 0.000 1.618802 2.301321
------------------------------------------------------------------------------------
. contrast post_iv@post_op
Contrasts of marginal linear predictions
Margins : asbalanced
---------------------------------------------------
| df chi2 P>chi2
----------------+----------------------------------
post_operativ~s |
post_iv@post_op |
0 | 1 91.96 0.0000
1 | 1 126.73 0.0000
Joint | 2 139.22 0.0000
---------------------------------------------------
. margins post_iv#post_op
Predictive margins Number of obs = 94,745
Model VCE : Robust
Expression : Linear prediction, fixed portion, predict()
---------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
----------------+----------------------------------------------------------------
post_iv#post_op |
0 0 | 1.954336 .0483895 40.39 0.000 1.859494 2.049177
0 1 | 2.638326 .0582607 45.28 0.000 2.524137 2.752515
1 0 | 2.793151 .0858496 32.54 0.000 2.624889 2.961414
1 1 | 4.598388 .1838243 25.02 0.000 4.238099 4.958677
---------------------------------------------------------------------------------Hopefully, I've provided enough information but let me know if there are other important details to include.
Thank you!
0 Response to Marginal contrasts with an interaction term
Post a Comment