Learn R Programming

PSsurvival (version 0.2.0)

validate_censor_formula: Validate Censoring Formula

Description

Checks that the censoring formula is valid, uses Surv() notation, and extracts the time and event variable names.

Usage

validate_censor_formula(censor_formula)

Value

A list containing:

formula

The validated formula object, or NULL if RHS is 0 (no censoring adjustment)

time_var

Character string of the time variable name

event_var

Character string of the event variable name

Arguments

censor_formula

A formula object for the censoring model. Should be of the form `Surv(time, event) ~ covariates`. Use `Surv(time, event) ~ 0` to indicate no censoring adjustment (all censoring scores set to 1).