0

I am doing a logistic regression in r, however the OR (OddsRatio) gives me the inverse, giving me the OR for the reference value but not for the variable that is on the same line

library(finalfit)
colon_s %>%
  finalfit("mort_5yr", c("hospital", "sex.factor")) 

results

 Dependent: Mortality 5 year                 Alive       Died               OR (univariable)
                hospital hospital_1 176 (96.2)    7 (3.8)                              -
                         hospital_2 120 (67.0)  59 (33.0)    12.36 (5.82-30.55, p<0.001)
                         hospital_3 106 (57.9)  77 (42.1)    18.26 (8.67-44.90, p<0.001)
                         hospital_4  89 (48.4)  95 (51.6)   26.84 (12.77-65.91, p<0.001)
                         hospital_5  20 (10.8) 166 (89.2) 208.69 (91.64-549.67, p<0.001)
                     Sex     Female 243 (55.6) 194 (44.4)                              -
                               Male 268 (56.1) 210 (43.9)      0.98 (0.76-1.27, p=0.889)

How do I invert the OR, in the style of Stata? since it seems that the risk of hospital 2 is 12.36 compared to hospital 1, and it is not, it is of hospital 1, compared to hospital 2.

I would prefer that instead of 12 the risk of hospital 2 appear compared to hospital 1 which is 0.8

Johan
  • 109
  • 5
  • 2
    [See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with. That includes what packages you're using (where does `finalfit` come from?), a sample of data, a clear sense of what you need to do and what the output is you need. It's best to not assume people know your field, such as abbreviations (OR--odds ratio?) and how things are calculated – camille Mar 15 '23 at 00:44

0 Answers0