Science Score: 49.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 4 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (21.2%) to scientific vocabulary
Keywords
bayesian-inference
panel-data
r
r-package
rstats
stan
statistical-models
Last synced: 6 months ago
·
JSON representation
Repository
Bayesian Inference of Complex Panel Data
Basic Info
- Host: GitHub
- Owner: ropensci
- License: gpl-3.0
- Language: R
- Default Branch: main
- Homepage: https://docs.ropensci.org/dynamite/
- Size: 200 MB
Statistics
- Stars: 34
- Watchers: 4
- Forks: 1
- Open Issues: 5
- Releases: 4
Topics
bayesian-inference
panel-data
r
r-package
rstats
stan
statistical-models
Created almost 4 years ago
· Last pushed 8 months ago
Metadata Files
Readme
Changelog
Contributing
License
Codemeta
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.align = "center",
fig.width = 9,
fig.height = 6
)
```
```{r srr-tags, eval = FALSE, echo = FALSE}
#' @srrstats {G1.1, G1.2}
```
# dynamite: Bayesian Modeling and Causal Inference for Multivariate Longitudinal Data
[](https://www.repostatus.org/#active)
[](https://github.com/ropensci/dynamite/actions)
[](https://app.codecov.io/gh/ropensci/dynamite?branch=main)
[](https://github.com/ropensci/software-review/issues/554)
[](https://ropensci.r-universe.dev)
[](https://cran.r-project.org/package=dynamite)
The `dynamite` [R](https://www.r-project.org/) package provides an easy-to-use interface for Bayesian inference of complex panel (time series) data comprising of multiple measurements per multiple individuals measured in time via dynamic multivariate panel models (DMPM). The main features distinguishing the package and the underlying methodology from many other approaches are:
* Support for regular time-invariant effects, group-level random effects, and time-varying effects modeled via Bayesian P-splines.
* Joint modeling of multiple measurements per individual (multiple channels) based directly on the assumed data-generating process. Individual channels can be univariate or multivariate.
* Support for various distributions: Currently Gaussian, Multivariate Gaussian, Student t, Categorical, Ordered, Multinomial, Poisson, Bernoulli, Binomial, Negative Binomial, Gamma, Exponential, and Beta distributions are available, and these can be combined arbitrarily in multichannel models.
* Allows evaluating realistic long-term counterfactual predictions that take into account the dynamic structure of the model by efficient posterior predictive distribution simulation.
* Transparent quantification of parameter and predictive uncertainty due to a fully Bayesian approach.
* Various visualization methods including a method for drawing and producing a TikZ code of the directed acyclic graph (DAG) of the model structure.
* User-friendly and efficient R interface with state-of-the-art estimation via Stan. Both `rstan` and `cmdstanr` backends are supported, with both parallel chains and within-chain parallelization.
The `dynamite` package is developed with the support of the Research Council of Finland grant 331817 ([PREDLIFE](https://sites.utu.fi/predlife/en/)). For further information on DMPMs and the `dynamite` package, see the related papers:
* Helske J. and Tikka S. (2024). Estimating Causal Effects from Panel Data with Dynamic Multivariate Panel Models. *Advances in Life Course Research*, 60, 100617. ([Journal version](https://doi.org/10.1016/j.alcr.2024.100617), [SocArXiv](https://doi.org/10.31235/osf.io/mdwu5) preprint)
* Tikka S. and Helske J. (2024). `dynamite`: An R Package for Dynamic Multivariate Panel Models. ([arXiv](https://arxiv.org/abs/2302.01607) preprint)
## Installation
You can install the most recent stable version of `dynamite` from [CRAN](https://cran.r-project.org/package=dynamite) or the development version from [R-universe](https://r-universe.dev/search) by running one the following lines:
```{r, eval = FALSE}
install.packages("dynamite")
install.packages("dynamite", repos = "https://ropensci.r-universe.dev")
```
## Example
A single-channel model with time-invariant effect of `z`, time-varying effect of `x`, lagged value of the response variable `y` and a group-specific random intercepts:
```{r, echo = FALSE}
library("dynamite")
ggplot2::theme_set(ggplot2::theme_bw())
```
```{r, eval = FALSE}
set.seed(1)
library("dynamite")
gaussian_example_fit <- dynamite(
obs(y ~ -1 + z + varying(~ x + lag(y)) + random(~1), family = "gaussian") +
splines(df = 20),
data = gaussian_example, time = "time", group = "id",
iter = 2000, chains = 2, cores = 2, refresh = 0
)
```
```{r, echo = FALSE}
set.seed(1)
library("dynamite")
gaussian_example_fit <- update(
gaussian_example_fit,
iter = 2000, warmup = 1000, thin = 1,
chains = 2, cores = 2, refresh = 0
)
```
Summary of the model:
```{r}
print(gaussian_example_fit)
```
Posterior estimates of time-varying effects:
```{r, fig.width = 9, fig.height = 4}
plot(gaussian_example_fit, types = c("alpha", "delta"), scales = "free")
```
And group-specific intercepts (for first 10 groups):
```{r, fig.width = 9, fig.height = 4}
plot(gaussian_example_fit, types = "nu", groups = 1:10)
```
Traceplots and density plots for time-invariant parameters:
```{r, fig.width = 9, fig.height = 4}
plot(gaussian_example_fit, plot_type = "trace", types = "beta")
```
Posterior predictive samples for the first 4 groups (using the samples based on the posterior distribution of the model parameters and observed data on the first time point):
```{r, warning=FALSE, fig.width = 9, fig.height = 4}
library("ggplot2")
pred <- predict(gaussian_example_fit, n_draws = 100)
pred |>
dplyr::filter(id < 5) |>
ggplot(aes(time, y_new, group = .draw)) +
geom_line(alpha = 0.25) +
# observed values
geom_line(aes(y = y), colour = "tomato") +
facet_wrap(~id) +
theme_bw()
```
Visualizing the model structure as a DAG (a snapshot at time `t`):
```{r, fig.width = 4, fig.height = 4}
plot(gaussian_example_fit, plot_type = "dag", show_covariates = TRUE)
```
For more examples, see the package vignettes and the [blog post about dynamite](https://ropensci.org/blog/2023/01/31/dynamite-r-package/).
## Related packages
- The `dynamite` package uses Stan via [`rstan`](https://CRAN.R-project.org/package=rstan) and [`cmdstanr`](https://mc-stan.org/cmdstanr/) (see also https://mc-stan.org), which is a probabilistic programming language for general Bayesian modelling.
- The [`brms`](https://CRAN.R-project.org/package=brms) package also uses Stan, and can be used to fit various complex multilevel models.
- Regression modeling with time-varying coefficients based on kernel smoothing and least squares estimation is available in package [`tvReg`](https://CRAN.R-project.org/package=tvReg). The [`tvem`](https://CRAN.R-project.org/package=tvem) package provides similar functionality for gaussian, binomial and poisson responses with [`mgcv`](https://CRAN.R-project.org/package=mgcv) backend.
- [`plm`](https://CRAN.R-project.org/package=plm) contains various methods to estimate linear models for panel data, e.g., fixed effect models.
- [`lavaan`](https://CRAN.R-project.org/package=lavaan) provides tools for structural equation modeling, and as such can be used to model various panel data models as well.
## Contributing
Contributions are very welcome, see [CONTRIBUTING.md](https://github.com/ropensci/dynamite/blob/main/.github/CONTRIBUTING.md) for general guidelines.
Owner
- Name: rOpenSci
- Login: ropensci
- Kind: organization
- Email: info@ropensci.org
- Location: Berkeley, CA
- Website: https://ropensci.org/
- Twitter: rOpenSci
- Repositories: 307
- Profile: https://github.com/ropensci
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "dynamite",
"description": "Easy-to-use and efficient interface for Bayesian inference of complex panel (time series) data using dynamic multivariate panel models by Helske and Tikka (2024) <doi:10.1016/j.alcr.2024.100617>. The package supports joint modeling of multiple measurements per individual, time-varying and time-invariant effects, and a wide range of discrete and continuous distributions. Estimation of these dynamic multivariate panel models is carried out via 'Stan'. For an in-depth tutorial of the package, see (Tikka and Helske, 2024) <doi:10.48550/arXiv.2302.01607>.",
"name": "dynamite: Bayesian Modeling and Causal Inference for Multivariate\n Longitudinal Data",
"relatedLink": [
"https://docs.ropensci.org/dynamite/",
"https://CRAN.R-project.org/package=dynamite"
],
"codeRepository": "https://github.com/ropensci/dynamite/",
"issueTracker": "https://github.com/ropensci/dynamite/issues/",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "1.5.5",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.2 (2024-10-31 ucrt)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"author": [
{
"@type": "Person",
"givenName": "Santtu",
"familyName": "Tikka",
"email": "santtuth@gmail.com",
"@id": "https://orcid.org/0000-0003-4039-4342"
},
{
"@type": "Person",
"givenName": "Jouni",
"familyName": "Helske",
"email": "jouni.helske@iki.fi",
"@id": "https://orcid.org/0000-0001-7130-793X"
}
],
"maintainer": [
{
"@type": "Person",
"givenName": "Santtu",
"familyName": "Tikka",
"email": "santtuth@gmail.com",
"@id": "https://orcid.org/0000-0003-4039-4342"
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "cmdstanr",
"name": "cmdstanr"
},
{
"@type": "SoftwareApplication",
"identifier": "covr",
"name": "covr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=covr"
},
{
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
{
"@type": "SoftwareApplication",
"identifier": "knitr",
"name": "knitr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "mice",
"name": "mice",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=mice"
},
{
"@type": "SoftwareApplication",
"identifier": "mockthat",
"name": "mockthat",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=mockthat"
},
{
"@type": "SoftwareApplication",
"identifier": "quarto",
"name": "quarto",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=quarto"
},
{
"@type": "SoftwareApplication",
"identifier": "testthat",
"name": "testthat",
"version": ">= 3.0.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=testthat"
},
{
"@type": "SoftwareApplication",
"identifier": "tidyr",
"name": "tidyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tidyr"
}
],
"softwareRequirements": {
"1": {
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 3.6.0"
},
"2": {
"@type": "SoftwareApplication",
"identifier": "checkmate",
"name": "checkmate",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=checkmate"
},
"3": {
"@type": "SoftwareApplication",
"identifier": "cli",
"name": "cli",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=cli"
},
"4": {
"@type": "SoftwareApplication",
"identifier": "data.table",
"name": "data.table",
"version": ">= 1.15.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=data.table"
},
"5": {
"@type": "SoftwareApplication",
"identifier": "ggforce",
"name": "ggforce",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggforce"
},
"6": {
"@type": "SoftwareApplication",
"identifier": "glue",
"name": "glue",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=glue"
},
"7": {
"@type": "SoftwareApplication",
"identifier": "ggplot2",
"name": "ggplot2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggplot2"
},
"8": {
"@type": "SoftwareApplication",
"identifier": "loo",
"name": "loo",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=loo"
},
"9": {
"@type": "SoftwareApplication",
"identifier": "patchwork",
"name": "patchwork",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=patchwork"
},
"10": {
"@type": "SoftwareApplication",
"identifier": "posterior",
"name": "posterior",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=posterior"
},
"11": {
"@type": "SoftwareApplication",
"identifier": "rlang",
"name": "rlang",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rlang"
},
"12": {
"@type": "SoftwareApplication",
"identifier": "rstan",
"name": "rstan",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rstan"
},
"13": {
"@type": "SoftwareApplication",
"identifier": "stats",
"name": "stats"
},
"14": {
"@type": "SoftwareApplication",
"identifier": "tibble",
"name": "tibble",
"version": ">= 2.0.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tibble"
},
"15": {
"@type": "SoftwareApplication",
"identifier": "utils",
"name": "utils"
},
"SystemRequirements": null
},
"fileSize": "NAKB",
"citation": [
{
"@type": "CreativeWork",
"datePublished": "2024",
"author": [
{
"@type": "Person",
"givenName": "Santtu",
"familyName": "Tikka"
},
{
"@type": "Person",
"givenName": "Jouni",
"familyName": "Helske"
}
],
"name": "dynamite: An R Package for Dynamic Multivariate Panel Models",
"identifier": "10.48550/arXiv.2302.01607",
"url": "https://arxiv.org/abs/2302.01607",
"@id": "https://doi.org/10.48550/arXiv.2302.01607",
"sameAs": "https://doi.org/10.48550/arXiv.2302.01607"
},
{
"@type": "ScholarlyArticle",
"datePublished": "2024",
"author": [
{
"@type": "Person",
"givenName": "Santtu",
"familyName": "Tikka"
},
{
"@type": "Person",
"givenName": "Jouni",
"familyName": "Helske"
}
],
"name": "Estimating Causal Effects from Panel Data with Dynamic\n Multivariate Panel Models",
"identifier": "10.1016/j.alcr.2024.100617",
"pagination": "100617",
"@id": "https://doi.org/10.1016/j.alcr.2024.100617",
"sameAs": "https://doi.org/10.1016/j.alcr.2024.100617",
"isPartOf": {
"@type": "PublicationIssue",
"datePublished": "2024",
"isPartOf": {
"@type": [
"PublicationVolume",
"Periodical"
],
"volumeNumber": "60",
"name": "Advances in Life Course Research"
}
}
},
{
"@type": "SoftwareSourceCode",
"datePublished": "2024",
"author": [
{
"@type": "Person",
"givenName": "Santtu",
"familyName": "Tikka"
},
{
"@type": "Person",
"givenName": "Jouni",
"familyName": "Helske"
}
],
"name": "dynamite: Bayesian Modeling and Causal Inference for Multivariate\n Longitudinal Data",
"url": "https://github.com/ropensci/dynamite",
"description": "R package version 1.5.4"
}
],
"releaseNotes": "https://github.com/ropensci/dynamite/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/dynamite/blob/main/README.md",
"contIntegration": [
"https://github.com/ropensci/dynamite/actions",
"https://app.codecov.io/gh/ropensci/dynamite?branch=main"
],
"developmentStatus": "https://www.repostatus.org/#active",
"review": {
"@type": "Review",
"url": "https://github.com/ropensci/software-review/issues/554",
"provider": "https://ropensci.org"
},
"keywords": [
"bayesian-inference",
"panel-data",
"r",
"r-package",
"rstats",
"stan",
"statistical-models"
]
}
GitHub Events
Total
- Issues event: 1
- Watch event: 4
- Delete event: 1
- Push event: 20
- Create event: 1
Last Year
- Issues event: 1
- Watch event: 4
- Delete event: 1
- Push event: 20
- Create event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 72
- Total pull requests: 14
- Average time to close issues: 16 days
- Average time to close pull requests: about 1 hour
- Total issue authors: 11
- Total pull request authors: 5
- Average comments per issue: 1.51
- Average comments per pull request: 0.21
- Merged pull requests: 13
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 16 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- helske (36)
- santikka (25)
- palmierieugenio (2)
- nicholasjclark (1)
- Aariq (1)
- joakim219 (1)
- davidmosca (1)
- emstruong (1)
- DjakissO (1)
- mpadge (1)
- naikymen (1)
Pull Request Authors
- santikka (8)
- helske (3)
- maelle (2)
- mpadge (1)
- jeroen (1)
Top Labels
Issue Labels
enhancement (22)
bug (14)
documentation (3)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 402 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 12
- Total maintainers: 1
cran.r-project.org: dynamite
Bayesian Modeling and Causal Inference for Multivariate Longitudinal Data
- Homepage: https://docs.ropensci.org/dynamite/
- Documentation: http://cran.r-project.org/web/packages/dynamite/dynamite.pdf
- License: GPL (≥ 3)
-
Latest release: 1.5.6
published 11 months ago
Rankings
Stargazers count: 13.3%
Forks count: 21.9%
Average: 27.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 38.3%
Maintainers (1)
Last synced:
6 months ago
Dependencies
.github/workflows/R-CMD-check.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/R-CMD-check_cranrel.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/test-coverage.yaml
actions
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION
cran
- R >= 3.6.0 depends
- checkmate * imports
- cli * imports
- data.table * imports
- ggplot2 * imports
- glue * imports
- loo * imports
- methods * imports
- patchwork * imports
- posterior * imports
- rlang * imports
- rstan * imports
- stats * imports
- tibble >= 2.0.0 imports
- utils * imports
- bookdown * suggests
- cmdstanr * suggests
- covr * suggests
- dplyr * suggests
- knitr * suggests
- mockthat * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- tidyr * suggests