wcep | R Documentation |

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)
```

`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: nabipoor@ualberta.ca, Cynthia Westerhout: cindy.westerhout@ualberta.ca, Jeffrey Bakal: jbakal@ualberta.ca

`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
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.