Skip to contents

Generate predictions for absolute probabilities and relative treatment effects in different populations.

Usage

# S3 method for class 'mlumr_fit'
predict(
  object,
  population = c("both", "index", "comparator"),
  type = c("response", "link"),
  treatment = c("both", "index", "comparator"),
  summary = TRUE,
  probs = c(0.025, 0.5, 0.975),
  ...
)

Arguments

object

An mlumr_fit object

population

Which population to predict in: "index", "comparator", or "both"

type

Type of prediction: "response" (probabilities) or "link" (logit scale)

treatment

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

summary

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

probs

Quantiles for summary (default c(0.025, 0.5, 0.975))

...

Additional arguments (unused)

Value

A data frame with predictions

Examples

if (FALSE) { # \dontrun{
# Predict probabilities in both populations
predict(fit, population = "both", treatment = "both")

# Get full posterior draws
draws <- predict(fit, population = "index", summary = FALSE)
} # }