Calculates the counterfactual untreated event time, possibly using the recensoring method, assuming a given parameter value and returns a Surv() object
untreated(psi, time, delta, censor_time, rx, arm, autoswitch)A Surv() object
the parameter that measures how more rapidly the lifetime is expended under treatment
the observed failure or censoring time.
the status of the time: 1 = observed, 0 = censored.
the theoretical censoring time, either observed or set after time. Set to Inf to ignore recensoring.
the proportion of time spent on treatment
the randomised arm. Either a numerical indicator, with 0 as the placebo, or a factor with the lowest level as placebo.
a logical to autodetect cases of no switching. If TRUE, then if all observations in an arm have perfect compliance then recensoring is not applied in that arm. If FALSE the recensoring is applied regardless of perfect compliance.
Simon Bond