| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: How to best describe interaction between a dummy variable and a continuous one in logistic regression?
From |
"daniel waxman" <[email protected]> |
To |
<[email protected]> |
Subject |
st: How to best describe interaction between a dummy variable and a continuous one in logistic regression? |
Date |
Fri, 3 Feb 2006 14:52:09 -0500 |
This is a statistics question rather than a Stata question.
I am struggling with how to best describe (medical journal manuscript) an
interaction effect.
The overall goal of the study is to describe the continuous variable 'zlog'
as a predictor of 'outcome' and to determine the degree to which the
association is independent of other variables. It is indeed independent of
most of them, but there are two dummy variables for which interaction terms
are significant and the odds ratio for zlog changes.
The question is: How do I describe/quantify the interaction in a succinct
way?
Do the odds ratios for the interaction terms have any intuitive meaning? I
can see what is happening (sort of) by dropping observations based upon the
dummy variable, but it is hard to describe quantitatively.
The two dummy variables that interact are different. In the first example,
the odds ratio for the continuous variable increases when the either the
observations with dummy==0 or dummy==1 are dropped. In the second case,
dropping dummy==0 decreases the the OR for the continuous variable and
dropping dummy==1 increases it.
*********************example #1: Dummy variable (romi) has increases OR for
the continuous variable (zlog) for both
situations romi==0 and romi==1
. logistic outcome zlog
Logistic regression Number of obs =
20277
LR chi2(1) =
243.41
Prob > chi2 =
0.0000
Log likelihood = -3868.6247 Pseudo R2 =
0.0305
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 2.080782 .0918129 16.61 0.000 1.908394
2.268742
----------------------------------------------------------------------------
--
. logistic is_dead romi
Logistic regression Number of obs =
21236
LR chi2(1) =
278.92
Prob > chi2 =
0.0000
Log likelihood = -3928.3283 Pseudo R2 =
0.0343
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
romi | .2172724 .0241013 -13.76 0.000 .1748169
.2700384
----------------------------------------------------------------------------
--
. logistic outcome zlog romi
Logistic regression Number of obs =
20277
LR chi2(2) =
553.98
Prob > chi2 =
0.0000
Log likelihood = -3713.3369 Pseudo R2 =
0.0694
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 2.474006 .1195488 18.75 0.000 2.250448
2.719772
romi | .1786168 .0215241 -14.29 0.000 .1410422
.2262016
----------------------------------------------------------------------------
--
. xi: logistic outcome i.romi*zlog
i.romi _Iromi_0-1 (naturally coded; _Iromi_0 omitted)
i.romi*zlog _IromXzlog_# (coded as above)
Logistic regression Number of obs =
20277
LR chi2(3) =
558.58
Prob > chi2 =
0.0000
Log likelihood = -3711.0395 Pseudo R2 =
0.0700
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
_Iromi_1 | .2093427 .0292553 -11.19 0.000 .1591856
.2753037
zlog | 2.350594 .1269027 15.83 0.000 2.114576
2.612955
_IromXzlog_1 | 1.295315 .1556027 2.15 0.031 1.023583
1.639185
----------------------------------------------------------------------------
--
. preserve
. drop if romi==1
(6413 observations deleted)
. logistic outcome zlog
Logistic regression Number of obs =
14823
LR chi2(1) =
230.33
Prob > chi2 =
0.0000
Log likelihood = -3335.5847 Pseudo R2 =
0.0334
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 2.350594 .1269027 15.83 0.000 2.114576
2.612955
----------------------------------------------------------------------------
--
. restore
. drop if romi==0
(14823 observations deleted)
. logistic outcome zlog
Logistic regression Number of obs =
5454
LR chi2(1) =
91.85
Prob > chi2 =
0.0000
Log likelihood = -375.4548 Pseudo R2 =
0.1090
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 3.04476 .3267399 10.38 0.000 2.467225
3.757486
----------------------------------------------------------------------------
--
*************************
************************* example #2: dummy variable increases OR for zlog
if is_sec == 1
but increases it is is_sec==0
. logistic outcome zlog
Logistic regression Number of obs =
20277
LR chi2(1) =
243.41
Prob > chi2 =
0.0000
Log likelihood = -3868.6247 Pseudo R2 =
0.0305
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 2.080782 .0918129 16.61 0.000 1.908394
2.268742
----------------------------------------------------------------------------
--
.
. logistic outcome no_sec
Logistic regression Number of obs =
20277
LR chi2(1) =
42.08
Prob > chi2 =
0.0000
Log likelihood = -3969.2894 Pseudo R2 =
0.0053
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
no_sec | 1.543235 .101792 6.58 0.000 1.356085
1.756214
----------------------------------------------------------------------------
--
.
. logistic outcome zlog no_sec
Logistic regression Number of obs =
20277
LR chi2(2) =
306.15
Prob > chi2 =
0.0000
Log likelihood = -3837.2553 Pseudo R2 =
0.0384
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 2.146586 .0947182 17.31 0.000 1.968743
2.340495
no_sec | 1.71472 .1148813 8.05 0.000 1.503713
1.955335
----------------------------------------------------------------------------
--
. xi: logistic outcome i.no_sec*zlog
i.no_sec _Ino_sec_0-1 (naturally coded; _Ino_sec_0 omitted)
i.no_sec*zlog _Ino_Xzlog_# (coded as above)
Logistic regression Number of obs =
20277
LR chi2(3) =
315.56
Prob > chi2 =
0.0000
Log likelihood = -3832.5466 Pseudo R2 =
0.0395
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
_Ino_sec_1 | 1.268187 .1531227 1.97 0.049 1.00094
1.606788
zlog | 2.396819 .1351902 15.50 0.000 2.145972
2.676988
_Ino_Xzlog_1 | .7573733 .0690372 -3.05 0.002 .6334612
.905524
----------------------------------------------------------------------------
--
.
. preserve
. drop if no_sec==0
(13788 observations deleted)
. logistic outcome zlog
Logistic regression Number of obs =
6489
LR chi2(1) =
60.98
Prob > chi2 =
0.0000
Log likelihood = -1514.7069 Pseudo R2 =
0.0197
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 1.815287 .129987 8.33 0.000 1.577587
2.088802
----------------------------------------------------------------------------
--
. restore
. drop if no_sec==1
(6489 observations deleted)
. logistic outcome zlog
Logistic regression Number of obs =
13788
LR chi2(1) =
212.51
Prob > chi2 =
0.0000
Log likelihood = -2317.8397 Pseudo R2 =
0.0438
----------------------------------------------------------------------------
--
outcome | Odds Ratio Std. Err. z P>|z| [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
zlog | 2.396819 .1351902 15.50 0.000 2.145972
2.676988
----------------------------------------------------------------------------
--
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/