Skip to contents

Generate absolute predictions at specific covariate values for both treatments.

Usage

conditional_predict(
  object,
  newdata = NULL,
  type = NULL,
  summary = TRUE,
  probs = c(0.025, 0.5, 0.975)
)

Arguments

object

An mlumr_fit object

newdata

Data frame of covariate values. If NULL, uses IPD covariate means.

type

"response" for probabilities, means, or rates; "link" for the fitted linear-predictor scale. NULL, the default, resolves to "response" for binomial, normal and Poisson fits. Ignored for survival fits, which return the conditional survival probability S(t | x) at each fitted prediction time.

summary

Return summary (TRUE) or full draws (FALSE)

probs

Quantiles for summary

Value

A data frame with predictions for each treatment at each profile. For survival fits the summary has one row per profile, treatment, and time; with summary = FALSE the draws are rows and the prediction times are t_* columns.

See also

conditional_effects() for covariate-conditional treatment effects; predict.mlumr_fit() for population-level predictions.

Examples

if (FALSE) { # \dontrun{
conditional_predict(fit)
conditional_predict(fit, newdata = data.frame(age = 60, sex = 1))
} # }