Skip to contents

Extract marginal treatment effects (log odds ratio, risk difference, risk ratio) from fitted ML-UMR model.

Usage

marginal_effects(
  object,
  population = c("both", "index", "comparator"),
  effect_type = c("auto", "all", "lor", "rd", "rr", "md", "rate_ratio"),
  summary = TRUE,
  probs = c(0.025, 0.5, 0.975),
  ...
)

Arguments

object

An mlumr_fit object

population

Which population: "both", "index", or "comparator"

effect_type

Which effect measure: "all", "lor", "rd", or "rr"

summary

Return summary statistics (TRUE) or full posterior draws (FALSE)

probs

Quantiles for summary

...

Additional arguments (unused)

Value

A data frame with marginal effects

Examples

if (FALSE) { # \dontrun{
# All marginal effects in both populations
marginal_effects(fit)

# Risk differences only
marginal_effects(fit, effect_type = "rd")

# Get posterior draws
draws <- marginal_effects(fit, summary = FALSE)
} # }