Analyse the Dataset using difference or quotient of milestone survival
Source:R/analyse_milestone_survival.R
analyse_milestone_survival.RdAnalyse the Dataset using difference or quotient of milestone survival
Details
The implementation from the nph package is used, see the documentation there for details.
alternative can be "two.sided" for a two sided test of equality of the
summary statistic or "one.sided" for a one sided test testing H0: treatment
has equal or shorter survival than control vs. H1 treatment has longer
survival than control.
The data.frame returned by the created function includes the follwing columns:
milestone_surv_ratio/milestone_surv_diffratio or differnce of survival probabilitiestimesfollowup times at which the the survival are comparedN_patnumber of patientsN_evtnumber of eventspp value for the H0 that the ratios are 1 or the differnce is 0 respectivelyalternativethe alternative usedmilestone_surv_ratio_lower/milestone_surv_diff_lowerupper/lower CI for the estimatemilestone_surv_ratio_upper/milestone_surv_diff_upperupper/lower CI for the estimateCI_levelthe CI level used
Examples
condition <- merge(
assumptions_delayed_effect(),
design_fixed_followup(),
by=NULL
) |>
head(1)
dat <- generate_delayed_effect(condition)
analyse_milestone_survival(3:5)(condition, dat)
#> Warning: replacement has length zero
#> $p
#> [1] NA
#>
#> $alternative
#> [1] "two.sided"
#>
#> $milestone_surv_ratio
#> [1] NA
#>
#> $milestone_surv_ratio_lower
#> [1] NA
#>
#> $milestone_surv_ratio_upper
#> [1] NA
#>
#> $CI_level
#> [1] 0.95
#>
#> $times
#> [1] 3 4 5
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>
analyse_milestone_survival(3:5, what="diff")(condition, dat)
#> Warning: replacement has length zero
#> $p
#> [1] NA
#>
#> $alternative
#> [1] "two.sided"
#>
#> $milestone_surv_diff
#> [1] NA
#>
#> $milestone_surv_diff_lower
#> [1] NA
#>
#> $milestone_surv_diff_upper
#> [1] NA
#>
#> $CI_level
#> [1] 0.95
#>
#> $times
#> [1] 3 4 5
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>