survrct: Create RCT Survival Metadata

Description Usage Arguments Value See Also Examples

View source: R/estimator.R

Description

Compute metadata to be used for estimation of model-robust covariate adjusted restricted mean survival time and survival probability in a two-arm randomized controlled trial using targeted maximum likelihood estimation.

Usage

1
2
3
4
5
6
7
8
survrct(
  outcome.formula,
  trt.formula,
  data,
  coarsen = 1,
  algo = c("glm", "lasso", "rf", "xgboost"),
  crossfit = TRUE
)

Arguments

outcome.formula

An object of class "formula". The left hand side should be specified using Surv(time, status) where time is the name of the variable containing follow-up time and status is the name of the indicator variable with 0 = right censored and 1 = event at time. The right hand side should contain the target variable of interest and baseline prognostic covariates.

trt.formula

An object of class "formula". The left hand side should be the name of the binary (coded as 0 and 1) treatment variable. The right hand side should specify the names of variables used to estimate the propensity.

data

A data frame containing the variables in the model.

coarsen

An optional integer that specifies if and how time should be categorized into coarser intervals.

algo

Method to be used for fitting the hazard and censoring nuisance parameters. Automatically set to "glm" if less than two covariates for adjustment are specified in outcome.formula. The propensity is always estimated using a GLM.

crossfit

Should the estimator be crossfit? Ignored if algo is "glm" or "lasso".

Value

An R6 object of class "Survival".

See Also

Other survrct functions: rmst(), survprob()

Examples

1
2
survrct(Surv(days, event) ~ A + age + sex + dyspnea + bmi,
        A ~ 1, data = c19.tte)

nt-williams/survrct documentation built on July 29, 2021, 7:46 a.m.