Description Usage Arguments Details Value Author(s) Examples
rpsftm
implements the rank preserving structural failure time model presented by Robins and Tsiatis (1991) and again by Korhonen et al (2012).
1 2 |
T |
Total follow-up time contributed by each patient. This is typically the min(T,C), where T is the event time and C is the censoring time. |
A |
Total time each subject spends on active treatment. For subjects who are never exposed to active treatment (i.e. they are randomized to and remain in the placebo group), this value will be 0. For subjects remaining in the active treatment group during their entire follow-up, this will be equal to |
R |
Indicator of treatment group initially randomized to. This is a binary variable that takes on value 1 if the subject was randomized to treatment and 0 if the subject was randomized to the control group. |
C |
The observed censoring time. The model assumes that if a subject experiences a failure prior to observing the censoring time, then the censoring time would be the time from randomization until the end of study. It also assumes that censoring is independent of treatment assignment |
Y |
Indicator of observed failure event. This is a binary variable that takes on value 1 if the event is observed and 0 otherwise. N |
id |
Cluster identification variable. This is used to label the counterfactual survival times. |
strata |
Strata that each id is assigned to. |
psi |
Grid of potential parameter values to estimate over. By default, the grid is set to |
weight |
Observational weights. |
Data should be provided to the function in a longitudinal format, with the indicator of final outcome Y
being constant across all observations from the same individual. T
is the interval specific time contributed while on the specific treatment TX
.
From the potential values of psi, the function will return an object of class rpfstm
, which includes (1) the statistics for the counterfactual distribution, (2) the empirical values for the counterfactual distribution off treatment, and (3) the summarized data for time spent both on and off treatment. The summarized data returned is ordered by id
, with numeric IDs converted to character form.
For the statistics, the following values are reported
log-rank statistic from the Kaplan Meier curve
log-rank p-value from the Kaplan Meier curve
Wilcoxon statistic from the Kaplan Meier curve
Wilcoxon p-value from the Kaplan Meier curve
Cox Wald statistic from the proportional hazards model
Cox Wald p-value from the proportional hazards model
Cox likelihood ratio test statistic from the proportional hazards model
Cox likelihood ratio test p-value from the proportional hazards model
Cox hazard ratio from the proportional hazards model
Cox hazard ratio z-statistic from the proportional hazards model
Cox hazard ratio p-value from the proportional hazards model
For the counterfactual distribution off treatment, the counterfactual survival times and indicators of failure are calculated for each of the psi values provided to the function.
Linh Tran
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Simulated data under no crossover or censoring
set.seed(1)
n = 100
R = rbinom(n, 1, 0.5)
T0 = rexp(n, .05)
T = ifelse(R==0, T0, exp(0.2)*T0)
A = ifelse(R==0, 0, T)
rpsftmFit1 = rpsftm(T, A, R, C=rep(Inf, n), Y=rep(1,n), id=seq(1,n), psi=seq(-3,3,.01))
rpsftmFit1
plot(rpsftmFit1)
# Simulated data under placebo crossover halfway through follow-up (no censoring)
set.seed(1)
n = 100
R = rbinom(n, 1, 0.5)
crossover = ifelse(R==1, 0, rbinom(n, 1, 0.5))
T0 = rexp(n, .05)
T = ifelse(R==0, ifelse(crossover==1, T0/2+exp(0.2)*(T0/2), T0), exp(0.2)*T0)
A = ifelse(R==0, ifelse(crossover==1, exp(0.2)*(T0/2), 0), T)
rpsftmFit2 = rpsftm(T, A, R, C=rep(Inf, n), Y=rep(1,n), id=seq(1,n), psi=seq(-3,3,.01))
rpsftmFit2
plot(rpsftmFit2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.