I am doing logistic regression to look at several predictors for a certain outcome. I checked the interaction between two of these predictors using LRT and found an interaction.
I want to use Lincom command to combine the coefficents and produce OR that I can report in my result table. My problem is that I do not rely understand how to do this.
code for final model:
logistic persis90_180 b5.region##i.lap age i.gender if exposure==0
*I have 10 region that interact with 3 lap
I ran a loop to get Or for lap and region and another loop for region and lap
forvalues l = 0/2 {
forvalues r = 0/10{
di "reporting OR for lap `l' and r `r'"
lincom `l'.lap + `l'.lap#`r'.region
}
}
Ex: result
reporting OR for lap 1 and r 1
reporting OR for lap 1 and r 1
( 1) [persis90_180]1.lap + [persis90_180]1.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .5768613 .1228305 -2.58 0.010 .3800371 .8756224
------------------------------------------------------------------------------
reporting OR for lap 1 and r 2
( 1) [persis90_180]1.lap + [persis90_180]2.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .6587111 .0740223 -3.71 0.000 .5284959 .8210097
------------------------------------------------------------------------------
reporting OR for lap 1 and r 3
( 1) [persis90_180]1.lap + [persis90_180]3.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .6154713 .1528265 -1.95 0.051 .3783098 1.001309
------------------------------------------------------------------------------
reporting OR for lap 1 and r 4
( 1) [persis90_180]1.lap + [persis90_180]4.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .2883573 .1106711 -3.24 0.001 .1359068 .611816
------------------------------------------------------------------------------
reporting OR for lap 1 and r 5
( 1) [persis90_180]1.lap + [persis90_180]5b.region#1o.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .4773321 .0614427 -5.75 0.000 .3708967 .6143109
------------------------------------------------------------------------------
reporting OR for lap 1 and r 6
( 1) [persis90_180]1.lap + [persis90_180]6.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .9382366 .2107756 -0.28 0.777 .6040728 1.457255
------------------------------------------------------------------------------
reporting OR for lap 1 and r 7
( 1) [persis90_180]1.lap + [persis90_180]7.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .5652742 .0770354 -4.19 0.000 .4327706 .7383472
------------------------------------------------------------------------------
reporting OR for lap 1 and r 8
( 1) [persis90_180]1.lap + [persis90_180]8.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .6218397 .0902302 -3.27 0.001 .4679154 .8263986
------------------------------------------------------------------------------
reporting OR for lap 1 and r 9
( 1) [persis90_180]1.lap + [persis90_180]9.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .6056324 .0850629 -3.57 0.000 .4598914 .7975591
------------------------------------------------------------------------------
reporting OR for lap 1 and r 10
( 1) [persis90_180]1.lap + [persis90_180]10.region#1.lap = 0
------------------------------------------------------------------------------
persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
(1) | .6244288 .104551 -2.81 0.005 .4497408 .866969
------------------------------------------------------------------------------
my question is how to get the final OR for lap 1 if i have 10 regions tested, and got other results for each region ? Is there ant resuorces that can help me to understand this process? How to report interaction results in final table
Related Posts with calculation odd ratio for interaction terms using Lincom
Crude incidence rate stratified by calendar yearI have estimated the overall crude incidence rate of diabetes in people with hypertension (the study…
Using a global within regress Code: global wc_mvp = 10 regress percent_funded novelty_score if wc > $wc_mvp returns invali…
Creating a variable that counts how many months since you started receiving a 1 for a certain variableHi, I have code set up in the following way (below). I have three important variables, mci= an id f…
Three-year average of a variableHello all, I want to create a variable which is defined as the annual decile rankings of the three-y…
Stop Stata from processing current commandAfter starting a lengthy regression, I realized a mistake. How do I tell Stata to stop doing what i…
Subscribe to:
Post Comments (Atom)
0 Response to calculation odd ratio for interaction terms using Lincom
Post a Comment