Estimate average treatment effects (ATE) from survival data. A Cox proportional hazards model (survival::coxph()) is used to estimate hazard ratios and Kaplan-Meier estimators (survival::survfit.formula()) are used to estimate survivor functions. surv_ate() estimates ATEs for a single group and map_surv_ate iterates over groups and estimates ATEs for each group. Confidence intervals for hazard ratios are estimated by clustering on id using the cluster option in coxph(). Estimates and confidences intervals are pooled using Rubin's rule when object contains weights from multiply imputed datasets.

surv_ate(
  object,
  ydata,
  response,
  id,
  double_adjustment = FALSE,
  ps_stratification = FALSE,
  n_strata = 10
)

map_surv_ate(
  object_list,
  ydata_list,
  response,
  id,
  double_adjustment = FALSE,
  grp_id,
  integer_grp_id = FALSE
)

Arguments

object, object_list

Either an object of class psweight or psweight_mi or a list of such objects.

ydata, ydata_list

Either a data frame containing the response variables for survival modeling or a list of such objects. Both object and ydata must contain the id variable.

response

A string containing the response for a survival model. This is the let hand side of a ~ operator.

id

The name of the column in object and ydata identifying each patient.

double_adjustment

If TRUE, then covariates (in addition to treatment assignment) are used in the Cox models.

ps_stratification

If TRUE, then models are fit that stratify on values of the propensity score, with the number of strata determined by n_strata. Default is FALSE.

n_strata

Number of strata to divide subjects into based on values of the propensity score.

Value

A dplyr::tibble with one row for each method in object. Each row contains the columns: method (the propensity score method), fit (tibble containing the fitted Cox model), loghr (tibble containing estimates of the log hazard ratio), and surv (A tibble containing estimated survival probabilities for both treatment and control).