Skip to content

Is it a bug? When adding variable "extent" from colon_s into finalfit() model, the odds ratio cannot be displayed correctly. #78

@zhaohongxin0

Description

@zhaohongxin0
explanatory = c("age.factor","extent" , "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "mort_5yr"

t<-colon_s %>%
  finalfit(dependent, explanatory)

t

The results are:

<style> </style>
Dependent: Mortality 5 year   Alive Died OR (univariable) OR (multivariable)
Age <40 years 31 (46.3) 36 (53.7) - -
  40-59 years 208 (61.4) 131 (38.6) 0.54 (0.32-0.92, p=0.023) 0.54 (0.31-0.93, p=0.027)
  60+ years 272 (53.4) 237 (46.6) 0.75 (0.45-1.25, p=0.270) 0.77 (0.45-1.31, p=0.340)
extent 1 16 (80.0) 4 (20.0) - -
  2 78 (75.7) 25 (24.3) - -
  3 401 (53.5) 349 (46.5) - -
  4 16 (38.1) 26 (61.9) - -
Sex Female 243 (55.6) 194 (44.4) - -
  Male 268 (56.1) 210 (43.9) 0.98 (0.76-1.27, p=0.889) 0.97 (0.74-1.28, p=0.852)
Obstruction No 408 (56.7) 312 (43.3) - -
  Yes 89 (51.1) 85 (48.9) 1.25 (0.90-1.74, p=0.189) 1.20 (0.86-1.69, p=0.284)
Perforation No 497 (56.0) 391 (44.0) - -
  Yes 14 (51.9) 13 (48.1) 1.18 (0.54-2.55, p=0.672) 0.98 (0.45-2.16, p=0.970)
NA NA NA NA 2.22 (1.64-3.07, p<0.001) 2.25 (1.64-3.14, p<0.001)

it seems that the last row is the OR for "extent" as a continuous variable, but in the table, extent is considered as a factor but the OR is not displayed.
If I changed “extent” to a factor, it can be corrected. But how can I do when I want to do it as a continuous variable? cont_cut seems not work in finalfit().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions