Hello guys,
I think I have a moderator variable in my logistic model. My DV is whether or not patients in a mental institution were involved in use of force (UOF) incidents with the staff. The ID variables are:
I think I have a moderator variable in my logistic model. My DV is whether or not patients in a mental institution were involved in use of force (UOF) incidents with the staff. The ID variables are:
- Score: An score we assigned to all patients that assess how violent they are (continuous)
- PastAdm: Whether or not patients had a previous addition to the facility (cat).
- How can I account for this in my model interaction/effect modification/or whatever it is?
- Can I included an interaction effect term such as Score*PastAdm? Or Should I Run two separate models one for low and one for high score?
- How can I represent this in a graph?
Code:
. * Only PastAdm as IV
. logistic UOF15 EverInc
Logistic regression Number of obs = 47,760
LR chi2(1) = 147.85
Prob > chi2 = 0.0000
Log likelihood = -8724.0089 Pseudo R2 = 0.0084
------------------------------------------------------------------------------
UOF15 | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
EverInc | 1.718847 .077605 12.00 0.000 1.57328 1.877883
_cons | .0352347 .0012392 -95.13 0.000 .0328878 .0377491
------------------------------------------------------------------------------
. * Only Score as IV
. logistic UOF15 i.ICSC
Logistic regression Number of obs = 37,587
LR chi2(2) = 3061.50
Prob > chi2 = 0.0000
Log likelihood = -6666.0196 Pseudo R2 = 0.1868
------------------------------------------------------------------------------
UOF15 | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ICSC |
2 | 2.934757 .2073414 15.24 0.000 2.555257 3.37062
3 | 22.15072 1.423205 48.22 0.000 19.52978 25.1234
|
_cons | .0161902 .0008944 -74.64 0.000 .0145288 .0180415
------------------------------------------------------------------------------
. * PastAdm and Score as ID - the effect of PastInc changed direction
. logistic UOF15 i.ICSC EverInc
Logistic regression Number of obs = 37,587
LR chi2(3) = 3075.65
Prob > chi2 = 0.0000
Log likelihood = -6658.9477 Pseudo R2 = 0.1876
------------------------------------------------------------------------------
UOF15 | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ICSC |
2 | 3.032999 .2159513 15.58 0.000 2.637948 3.487212
3 | 23.58226 1.56941 47.49 0.000 20.69843 26.86787
|
EverInc | .8266141 .0417467 -3.77 0.000 .7487112 .9126228
_cons | .0174652 .0010203 -69.28 0.000 .0155757 .019584
------------------------------------------------------------------------------
. * regression by strata
. bysort ICSC: logistic UOF15 EverInc if ICSC !=.
--------------------------------------------------------------------------------------------------------------------------------------------------
-> ICSC = 1
Logistic regression Number of obs = 20,901
LR chi2(1) = 3.60
Prob > chi2 = 0.0577
Log likelihood = -1706.9558 Pseudo R2 = 0.0011
------------------------------------------------------------------------------
UOF15 | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
EverInc | 1.234472 .136636 1.90 0.057 .9937267 1.533541
_cons | .0147404 .0011193 -55.54 0.000 .0127021 .0171057
------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------
-> ICSC = 2
Logistic regression Number of obs = 11,905
LR chi2(1) = 1.98
Prob > chi2 = 0.1598
Log likelihood = -2196.8736 Pseudo R2 = 0.0004
------------------------------------------------------------------------------
UOF15 | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
EverInc | .8823108 .0783792 -1.41 0.159 .7413205 1.050116
_cons | .0510823 .003409 -44.57 0.000 .0448192 .0582205
------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------
-> ICSC = 3
Logistic regression Number of obs = 4,781
LR chi2(1) = 30.60
Prob > chi2 = 0.0000
Log likelihood = -2744.1011 Pseudo R2 = 0.0055
------------------------------------------------------------------------------
UOF15 | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
EverInc | .6693567 .0480926 -5.59 0.000 .5814329 .7705763
_cons | .4783626 .0287598 -12.26 0.000 .4251888 .5381862
------------------------------------------------------------------------------

Comment