https://github.com/clevelandclinicqhs/qhscrnomo
An R package to construct nomograms from competing risks regression models
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.5%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
An R package to construct nomograms from competing risks regression models
Basic Info
- Host: GitHub
- Owner: ClevelandClinicQHS
- License: gpl-3.0
- Language: R
- Default Branch: main
- Size: 489 KB
Statistics
- Stars: 8
- Watchers: 0
- Forks: 1
- Open Issues: 0
- Releases: 1
Created over 3 years ago
· Last pushed 12 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# QHScrnomo
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](https://CRAN.R-project.org/package=QHScrnomo)

[Nomograms](https://en.wikipedia.org/wiki/Nomogram) serve as practical, useful tools and communication devices in the context of clinical decision making that enable clinicians to quickly understand and gauge individual patients' risk of outcomes from (potentially) complex statistical models. The goal of `QHScrnomo` is to provide functionality to construct [nomograms](https://rdrr.io/cran/rms/man/nomogram.html) in the context of time-to-event (survival) analysis in the presence of competing risks. It also contains functions to build, validate, and summarize these models.
## Installation
You can install the development version of QHScrnomo from [GitHub](https://github.com/) with:
``` r
devtools::install_github("ClevelandClinicQHS/QHScrnomo")
```
Or from CRAN:
``` r
install.packages("QHScrnomo")
```
### Dependencies
This package has its most prominent dependencies on the [`rms`](https://CRAN.R-project.org/package=rms) package. In fact, it actually _Depends_ on it (see `DESCRIPTION`), so that package will load with `QHScrnomo`. It also makes heavy usage of [`cmprsk`](https://CRAN.R-project.org/package=cmprsk) and [`Hmisc`](https://CRAN.R-project.org/package=Hmisc) (which comes with `rms`). All methodology implemented here comes from these packages, so they should serve as a resource to further understand what is happening behind the scenes of `QHScrnomo`.
## Example
The following is an example of how to construct a nomogram from a competing risks regression model. First, we'll load the package.
```{r example}
library(QHScrnomo)
```
### 1. Fit the regression model
Start by fitting a Cox proportional-hazards model.
```{r}
# Register the data set
dd <- datadist(prostate.dat)
options(datadist = "dd")
# Fit the Cox-PH model for prostate cancer-specific mortality
prostate.f <- cph(Surv(TIME_EVENT,EVENT_DOD == 1) ~ TX + rcs(PSA,3) +
BX_GLSN_CAT + CLIN_STG + rcs(AGE,3) +
RACE_AA, data = prostate.dat,
x = TRUE, y= TRUE, surv=TRUE, time.inc = 144)
```
Then convert (adjust) it to account for the presence of competing risks.
```{r}
# Refit to a competing risks regression to account for death from other causes
prostate.crr <- crr.fit(prostate.f, cencode = 0, failcode = 1)
anova(prostate.crr)
```
### 2. Validate model output
We can generate cross-validated risk predictions at a particular time horizon of interest.
```{r}
# Generate the cross-validated probability of the event of interest
set.seed(123)
prostate.dat$preds.tenf <- tenf.crr(prostate.crr, time = 120, trace = FALSE) # 120 = 10 years
str(prostate.dat$preds.tenf)
```
And then check the discrimination of those probabilities via the _concordance index_.
```{r}
with(prostate.dat, cindex(preds.tenf, EVENT_DOD, TIME_EVENT, type = "crr"))["cindex"]
```
### 3. Construct the nomogram
Finally, we can build the nomogram that can be used to quickly generate model predictions manually.
```{r nomogram, fig.width=7, fig.height=6}
# Set some nice display labels (also see ?Newlevels)
prostate.g <-
Newlabels(
fit = prostate.crr,
labels =
c(
TX = "Treatment options",
PSA = "PSA (ng/mL)",
BX_GLSN_CAT = "Biopsy Gleason Score Sum",
CLIN_STG = "Clinical Stage",
AGE = "Age (Years)",
RACE_AA = "Race"
)
)
# Construct the nomogram
nomogram.crr(
fit = prostate.g,
failtime = 120,
lp = FALSE,
xfrac = 0.65,
fun.at = seq(0.2, 0.45, 0.05),
funlabel = "Predicted 10-year risk"
)
```
Owner
- Name: Cleveland Clinic Quantitative Health Sciences
- Login: ClevelandClinicQHS
- Kind: organization
- Email: QHSGitHubAdmin@ccf.org
- Location: United States of America
- Website: https://www.lerner.ccf.org/quantitative-health/
- Repositories: 12
- Profile: https://github.com/ClevelandClinicQHS
Open-source projects from the Department of Quantitative Health Sciences at Cleveland Clinic
GitHub Events
Total
- Create event: 1
- Issues event: 1
- Release event: 1
- Push event: 1
Last Year
- Create event: 1
- Issues event: 1
- Release event: 1
- Push event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Alex Zajichek | a****k@A****l | 28 |
| Alex Zajichek | a****k@g****m | 2 |
Issues and Pull Requests
Last synced: over 2 years ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- zajichek (2)
Pull Request Authors
Top Labels
Issue Labels
bug (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 373 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: QHScrnomo
Construct Nomograms for Competing Risks Regression Models
- Homepage: https://github.com/ClevelandClinicQHS/QHScrnomo
- Documentation: http://cran.r-project.org/web/packages/QHScrnomo/QHScrnomo.pdf
- License: GPL (≥ 3)
-
Latest release: 3.0.2
published 12 months ago
Rankings
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 47.7%
Downloads: 77.8%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- rms * depends
- Hmisc * imports
- cmprsk * imports
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests