DeclareDesign
DeclareDesign: Declare and Diagnose Research Designs
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 14 committers (7.1%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Keywords
design
r
research
simulations
Keywords from Contributors
prediction
regression-models
transformation
Last synced: 6 months ago
·
JSON representation
Repository
DeclareDesign: Declare and Diagnose Research Designs
Basic Info
- Host: GitHub
- Owner: DeclareDesign
- License: other
- Language: R
- Default Branch: main
- Homepage: https://declaredesign.org
- Size: 14.2 MB
Statistics
- Stars: 104
- Watchers: 13
- Forks: 12
- Open Issues: 28
- Releases: 14
Topics
design
r
research
simulations
Created almost 9 years ago
· Last pushed 6 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output:
github_document
title: "DeclareDesign: Declare and Diagnose Research Designs"
---
```{r echo=FALSE, message = FALSE, warning = FALSE, error = FALSE}
set.seed(42)
options(digits=2)
library(tidyverse)
library(knitr)
knitr::opts_chunk$set(warning = FALSE, error = FALSE, message = FALSE)
```
[](https://cran.r-project.org/package=DeclareDesign)
[](https://r-pkg.org/pkg/DeclareDesign)
[](https://github.com/DeclareDesign/DeclareDesign/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/DeclareDesign/DeclareDesign)
[](https://softwarecite.com/package/DeclareDesign)
DeclareDesign is a system for describing research designs in code and simulating them in order to understand their properties. Because DeclareDesign employs a consistent grammar of designs, you can focus on the intellectually challenging part -- designing good research studies -- without having to code up simulations from scratch. For more, see [declaredesign.org](https://declaredesign.org).
## Installation
To install the latest stable release of **DeclareDesign**, please ensure that you are running version 3.5 or later of R and run the following code:
```{r, eval=F}
install.packages("DeclareDesign")
```
## Usage
Designs are declared by adding together design elements. Here's a minimal example that describes a 100 unit randomized controlled trial with a binary outcome. Half the units are assigned to treatment and the remainder to control. The true value of the average treatment effect is 0.05 and it will be estimated with the difference-in-means estimator. The diagnosis shows that the study is unbiased but underpowered.
```{r, eval = TRUE, message=FALSE}
library(DeclareDesign)
design <-
declare_model(
N = 100,
potential_outcomes(Y ~ rbinom(N, size = 1, prob = 0.5 + 0.05 * Z))
) +
declare_inquiry(ATE = 0.05) +
declare_assignment(Z = complete_ra(N, m = 50)) +
declare_measurement(Y = reveal_outcomes(Y ~ Z)) +
declare_estimator(Y ~ Z, .method = lm_robust, inquiry = "ATE")
diagnosands <-
declare_diagnosands(bias = mean(estimate - estimand),
power = mean(p.value <= 0.05))
diagnosis <- diagnose_design(design, diagnosands = diagnosands)
```
```{r, eval = FALSE}
diagnosis
```
```{r, echo = FALSE}
knitr::kable(get_diagnosands(diagnosis) %>% select(-term, -design), col.names = c("Inquiry", "Estimator", "Outcome", "Bias", "SE(Bias)", "Power", "SE(Power)", "n sims"), digits = 3)
```
## Companion software
The core DeclareDesign package relies on four companion packages, each of which is useful in its own right.
1. [randomizr](https://declaredesign.org/r/randomizr/): Easy to use tools for common forms of random assignment and sampling.
2. [fabricatr](https://declaredesign.org/r/fabricatr/): Imagine your data before you collect it.
3. [estimatr](https://declaredesign.org/r/estimatr/): Fast estimators for social scientists.
4. [DesignLibrary](https://declaredesign.org/r/designlibrary/): Templates to quickly adopt and adapt common research designs.
## Learning DeclareDesign
1. To get started, have a look at this vignette on [the idea behind DeclareDesign](https://declaredesign.org/getting-started/), which covers the main functionality of the software.
2. For an explanation of the philosophy behind DeclareDesign, examples in code and words of declaring and diagnosing common research designs in the social sciences, as well as examples of how to incorporate DeclareDesign into your own research, see the book [Research Design in the Social Sciences](https://book.declaredesign.org) (Blair, Coppock, Humphreys, 2023).
## Package structure
Each of these `declare_*()` functions returns a *function*.
1. `declare_model()` (describes dimensions and distributions over the variables, including potential outcomes)
2. `declare_inquiry()` (takes variables in the model and calculates estimand value)
3. `declare_sampling()` (takes a population and selects a sample)
4. `declare_assignment()` (takes a population or sample and adds treatment assignments)
5. `declare_measurement()` (takes data and adds measured values)
6. `declare_estimator()` (takes data produced by sampling, assignment, and measurement and returns estimates linked to inquiries)
7. `declare_test()` (takes data produced by sampling, assignment, and measurement and returns the result of a test)
To *declare a design*, connect the components of your design with the + operator.
Once you have declared your design, there are four core post-design-declaration commands used to modify or diagnose your design:
1. `diagnose_design()` (takes a design and returns simulations and diagnosis)
2. `draw_data()` (takes a design and returns a single draw of the data)
3. `draw_estimates()` (takes a design and returns a single simulation of estimates)
4. `draw_estimands()` (takes a design and returns a single simulation of estimands)
A few other features:
1. A designer is a function that takes parameters (e.g., `N`) and returns a design. `expand_design()` is a function of a designer and parameters that return a design.
2. You can change the diagnosands with `declare_diagnosands()`.
---
This project was generously supported by a grant from the [Laura and John Arnold Foundation](http://www.arnoldfoundation.org) and seed funding from [EGAP](http://egap.org).
Owner
- Name: DeclareDesign
- Login: DeclareDesign
- Kind: organization
- Website: https://declaredesign.org
- Repositories: 22
- Profile: https://github.com/DeclareDesign
Tools for declaring and diagnosing the properties of research designs
GitHub Events
Total
- Issues event: 2
- Watch event: 2
- Delete event: 1
- Issue comment event: 4
- Push event: 29
- Pull request event: 4
- Fork event: 1
- Create event: 3
Last Year
- Issues event: 2
- Watch event: 2
- Delete event: 1
- Issue comment event: 4
- Push event: 29
- Pull request event: 4
- Fork event: 1
- Create event: 3
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Graeme Blair | g****r | 725 |
| Neal Fultz | n****z@g****m | 173 |
| Alexander Coppock | a****k@g****m | 165 |
| Jasper Cooper | j****r@g****m | 69 |
| macartan | m****n@g****m | 42 |
| Aaron Rudkin | j****s@r****a | 21 |
| Lily Medina | l****u@g****m | 7 |
| Nick-Rivera | 3****a | 6 |
| Clara Bicalho | c****3@n****u | 5 |
| Lily Medina | 3 | |
| Amir Masoud Abdol | a****l@i****m | 2 |
| Luke Sonnet | l****t@g****m | 2 |
| Vincent Arel-Bundock | v****k@u****a | 1 |
| Alexander Coppock | a****k | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 56
- Total pull requests: 61
- Average time to close issues: almost 2 years
- Average time to close pull requests: about 1 month
- Total issue authors: 17
- Total pull request authors: 7
- Average comments per issue: 2.52
- Average comments per pull request: 1.26
- Merged pull requests: 46
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: 3 months
- Issue authors: 4
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.4
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- graemeblair (27)
- macartan (8)
- acoppock (5)
- oscci (2)
- aaronrudkin (2)
- daaronr (1)
- kleuveld (1)
- grasshoppermouse (1)
- aeggers (1)
- svraka (1)
- EtienneGagnon1 (1)
- HenrikBengtsson (1)
- bjvca (1)
- jwbowers (1)
- nfultz (1)
Pull Request Authors
- graemeblair (38)
- nfultz (8)
- acoppock (6)
- macartan (6)
- vincentarelbundock (1)
- svraka (1)
- lilymedina (1)
Top Labels
Issue Labels
bug (7)
enhancement (5)
parallel (3)
new-handler (2)
deep_env_copy issues (1)
documentation (1)
ri2 (1)
todo (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 1,685 last-month
- Total dependent packages: 4
- Total dependent repositories: 8
- Total versions: 17
- Total maintainers: 1
cran.r-project.org: DeclareDesign
Declare and Diagnose Research Designs
- Homepage: https://declaredesign.org/r/declaredesign/
- Documentation: http://cran.r-project.org/web/packages/DeclareDesign/DeclareDesign.pdf
- License: MIT + file LICENSE
-
Latest release: 1.0.10
published almost 2 years ago
Rankings
Stargazers count: 4.0%
Forks count: 5.8%
Average: 8.7%
Dependent packages count: 9.1%
Dependent repos count: 10.6%
Downloads: 13.9%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- estimatr >= 0.20.0 depends
- fabricatr >= 0.10.0 depends
- randomizr >= 0.20.0 depends
- generics * imports
- methods * imports
- rlang * imports
- AER * suggests
- DesignLibrary * suggests
- MASS * suggests
- Matching * suggests
- betareg * suggests
- biglm * suggests
- broom * suggests
- coin * suggests
- data.table * suggests
- diffobj * suggests
- dplyr * suggests
- future.apply * suggests
- gam * suggests
- ggplot2 * suggests
- knitr * suggests
- margins * suggests
- psych * suggests
- reshape2 * suggests
- rmarkdown * suggests
- sf * suggests
- testthat * suggests
- tibble * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/cache v1 composite
- actions/checkout v2.3.4 composite
- actions/upload-artifact master composite
- r-lib/actions/setup-pandoc master composite
- r-lib/actions/setup-r master composite
.github/workflows/pr-commands.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/pr-fetch master composite
- r-lib/actions/pr-push master composite
- r-lib/actions/setup-r master composite
.github/workflows/test-coverage.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite