bayesmsm
An R package for Bayesian Marginal Structural Models
Science Score: 36.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
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.6%) to scientific vocabulary
Keywords
bayesian-methods
causal-inference
marginal-structural-models
r
Last synced: 6 months ago
·
JSON representation
Repository
An R package for Bayesian Marginal Structural Models
Basic Info
- Host: GitHub
- Owner: Kuan-Liu-Lab
- License: other
- Language: R
- Default Branch: main
- Homepage: https://kuan-liu-lab.github.io/bayesmsm/
- Size: 12.6 MB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
bayesian-methods
causal-inference
marginal-structural-models
r
Created over 2 years ago
· Last pushed 8 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
editor_options:
chunk_output_type: inline
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
out.width = "100%"
)
```
## bayesmsm
# Overview
*bayesmsm* is an R package that implements the Bayesian marginal structural models to estimate average treatment effect for drawing causal inference with time-varying treatment assignment and confounding with extension to handle informative right-censoring. The Bayesian marginal structural models is a semi-parametric approach and features a two-step estimation process. The first step involves Bayesian parametric estimation of the time-varying treatment assignment models and the second step involves non-parametric Bayesian bootstrap to estimate the average treatment effect between two distinct treatment sequences of interest.
Reference paper on Bayesian marginal structural models:
- Saarela, O., Stephens, D. A., Moodie, E. E., & Klein, M. B. (2015). On Bayesian estimation of marginal structural models. Biometrics, 71(2), 279-288.
- Liu, K., Saarela, O., Feldman, B. M., & Pullenayegum, E. (2020). Estimation of causal effects with repeatedly measured outcomes in a Bayesian framework. Statistical methods in medical research, 29(9), 2507-2519.
# Installation
Install using `devtools` package:
```{r echo=TRUE, eval=FALSE}
## install.packages(devtools) ## make sure to have devtools installed
devtools::install_github("Kuan-Liu-Lab/bayesmsm")
library(bayesmsm)
```
# Dependency
This package depends on the following R packages:
- `MCMCpack`
- `doParallel`
- `foreach`
- `parallel`
- `R2jags`
- `coda`
# Quick Start
Here are some examples demonstrating how to use the `bayesmsm` package:
```{r echo=TRUE, eval=FALSE}
# Load example data without right-censoring
testdata <- read.csv(system.file("extdata",
"sim_causal.csv",
package = "bayesmsm"))
# Calculate Bayesian weights
weights <- bayesweight(
trtmodel.list = list(
A1 ~ L11 + L21,
A2 ~ L11 + L21 + L12 + L22 + A1,
A3 ~ L11 + L21 + L12 + L22 + A1 + L13 + L23 + A2
),
data = testdata,
n.chains = 2,
n.iter = 250,
n.burnin = 150,
n.thin = 5,
seed = 890123,
parallel = TRUE
)
# Perform Bayesian non-parametric bootstrap
model <- bayesmsm(
ymodel = Y ~ A1 + A2 + A3,
nvisit = 3,
reference = c(rep(0,3)),
comparator = c(rep(1,3)),
treatment_effect_type = "sq",
family = "binomial",
data = testdata,
wmean = weights$weights,
nboot = 1000,
optim_method = "BFGS",
seed = 890123,
parallel = TRUE,
ncore = 2
)
# View model summary
summary.bayesmsm(model)
```
# License
This package is licensed under the MIT License. See the LICENSE file for details.
# Citation
Please cite our software using:
```
@Manual{,
title = {bayesmsm: An R package for longitudinal causal analysis using Bayesian Marginal Structural Models},
author = {Xiao Yan and Martin Urner and Kuan Liu},
year = {2024},
note = {https://github.com/Kuan-Liu-Lab/bayesmsm},
url = {https://kuan-liu-lab.github.io/bayesmsm/},
}
```
# Contact
* e-mail: ,
* Please report bugs by opening an [issue](https://github.com/Kuan-Liu-Lab/bayesmsm/issues/new).
Owner
- Name: Kuan-Liu-Lab
- Login: Kuan-Liu-Lab
- Kind: organization
- Repositories: 1
- Profile: https://github.com/Kuan-Liu-Lab
GitHub Events
Total
- Issues event: 8
- Watch event: 4
- Push event: 55
- Fork event: 1
Last Year
- Issues event: 8
- Watch event: 4
- Push event: 55
- Fork event: 1
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Kuan Liu | k****u@m****a | 48 |
| XiaoYan-Clarence | c****a@g****m | 37 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
Packages
- Total packages: 1
-
Total downloads:
- cran 147 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: bayesmsm
Fitting Bayesian Marginal Structural Models for Longitudinal Observational Data
- Homepage: https://github.com/Kuan-Liu-Lab/bayesmsm
- Documentation: http://cran.r-project.org/web/packages/bayesmsm/bayesmsm.pdf
- License: MIT + file LICENSE
-
Latest release: 1.0.0
published 8 months ago
Rankings
Dependent packages count: 26.2%
Dependent repos count: 32.3%
Average: 48.3%
Downloads: 86.5%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran