-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
80 lines (55 loc) · 2.63 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# riskybiz
<!-- badges: start -->
[![Travis build status](https://travis-ci.org/margarethannum/riskybiz.svg?branch=master)](https://travis-ci.org/margarethannum/riskybiz)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/margarethannum/riskybiz?branch=master&svg=true)](https://ci.appveyor.com/project/margarethannum/riskybiz)
[![Codecov test coverage](https://codecov.io/gh/margarethannum/riskybiz/branch/master/graph/badge.svg)](https://codecov.io/gh/margarethannum/riskybiz?branch=master)
[![Lifecycle:
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
<!-- badges: end -->
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}
```{r eval = FALSE}
install.packages("remotes")
remotes::install_github("margarethannum/riskybiz")
```
# Example
The standard `cmprsk::crr()` function has specific input requirements.
```{r eval=TRUE}
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.
```{r}
summary(mod_orig)
```
Using our wrapper function `riskybiz::crr()` allows for inputting an intuitive formula and data, which allows for downstream functions.
```{r}
# 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](https://github.com/margarethannum/riskybiz/CODE_OF_CONDUCT.html). 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 ")`