Description Usage Arguments Value Examples
This function creates a survival curve based on an sBG.est
model parameters.
1 | survivalCurve(alpha, beta, t = 96)
|
alpha |
Alpha parameter |
beta |
Beta parameter |
t |
iterations |
Returns a vector of survival percent estimates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
library(dplyr)
library(titanic)
titanic::titanic_train %>%
mutate(Deceased = ifelse(Survived == 1,0,1)) %>%
group_by(Age = round(Age,0)) %>%
summarise(Survived = sum(Survived), Deceased = sum(Deceased)) %>% {
sBG.est(
.$Survived[2:nrow(.)],
.$Deceased[2:nrow(.)]
)$par} %>% {
survivalCurve(.[1], .[2], 50)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.