survParamSim

Simulation of Parametric Survival Model with Prediction Intervals

https://github.com/yoshidk6/survparamsim

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 (15.7%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Simulation of Parametric Survival Model with Prediction Intervals

Basic Info
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • Open Issues: 6
  • Releases: 6
Created almost 7 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```
# survParamSim

[![R build status](https://github.com/yoshidk6/survParamSim/workflows/R-CMD-check/badge.svg)](https://github.com/yoshidk6/survParamSim/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/survParamSim)](https://cran.r-project.org/package=survParamSim)
[![downloads](https://cranlogs.r-pkg.org/badges/grand-total/survParamSim)](https://CRAN.R-project.org/package=survParamSim)

The goal of survParamSim is to perform survival simulation with parametric survival model generated from 'survreg' function in 'survival' package. 
In each simulation, coefficients are resampled from variance-covariance matrix of parameter estimates, in order to capture uncertainty in model parameters.


## Installation

You can install the package from CRAN.

```{r, eval = FALSE}
install.packages("survParamSim")
```

Alternatively, you can install the development version from GitHub.

```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("yoshidk6/survParamSim")
```

## Example

[This GitHub pages](https://yoshidk6.github.io/survParamSim/) contains function references and [vignette](https://yoshidk6.github.io/survParamSim/articles/survParamSim.html).
The example below is a sneak peek of example outputs. 

First, run survreg to fit parametric survival model:

```{r prep}
library(dplyr)
library(ggplot2)
library(survival)
library(survParamSim)

set.seed(12345)

# ref for dataset https://vincentarelbundock.github.io/Rdatasets/doc/survival/colon.html
colon2 <- 
  as_tibble(colon) %>% 
  # recurrence only and not including Lev alone arm
  filter(rx != "Lev",
         etype == 1) %>% 
  # Same definition as Lin et al, 1994
  mutate(rx = factor(rx, levels = c("Obs", "Lev+5FU")),
         depth = as.numeric(extent <= 2))
```
  
```{r fit}
fit.colon <- survreg(Surv(time, status) ~ rx + node4 + depth, 
                     data = colon2, dist = "lognormal")
```

Next, run parametric bootstrap simulation:

```{r sim}
sim <- 
  surv_param_sim(object = fit.colon, newdata = colon2, 
                 censor.dur = c(1800, 3000),
                 # Simulating only 100 times to make the example go fast
                 n.rep = 100)

sim
```

Calculate survival curves with prediction intervals:

```{r km_pi_group}
km.pi <- calc_km_pi(sim, trt = "rx", group = c("node4", "depth"))

km.pi
plot_km_pi(km.pi) +
  theme(legend.position = "bottom") +
  labs(y = "Recurrence free rate") +
  expand_limits(y = 0)
extract_medsurv_pi(km.pi) # Not implemented for calc_ave_km_pi yet; available for calc_km_pi
```

Calculate hazard ratios with prediction intervals:

```{r hr_pi}
hr.pi <- calc_hr_pi(sim, trt = "rx", group = c("depth"))

hr.pi
plot_hr_pi(hr.pi)
extract_hr_pi(hr.pi)
```


Owner

  • Name: Kenta Yoshida
  • Login: yoshidk6
  • Kind: user

Clinical Pharmacology Modeling & Simulation Scientist

GitHub Events

Total
  • Create event: 2
  • Issues event: 2
  • Release event: 1
  • Push event: 6
  • Pull request event: 1
Last Year
  • Create event: 2
  • Issues event: 2
  • Release event: 1
  • Push event: 6
  • Pull request event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 151
  • Total Committers: 3
  • Avg Commits per committer: 50.333
  • Development Distribution Score (DDS): 0.444
Top Committers
Name Email Commits
Kenta Yoshida 6****u@g****m 84
Kenta Yoshida y****6@g****m 36
Kenta Yoshida y****a@g****m 31
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 42
  • Total pull requests: 3
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 25 minutes
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 0.76
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: 8 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • yoshidk6 (41)
  • Kagedal (1)
Pull Request Authors
  • yoshidk6 (3)
Top Labels
Issue Labels
priority (1) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 557 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 1
cran.r-project.org: survParamSim

Parametric Survival Simulation with Parameter Uncertainty

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 557 Last month
Rankings
Stargazers count: 28.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Average: 33.6%
Dependent repos count: 35.5%
Downloads: 45.4%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4.0 depends
  • broom * imports
  • dplyr * imports
  • forcats * imports
  • ggplot2 * imports
  • lifecycle >= 0.2.0 imports
  • magrittr >= 1.5 imports
  • methods * imports
  • mvtnorm * imports
  • purrr * imports
  • rlang * imports
  • survival >= 2.43 imports
  • tibble * imports
  • tidyr >= 1.1 imports
  • knitr * suggests
  • rmarkdown * suggests
  • survminer * suggests
  • testthat >= 2.1.0 suggests
  • vdiffr * suggests
  • withr * suggests
.github/workflows/check-standard.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite