BayesMFSurv
BayesMFSurv: An R Package to Estimate Bayesian Split-Population Survival Models With (and Without) Misclassified Failure Events - Published in JOSS (2020)
Science Score: 95.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
Found 5 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
✓Committers with academic emails
1 of 3 committers (33.3%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
misclassified-failure-estimates
survival
Last synced: 6 months ago
·
JSON representation
Repository
Bayesian Misclassified-Failure Survival Model
Basic Info
- Host: GitHub
- Owner: Nicolas-Schmidt
- License: other
- Language: R
- Default Branch: master
- Size: 2.65 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 1
Topics
misclassified-failure-estimates
survival
Created about 6 years ago
· Last pushed over 5 years ago
Metadata Files
Readme
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
## The `BayesMFSurv` package
_Minnie M. Joo, Nicolas Schmidt, Sergio Bejar, Bumba Mukherjee, Vineeta Yadav_
[](https://cran.r-project.org/package=BayesMFSurv)
`r badger::badge_devel("Nicolas-Schmidt/BayesMFSurv", "blue")`
[](https://github.com/Nicolas-Schmidt/BayesMFSurv/actions)
[](https://www.repostatus.org/#active)
[](https://travis-ci.com/Nicolas-Schmidt/BayesMFSurv)
[](https://www.r-pkg.org/pkg/BayesMFSurv)
[](https://www.r-pkg.org/pkg/BayesMFSurv)
[](https://zenodo.org/badge/latestdoi/226979997)
[](https://doi.org/10.21105/joss.02164)
### Description
Contains a split population survival estimator that models the misclassification probability of failure versus right-censored events. The split population survival estimator is described in Bagozzi et al. (2019) .
### Installation
You can install the released version (`0.1.0`) of `BayesMFSurv` from [CRAN](https://cran.r-project.org/) with:
``` r
install.packages("BayesMFSurv")
```
And the development version (`0.2.0`) from GitHub with:
``` r
if (!require("remotes")) install.packages("remotes")
remotes::install_github("Nicolas-Schmidt/BayesMFSurv")
```
## Functions
| Function |Description |
| ----------------- | -------------------------------------------------------------- |
|`mfsurv`|fits a parametric Bayesian MF model via Markov Chain Monte Carlo (MCMC) to estimate the probability of misclassification in the first stage and the hazard in the second stage. Slice sampling is employed to draw the posterior sample of the model's split and survival stage parameters.|
|`mcmcsurv` | estimates a Bayesian Exponential or Weibull survival model via Markov Chain Monte Carlo (MCMC). Slice samplig is employed to draw the posterior sample of the model's survival stage parameters.|
|`stats`|a function to calculate the deviance information criterion (DIC) and the log-likelihood for fitted model objects of class mfsurv or mcmcsurv.|
|`summary`|returns a summary of a mfsurv or mcmcsurv object via `coda::summary.mcmc`.|
### Example
The data used to estimate the following examples come from Reenock, Bernhard and Sobek (2007) -DOI: 10.111/j.1468-2478.2007.00469.x-. The RBS (2007) dataset uses continuous-time event history techniques to code episodes of democratic breakdown in all democracies from 1961 to 1995. In addition, it provides data on a number of economic and political variables.
|Variable| Description|
| ----------------- | -------------------------------------------------------------- |
|__calinv__|inverse of per capita daily caloric supply|
|__lnlevel__|natural log of economic development|
|__calileve__|inverse of per capita daily caloric supply*lnlevel|
|__necon__|economic performance|
|__presi__|presidential regime|
|__tag__|effective number of parties|
|__rel__|religious fractionalization|
|__ethn__|ethnic fractionalization|
|__prevdem__|numbers of previous democratic episodes|
|__openc__|trade openness|
|__Y__|years in current democratic episode |
|__Y0__|years in current democratic episode (lagged)|
|__C__|breakdown of democratic episode|
#### Misclassified-Failure
`mfsurv` estimated the probability of misclassification failure in the first (split) stage and hazard in the second (survival) stage.
`mfsurv` should be used when user suspects that data of survival cases could be right-sensored (i.e. when there is a probability that failure events are misclassified).
Example with N = 100000 is [here](https://github.com/Nicolas-Schmidt/BayesMFSurv/tree/master/data-raw).
```{r}
# Baseline Bayesian misclassified failure (MF) model.
# Misclassification stage only includes the intercept while the survival stage
# includes all covariates described above.
library(BayesMFSurv)
set.seed(95)
data(RBS)
RBS <- na.omit(RBS)
Y <- RBS$Y
X <- as.matrix(cbind(1, RBS[,1:10]))
C <- RBS$C
Z1 <- cbind(rep(1,nrow(RBS)))
Y0 <- RBS$Y0
model1 <- mfsurv(Y ~ X | C ~ Z1, Y0 = Y0,
N = 100,
burn = 50,
thin = 5,
w = c(0.5, 0.5, 0.5),
m = 20,
form = 'Weibull')
stats(model1)
summary(model1, parameter = c("betas"))
```
#### Non Misclassified-Failure
`mcmcsurv` estimates a Bayesian equivalent of standard survival models (i.e. Exponential or Weibull).
Example with N = 15000 can be found [here]( https://github.com/Nicolas-Schmidt/BayesMFSurv/tree/master/data-raw).
```{r}
set.seed(95)
model2 <- mcmcsurv(Y = Y, Y0 = Y0, C = C, X = X,
N = 100,
burn = 50,
thin = 5,
w = c(0.5, 0.5, 0.5),
m = 20,
form = 'Weibull')
stats(model2)
summary(model2, parameter = c("betas"))
```
#### Citation
To cite package`BayesMFSurv` in publications, please use:
```{r}
citation(package = 'BayesMFSurv')
```
Owner
- Name: Nicolás Schmidt
- Login: Nicolas-Schmidt
- Kind: user
- Location: Montevideo, Uruguay
- Company: DCP-Udelar | @UMAD-FCS
- Twitter: nicosch14
- Repositories: 4
- Profile: https://github.com/Nicolas-Schmidt
Political Scientist. Assistant professor at Department of Political Science (@dcpFCS), Universidad de la República (@Udelaruy) | co-founder @GURU-MV
JOSS Publication
BayesMFSurv: An R Package to Estimate Bayesian Split-Population Survival Models With (and Without) Misclassified Failure Events
Published
April 24, 2020
Volume 5, Issue 48, Page 2164
Authors
Minnie M. Joo
Dept. of Political Science, University of Massachusetts Lowell
Dept. of Political Science, University of Massachusetts Lowell
Vineeta Yadav
Dept. of Political Science, Pennsylvania State University
Dept. of Political Science, Pennsylvania State University
Bumba Mukherjee
Dept. of Political Science, Pennsylvania State University
Dept. of Political Science, Pennsylvania State University
Tags
survival analysis bayesian statisticsGitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Nicolas-Schmidt | n****b@g****m | 64 |
| Sergio Bejar | s****r@g****m | 49 |
| Daniel S. Katz | d****z@i****g | 2 |
Committer Domains (Top 20 + Academic)
ieee.org: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 5
- Total pull requests: 1
- Average time to close issues: 4 days
- Average time to close pull requests: 11 minutes
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 1.8
- Average comments per pull request: 1.0
- Merged pull requests: 1
- 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
- andybega (5)
Pull Request Authors
- danielskatz (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/setup-r master composite
DESCRIPTION
cran
- R >= 3.5.0 depends
- FastGP * imports
- MCMCpack * imports
- Rcpp >= 1.0.3 imports
- coda * imports
- mvtnorm * imports
- stats * imports
