This is a generic method for estimating marginal survival functions by levels of a stratification variable (typically treatment vs. control).

marginal_survival(object, ...)

# S3 method for psweight
marginal_survival(object, formula, times = NULL, ...)

# S3 method for psweight_mi
marginal_survival(object, formula, times = NULL, ...)

# S3 method for survfit
marginal_survival(object, times = NULL, ...)

Arguments

object

An object of the appropriate class.

...

Currently unused.

formula

A formula object as in survival::survfit. The right hand side of the formula should have a single strata term.

times

Unique times to compute survival probabilities at.

Value

An object of class marginal_survival, which is a dplyr::tibble containing the following columns:

{strata}

The name of the stratification variable. This will be the same as the name of the variable supplied by the user.

time

The time at which survival was evaluated.

surv

The survival probability.