Skip to main content
. Author manuscript; available in PMC: 2018 Mar 19.
Published in final edited form as: R J. 2017 Dec 4;9(2):342–353.

Table 1.

Arguments for the rpsftm() function

rpsftm() arguments
formula a formula with a minimal structure of Surv(time,status) ~rand(arm,rx) where
  • arm is the randomised treatment arm

  • rx is the proportion of time spent on treatment, taking values in [0, 1].

Further terms can be added to the right hand side to adjust for covariates.
data an optional data frame containing the variables
censor_time variable or constant giving the time at which censoring would, or has occurred. This should be provided for all observations unlike standard Kaplan-Meier or Cox regression where it is only given for censored observations. If no value is given then re-censoring is not applied.
subset an expression indicating which subset of the rows of data should be used in the fit. This can be a logical vector, a numeric vector indicating which observation numbers are to be included, or a character vector of row names to be included. All observations are included by default.
na.action a missing-data filter function. This is applied to the model.frame after any subset argument has been used. Default is options()$na.action.
test one of survdiff, coxph or survreg. Describes the test to be used in the estimating equation. Default is survdiff.
low_psi the lower limit of the range to search for the causal parameter. Default is −1.
hi_psi the upper limit of the range to search for the causal parameter. Default is 1.
alpha the significance level used to calculate the confidence intervals. Default is 0.05.
treat_modifier an optional variable that ψ is multiplied by on an participant observation level to give differing impact to treatment. Default is 1.
autoswitch a logical to autodetect cases of no switching. Default is TRUE. If all observations in an arm have perfect compliance then re-censoring is not applied in that arm. If FALSE then re-censoring is applied regardless of perfect compliance.
n_eval_z The number of points between hi_psi and low_psi at which to evaluate the Z-statistics in the estimating equation. Default is 100.