knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

riskybiz

Travis build status AppVeyor build status Codecov test coverage Lifecycle:
maturing

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.

Installation

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

Example

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)

Contributing

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("[&#x0040;{.}](https://github.com/{.})")} %>% glue::glue_collapse(sep = ", ", last = ", and ")



margarethannum/riskybiz documentation built on Dec. 18, 2019, 5:37 a.m.