The problem: Log minus log survival curves are widely used to assess the assumption of proportionality of hazards. While plotting these curves is available using the survival and survminer packages, it is currently unavailable in ggsurvfit.
Proposed solution: Add an option of type = "cloglog" to ggsurvfit::tidy_survfit.
Specifically, this would need to be added in the:
Function call
tidy_survfit <- function(x,
times = NULL,
type = c("survival", "risk", "cumhaz", "cloglog"))
Select transformation function
if (rlang::is_string(type)) {
.transfun <-
switch(type,
survival = function(y) y,
cuminc = function(y) y,
risk = function(y) 1 - y,
# survfit object contains an estimate for Cumhaz and SE based on Nelson-Aalen with or without correction for ties
# However, no CI is calculated automatically. For plotting, the MLE estimator is used for convenience.
cumhaz = function(y) -log(y),
cloglog = function(y) log(-log(y))
)
} else {
.transfun <- type
}
if (!rlang::is_function(.transfun)) {
cli_abort("The {.var type} argument must be one of {.val {c('survival', 'risk', 'cumhaz', 'cloglog')}}, or a function.")
}
The problem: Log minus log survival curves are widely used to assess the assumption of proportionality of hazards. While plotting these curves is available using the
survival
andsurvminer
packages, it is currently unavailable inggsurvfit
.Proposed solution: Add an option of
type = "cloglog"
toggsurvfit::tidy_survfit
. Specifically, this would need to be added in the:log(-log(1))
reaches infinity.Example of a figure using the
survival
packageExample of the desired figure using the
ggsurvfit
package