Description Usage Arguments Value Author(s) References See Also Examples
This function is a wrapper around survival::survfit.formula
to perform a Kaplan-Meier analysis,
based on the expected ADaM Basic Data Structure (BDS) for Time-to-Event analysis and assuming right-censored data.
The function expects that the data has been filtered on the PARAM/PARAMCD of interest.
Alternatively, PARAM/PARAMCD can be used in the strata
argument.
The result is an object of class survfit
which can be used in downstream functions and methods that rely on the survfit
class.
By default:
The Kaplan Meier estimate is estimated directly (stype = 1).
The cumulative hazard is estimated using the Nelson-Aalen estimator (ctype = 1): H.tilde = cumsum(x$n.event/x$n.risk). The MLE (H.hat(t) = -log(S.hat(t))) can't be requested.
A two-sided pointwise 0.95 confidence interval is estimated using a log transformation (conf.type = "log").
1 |
data |
The name of the ADaM Basic Data Structure (BDS) for Time-to-Event analysis eg ADTTE. Rows in which AVAL or CNSR contain NA, are removed during analysis. |
strata |
Character vector, representing the strata for Time-to-Event analysis eg TRT01P. When NULL, an overall analysis is performed. Default is NULL. |
... |
additional arguments passed on to the ellipsis of the call |
survfit object, extended by elements PARAM/PARAMCD, ready for downstream processing in estimation or visualization functions and methods.
Steven Haesendonckx
https://https://github.com/therneau/survival
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(survival)
library(dplyr)
library(tidyr)
## No stratification
vr_KM_est(data = adtte)
## Stratified Kaplan-Meier analysis by `TRTP`
vr_KM_est(data = adtte, strata = "TRTP")
## Stratified Kaplan-Meier analysis by `TRTP` and `SEX`
vr_KM_est(data = adtte, strata = c("TRTP", "SEX"))
## Stratification with one level
vr_KM_est(data = adtte, strata = "PARAMCD")
## Analysis on subset of adtte
vr_KM_est(data = adtte[adtte$SEX == "F", ])
## Modify the default analysis by using the ellipsis
vr_KM_est(data = adtte, strata = NULL, type = "kaplan-meier", conf.int = F, timefix = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.