untreated: Untreated Event Time

View source: R/untreated.R

untreatedR Documentation

Untreated Event Time

Description

Calculates the counterfactual untreated event time, possibly using the recensoring method, assuming a given parameter value and returns a Surv() object

Usage

untreated(psi, time, delta, censor_time, rx, arm, autoswitch)

Arguments

psi

the parameter that measures how more rapidly the lifetime is expended under treatment

time

the observed failure or censoring time.

delta

the status of the time: 1 = observed, 0 = censored.

censor_time

the theoretical censoring time, either observed or set after time. Set to Inf to ignore recensoring.

rx

the proportion of time spent on treatment

arm

the randomised arm. Either a numerical indicator, with 0 as the placebo, or a factor with the lowest level as placebo.

autoswitch

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.

Value

A Surv() object

Author(s)

Simon Bond


rpsftm documentation built on May 29, 2024, 2:37 a.m.