knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of {riskybiz} is to provide both a formula framework for creating competing risks regression objects and also output useful components such as model.frame
that the original {cmprsk} package does not provide.
The {riskybiz} package was written as a wrapper/enhancer to the {cmprsk} package.
To install the development version of {riskybiz}
install.packages("remotes") remotes::install_github("margarethannum/riskybiz")
The standard cmprsk::crr()
function has specific input requirements.
library(riskybiz) trial <- na.omit(trial) #original crr covars <- model.matrix(~ age + factor(trt) + factor(grade), trial)[,-1] ftime1 <- trial$ttdeath fstatus1 <- trial$death_cr mod_orig <- crr(ftime=ftime1, fstatus = fstatus1, cov1 = covars)
Output of model does not contain elements like model.frame
since the function does not take a data.frame
as input.
summary(mod_orig)
Using our wrapper function riskybiz::crr()
allows for inputting an intuitive formula and data, which allows for downstream functions.
# using new wrapper function, accepts data and formula mod_new <- crr(Surv(ttdeath, death_cr) ~ age + trt + grade, trial) head(model.frame(mod_new)) tidy(mod_new)
Please note that the {riskybiz} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms. A big thank you to all contributors!
r usethis::use_tidy_thanks(from = "1970-01-01") %>% {glue::glue("[@{.}](https://github.com/{.})")} %>% glue::glue_collapse(sep = ", ", last = ", and ")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.