diff_survival_time_quantile {TSDT} | R Documentation |
diff_survival_time_quantile
Description
Computes the difference in the quantile of a survival function across treatment groups.
Usage
diff_survival_time_quantile(data, scoring_function_parameters = NULL)
Arguments
data |
data.frame containing response data |
scoring_function_parameters |
named list of scoring function control parameters |
Details
Computes the survival function quantile for the treatment and control arms and returns the difference.
Value
A difference in a survival time quantile across treatment arms.
See Also
TSDT, survival_time_quantile, Surv, coxph, survfit, survreg, predict.coxph, predict.survreg
Examples
requireNamespace( "survival", quiet = TRUE )
N <- 200
df <- data.frame( y = survival::Surv( runif( min = 0, max = 20, n = N ),
sample( c(0,1), size = N, prob = c(0.2,0.8), replace = TRUE ) ),
trt = sample( c('Control','Experimental'), size = N,
prob = c(0.4,0.6), replace = TRUE ) )
## Compute difference in median survival time between Experimental arm and
## Control arm. It is not actually necessary to provide the value for the
## time_var, trt_var, trt_control, and percentile parameters because these
## values are all equal to their default values. The value are explicitly
## provided here simply for clarity.
ex1 <- diff_survival_time_quantile( data = df,
scoring_function_parameters = list( trt_var = "trt",
trt_control = "Control",
percentile = 0.50 ) )
## Compute difference in Q1 survival time. In this example the default value
## for all scoring function parameters are used except percentile, which here
## takes the value 0.25.
ex2 <- diff_survival_time_quantile( data = df,
scoring_function_parameters = list( percentile = 0.25 ) )
[Package TSDT version 1.0.7 Index]