summary_interact

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

# \donttest{
  library(rms)
  options(datadist = "dd")

  data("transplant", package = "survival")

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

  lrm_mod <- lrm(event ~ rcs(age, 3) * (sex + abo) + rcs(year, 3),
    data = transplant
  )
#> Error in Design(data, formula = formula, specials = "strat"): dataset dd not found for options(datadist=)

  lrm_mod
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
  summary(lrm_mod)
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
  summary_interact(lrm_mod, age, sex)
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
  summary_interact(lrm_mod, age, sex, ref_min = 60, ref_max = 80)
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
  summary_interact(lrm_mod, age, sex,
    ref_min = 60, ref_max = 80, digits = 5L
  )
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found

  summary_interact(lrm_mod, age, abo)
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
  summary_interact(lrm_mod, age, abo, level = c("A", "AB"))
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
  summary_interact(lrm_mod, age, abo, level = c("A", "AB"), p = TRUE)
#> Error in eval(expr, envir, enclos): object 'lrm_mod' not found
# }