summary_interact {depigner}R Documentation

summary_interact

Description

summary_interact

Usage

summary_interact(
  model,
  ref,
  discrete,
  ref_min = NULL,
  ref_max = NULL,
  level = NULL,
  ...,
  digits = 3L,
  p = FALSE
)

Arguments

model

A model from lrm

ref

A continuous variable for which we are interested in the estimation of the OR for the various level of interaction with a discrete variable interacting with it

discrete

The discrete interacting variable

ref_min

Denominator continuous level for the Odds Ratio (i.e., the reference level), if NULL (the default)

ref_max

Numerator continuous level for the Odds Ratio (i.e., the target level)

level

A character vector of levels to show. Default (NULL) means to show all the possible levels for the discrete variable

...

for possible future development

digits

number of significant digits to print. Default is 3

Note: the datadist has to be defined for the data used in the model

p

do you want also the P-value (default = FALSE)

Value

A data frame

Examples


  library(rms)
  options(datadist = "dd")

  data("transplant")

  transplant <- transplant[transplant[["event"]] != "censored", ] %>%
   droplevels()
  dd <- datadist(transplant)

  lrm_mod <- lrm(event ~ rcs(age, 3) * (sex + abo) + rcs(year, 3),
    data = transplant
  )

  lrm_mod
  summary(lrm_mod)
  summary_interact(lrm_mod, age, sex)
  summary_interact(lrm_mod, age, sex, ref_min = 60, ref_max = 80)
  summary_interact(lrm_mod, age, sex,
    ref_min = 60, ref_max = 80, digits = 5L
  )

  summary_interact(lrm_mod, age, abo)
  summary_interact(lrm_mod, age, abo, level = c("A", "AB"))
  summary_interact(lrm_mod, age, abo, level = c("A", "AB"), p = TRUE)


[Package depigner version 0.8.4 Index]