Title: | Survival Analysis for Weighted Composite Endpoints |
---|---|
Description: | Analyze given data frame with multiple endpoints and return Kaplan-Meier survival probabilities together with the specified confidence interval. See Nabipoor M, Westerhout CM, Rathwell S, and Bakal JA (2023) <doi:10.1186/s12874-023-01857-0>. |
Authors: | Majid Nabipoor [aut] |
Maintainer: | Sarah Rathwell <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.2 |
Built: | 2025-03-13 04:16:39 UTC |
Source: | https://github.com/sarah-0k/wcep |
Create a plot of Kaplan-Meier curve with its specified confidence interval
## S3 method for class 'wcep' plot( x, main = " ", type = "n", lty = NULL, lwd = NULL, xlab = " ", ylab = "Survival Probability", xlim = NULL, ylim = NULL, cex = NULL, ... )
## S3 method for class 'wcep' plot( x, main = " ", type = "n", lty = NULL, lwd = NULL, xlab = " ", ylab = "Survival Probability", xlim = NULL, ylim = NULL, cex = NULL, ... )
x |
is an object of class "wcep" |
main |
title of plot |
type |
type of plot |
lty |
line type |
lwd |
line width |
xlab |
first axis label |
ylab |
second axis label |
xlim |
first axis limits |
ylim |
second axis limits |
cex |
legend font size |
... |
other parameters of generic "plot" have no use here setOldClass("wcep") |
A data set containing patient IDs, event types, event times, and gender of 100 patients.
toyexample
toyexample
A data frame with 104 rows and 4 columns
ID number of patients
Event Types: SHK as Shock, CHF as Congestive Heart Failure, REMI as Recurrent Myocardial Infarction, DTH as Death; and N as No event
Event Time (day)
Gender of patients, M as Male, F as Female
Armstrong P. W., Westerhout C. M., Van de Werf F., Califf R. M., Welsh R. C., Wilcox R. G., Bakal J. A. (2011) Refining clinical trial composite outcomes: an application to the Assessment of the Safety and Efficacy of a New Thrombolytic-3 (ASSENT-3) trial. American Heart Journal. 161(5) 848-854.
It is a generated example based on ASSENT-3: https://pubmed.ncbi.nlm.nih.gov/21570513
Analyze given data frame and return Kaplan-Meier survival probabilities together with the specified confidence interval.
wcep
modifies Kaplan-Meier curve by taking into account severity weights of different event. Alternative methods are Anderson Gill model and win ratio of composite outcomes.The function takes event dataset and user-specified severity weights to generate a modified Kaplan-Meier curve and comparison statistics based on the weighted composite endpoint method. The user supplies the event data set, the weights, and the factor to split on . The package will generate the weighted survival curve, confidence interval and test the differences between the two groups.
wcep(x, EW, alpha = 0.05, split = FALSE)
wcep(x, EW, alpha = 0.05, split = FALSE)
x |
This data frame usually has 3 columns. The first column specifies patient ID, which is a character or numeric vector, the second column is a factor with character values of event types. The third column is a numeric vector of event times. If split = TRUE, then the forth column is a character vector of split groups of at most two groups, like gender. |
EW |
This data frame has two columns. The first column specifies a character vector of event types. The second column specify weights. The naming of event types in x and EW should be exactly similar. |
alpha |
A numeric value between 0-1 which specifies the confidence level, if it is not specified, by default is 0.05. |
split |
A logical value of T or F which allows to compare two groups. |
Bakal J., Westerhout C. M., Armstrong P. W. (2015) Impact of weighted composite compared to traditional composite endpoints for the design of randomized controlled trails. Statistical Methods in Medicine Research. 24(6) 980-988.
Nabipoor M., Westerhout C. M., Rathwell S., Bakal J. (2023) The empirical estimate of the survival and variance using a weighted composite endpoint, BMC Medical Research Methodology. 23(35).
Majid Nabipoor: [email protected], Cynthia Westerhout: [email protected], Jeffrey Bakal: [email protected]
coxph
for Anderson Gill model
data(toyexample) #event weights EW <- data.frame(event = c('CHF','DTH','SHK','REMI'), weight = c(0.3,1,0.5,0.2)) res1 <- wcep(toyexample, EW) str(res1) res1$survival_probabilities plot(res1) #comparing two genders res2 <- wcep(toyexample, EW, split=TRUE) plot(res2) #wilcox and t test res2$Wilcoxontest res2$t_test
data(toyexample) #event weights EW <- data.frame(event = c('CHF','DTH','SHK','REMI'), weight = c(0.3,1,0.5,0.2)) res1 <- wcep(toyexample, EW) str(res1) res1$survival_probabilities plot(res1) #comparing two genders res2 <- wcep(toyexample, EW, split=TRUE) plot(res2) #wilcox and t test res2$Wilcoxontest res2$t_test