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
Drop certain observation if certain criteria meets a condition (Panel data)Hello! I have a panel data which consists from the year 2010 to 2019 I want drop all the observatio…
How to calculate date_month variable from Date (dmy) and day of year (doy)Hi, I have been wondering if there is a way to present average annual statistics from time-series d…
How to export CSV with multiine text dataI have a CSV file in which some of the columns contain multiline text data. See below. Sample file a…
Question Stata!!Hello, Do you have any idea of how can I create a variable that is equal to the nº of years a perso…
save spssSomehow savespss is broken, random extra empty string variables are added to the file produced, like…
Subscribe to:
Post Comments (Atom)
0 Response to calculation odd ratio for interaction terms using Lincom
Post a Comment