optic
optic: Simulation Tool for Causal Inference Using Longitudinal Data
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
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.4%) to scientific vocabulary
Keywords
causal-inference
diff-in-diff
longitudinal-data
simulation
Last synced: 6 months ago
·
JSON representation
Repository
optic: Simulation Tool for Causal Inference Using Longitudinal Data
Basic Info
- Host: GitHub
- Owner: RANDCorporation
- License: gpl-3.0
- Language: R
- Default Branch: main
- Homepage: https://randcorporation.github.io/optic/
- Size: 50.6 MB
Statistics
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 12
- Releases: 3
Topics
causal-inference
diff-in-diff
longitudinal-data
simulation
Created almost 3 years ago
· Last pushed 7 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
bibliography: ./vignettes/optic_refs.json
#csl: https://www.zotero.org/styles/lancet
link-citations: yes
linkcolor: blue
nocite: '@*'
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# optic
**Simulation Tool for Causal Inference Using Longitudinal Data**
[](https://github.com/RANDCorporation/optic/actions)
[](https://github.com/RANDCorporation/optic/actions)
The `optic` R package helps you scrutinize candidate causal inference models using **your own** longitudinal data. Researchers from the Opioid Policy Tools and Information Center (OPTIC) initially created the tool to examine longitudinal data related to opioids, but its framework can be used with longitudinal data on topics other than opioids.
## Background and Rationale
Recent difference-in-differences (DID) literature revealed issues with the traditional DID model, but we found it very difficult to evaluate the relative performance of different causal inference methods using our own data. Thus, we designed a series of simulations [@griffinMovingClassicDifferenceindifferences2021; @griffinMethodologicalConsiderationsEstimating2023] to study the performance of various methods under different scenarios. Our publications to date are as follows:
1. In @griffinMovingClassicDifferenceindifferences2021, we use real-world data on opioid mortality rates to assess commonly used statistical models for DID designs, which are widely used in state policy evaluations. These experiments demonstrated notable limitations of those methods. In contrast, the optimal model we identified—the autoregressive (AR) model—showed a lot of promise. That said, do not just take our word for it; try it out with your own data and see how various approaches perform relative to one another. See the “Usage” section for details.
2. In @griffinMethodologicalConsiderationsEstimating2023, we demonstrate that it is critical to be able to control for effects of co-occurring policies and understand the potential bias that might arise from not controlling for those policies. Our package can help you assess the impact of co-occurring policies on the performance of commonly used statistical models in state policy evaluations.
Assessing those methods in a systematic way might be challenging, but you can now use our `optic` R package to simulate policy effects and compare causal inference models using your own data.
The package supports the traditional two-way fixed effects DID model and the AR model, as well as other leading methods, such as augmented synthetic control and the Callaway-Sant’Anna approach to DID [@ben-michaelAugmentedSyntheticControl2021; @callawayDifferenceinDifferencesMultipleTime2021].
### Why `optic`?
`optic` is named after the **Opioid Policy Tools and Information Center (OPTIC)** project.
## Installation
You will need [R (version 4.1.0 or above)](https://www.r-project.org) to use this package. You can install the `optic` R package from the `R` console:
``` r
# install from CRAN:
install.packages("optic")
# or install the development version from github:
# install remotes if needed
install.packages("remotes")
remotes::install_github("RANDCorporation/optic")
```
## Usage
The [introductory vignette](https://randcorporation.github.io/optic/articles/intro_optic.html) provides a working example using a sample `overdoses` dataset provided with the package. `optic` provides three main functions: `optic_model`, `optic_simulation`, and `dispatch_simulations`. Use `optic_model` to define model specifications for each causal model to be tested in the simulation experiment. Then, pass your models, your data, and your parameters to the `optic_simulation` function, which specifies a set of simulations to be performed for each `optic_model` included in your `list` of models. Finally, use `dispatch_simulations` to run your simulations in parallel.
## Contact
Reach out to [Beth Ann Griffin](https://www.rand.org/about/people/g/griffin_beth_ann.html) for questions related to this repository.
## License
Copyright (C) 2023 by The [RAND Corporation](https://www.rand.org). This repository is released as open-source software under a GPL-3.0 license. See the LICENSE file.
## About this Tool
This research was financially supported through a National Institute on Drug Abuse grant (P50DA046351) to the RAND Corporation and carried out within the Access and Delivery Program in RAND Health Care.
RAND Health Care, a division of the RAND Corporation, promotes healthier societies by improving health care systems in the United States and other countries. We do this by providing health care decisionmakers, practitioners, and consumers with actionable, rigorous, objective evidence to support their most complex decisions. For more information, see [www.rand.org/health-care](https://www.rand.org/health-care), or contact
**RAND Health Care Communications**
1776 Main Street
P.O. Box 2138
Santa Monica, CA 90407-2138
(310) 393-0411, ext. 7775
RAND_Health-Care@rand.org
## References
Owner
- Name: The RAND Corporation
- Login: RANDCorporation
- Kind: organization
- Repositories: 36
- Profile: https://github.com/RANDCorporation
GitHub Events
Total
- Create event: 2
- Release event: 1
- Issues event: 2
- Watch event: 2
- Issue comment event: 7
- Push event: 11
- Pull request review event: 1
- Pull request event: 3
Last Year
- Create event: 2
- Release event: 1
- Issues event: 2
- Watch event: 2
- Issue comment event: 7
- Push event: 11
- Pull request review event: 1
- Pull request event: 3
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 2
- Average time to close issues: 2 days
- Average time to close pull requests: 3 months
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: 2 days
- Average time to close pull requests: about 18 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- maxgriswold (4)
- pedroliman (1)
- dbent33 (1)
Pull Request Authors
- pedroliman (2)
- maxgriswold (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 157 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
cran.r-project.org: optic
Simulation Tool for Causal Inference Using Longitudinal Data
- Homepage: https://randcorporation.github.io/optic/
- Documentation: http://cran.r-project.org/web/packages/optic/optic.pdf
- License: GPL-3
-
Latest release: 1.0.1
published over 2 years ago
Rankings
Forks count: 21.8%
Stargazers count: 26.2%
Dependent packages count: 29.3%
Dependent repos count: 35.0%
Average: 40.4%
Downloads: 89.6%
Maintainers (1)
Last synced:
6 months ago
Dependencies
.github/workflows/R-CMD-check.yml
actions
- actions/checkout v3 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
.github/workflows/test-coverage.yml
actions
- actions/checkout v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION
cran
- R >= 4.1.0 depends
- MASS * imports
- R6 * imports
- did * imports
- dplyr * imports
- future.apply * imports
- lmtest * imports
- magrittr * imports
- methods * imports
- purrr * imports
- rlang * imports
- sandwich * imports
- stats * imports
- tidyr * imports
- utils * imports
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests