PRDA
PRDA: An R package for Prospective and Retrospective Design Analysis - Published in JOSS (2021)
Science Score: 93.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 6 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
design-analysis
r
r-package
statistics
Last synced: 6 months ago
·
JSON representation
Repository
R Package for Prospective and Retrospective Design Analysis
Basic Info
- Host: GitHub
- Owner: ClaudioZandonella
- License: gpl-3.0
- Language: R
- Default Branch: master
- Homepage: https://claudiozandonella.github.io/PRDA/
- Size: 4.59 MB
Statistics
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
- Releases: 2
Topics
design-analysis
r
r-package
statistics
Created over 6 years ago
· Last pushed almost 5 years ago
Metadata Files
Readme
Contributing
License
Code of conduct
README.Rmd
---
output: github_document
editor_options:
chunk_output_type: console
bibliography: vignettes/PRDA.bib
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(PRDA)
```
# PRDA: Prospective and Retrospective Design Analysis
[](https://www.repostatus.org/#active)
[](https://CRAN.R-project.org/package=PRDA)
[](https://ci.appveyor.com/project/ClaudioZandonella/PRDA/branch/master)
[](https://travis-ci.org/ClaudioZandonella/PRDA)
[](https://codecov.io/gh/ClaudioZandonella/PRDA/branch/master)
[](https://zenodo.org/badge/latestdoi/212573857)
{PRDA} allows performing a prospective or retrospective design analysis to evaluate inferential risks (i.e., power, Type M error, and Type S error) in a study considering Pearson's correlation between two variables or mean comparisons (one-sample, paired, two-sample, and Welch's *t*-test).
For an introduction to design analysis and a general overview of the package see `vignette("PRDA")`.
Examples for retrospective design analysis and prospective design analysis are provided in `vignette("retrospective")` and `vignette("prospective")` respectively.
All the documentation is available at https://claudiozandonella.github.io/PRDA/.
## Installation
You can install the released version of PRDA from [CRAN](https://CRAN.R-project.org/package=PRDA) with:
``` r
install.packages("PRDA")
```
And the development version from [GitHub](https://github.com/ClaudioZandonella/PRDA/tree/master) with:
``` r
# install.packages("devtools")
devtools::install_github("ClaudioZandonella/PRDA",
build_vignettes = TRUE)
```
## The Package
{PRDA} package can be used for Pearson's correlation between two variables or mean comparisons (i.e., one-sample, paired, two-sample, and Welch's t-test) considering an hypothetical value of *ρ* or Cohen's *d* respectively. See `vignette("retrospective")` and `vignette("prospective")` to know how to set function arguments for the different effect types.
### Functions
In {PRDA} there are two main functions `retrospective()` and `prospective()`.
#### • `retrospective()`
Given the hypothetical population effect size and the study sample size, the function `retrospective()` performs a retrospective design analysis. According to the defined alternative hypothesis and the significance level, the inferential risks (i.e., Power level, Type M error, and Type S error) are computed together with the critical effect value (i.e., the minimum absolute effect size value that would result significant).
Consider a study that evaluated the correlation between two variables with a sample of 30 subjects. Suppose that according to the literature the hypothesized effect is *ρ* = .25. To evaluate the inferential risks related to the study we use the function `retrospective()`.
```{r retrospective,}
set.seed(2020) # set seed to make results reproducible
retrospective(effect_size = .25, sample_n1 = 30,
test_method = "pearson")
```
In this case, the statistical power is almost 30% and the associated Type M error and Type S error are respectively around 1.80 and 0.003. That means, statistical significant results are on average an overestimation of 80% of the hypothesized population effect and there is a .3% probability of obtaining a statistically significant result in the opposite direction.
To know more about function arguments and further examples see the function documentation `?retrospective` and `vignette("retrospective")`.
#### • `prospective()`
Given the hypothetical population effect size and the required power level, the function `prospective()` performs a prospective design analysis. According to the defined alternative hypothesis and the significance level, the required sample size is computed together with the associated Type M error, Type S error, and the critical effect value (i.e., the minimum absolute effect size value that would result significant).
Consider a study that will evaluate the correlation between two variables. Knowing from the literature that we expect an effect size of *ρ* = .25, the function `prospective()` can be used to compute the required sample size to obtain a power of 80%.
```{r prospective}
prospective(effect_size = .25, power = .80, test_method = "pearson",
display_message = FALSE)
```
The required sample size is $n=122$, the associated Type M error is around 1.10 and the Type S error is approximately 0.
To know more about function arguments and further examples see the function documentation `?prospective` and `vignette("prospective")`.
### Hypothetical effect size
The hypothetical population effect size can be defined as a single value according to previous results in the literature or experts indications. Alternatively, {PRDA} allows users to specify a distribution of plausible values to account for their uncertainty about the hypothetical population effect size. To know how to specify the hypothetical effect size according to a distribution and an example of application see `vignette("retrospective")`.
## Contributing to PRDA
The PRDA package is still in the early stages of its life. Thus, surely there are many bugs to fix and features to propose. Anyone is welcome to contribute to the PRDA package.
Please note that this project is released under a [Contributor Code of Conduct](https://www.contributor-covenant.org/). By contributing to this project, you agree to abide by its terms.
#### Bugs and New Features
To propose a new feature or to report a bug, please open an issue on [GitHub](https://github.com/ClaudioZandonella/PRDA/issues). See [Community guidelines](https://github.com/ClaudioZandonella/PRDA/blob/master/CONTRIBUTING.md).
#### Future Plans
- Improve compute time by parallelizing the code
- Implement design analysis in the case of linear regression models
## Citation
To cite {PRDA} in publications use:
Zandonella Callegher, C., Pastore, M., Andreella, A., Vesely, A., Toffalini, E., Bertoldo, G., & Altoè G. (2020). PRDA: Prospective and Retrospective Design Analysis (Version 1.0.0). Zenodo. https://doi.org/10.5281/zenodo.4044214
A BibTeX entry for LaTeX users is
```{}
@Misc{,
author = {Zandonella Callegher, Claudio and Pastore, Massimiliano and Andreella, Angela and
Vesely, Anna and Toffalini, Enrico and Bertoldo, Giulia and Altoè, Gianmarco},
title = {PRDA: Prospective and Retrospective Design
Analysis},
year = 2020,
publisher = {Zenodo},
version = {1.0.0},
doi = {10.5281/zenodo.4044214},
url = {https://doi.org/10.5281/zenodo.4044214}
}
```
---
nocite: |
@altoeEnhancingStatisticalInference2020, @bertoldoDesigningStudiesEvaluating2020, @gelmanPowerCalculationsAssessing2014
...
## References
Owner
- Name: Claudio Zandonella Callegher
- Login: ClaudioZandonella
- Kind: user
- Location: Bolzano, Italy
- Company: Eurac Research Institute for Renewable Energy
- Website: https://claudiozandonella.netlify.app/
- Twitter: ClaudioZandone1
- Repositories: 25
- Profile: https://github.com/ClaudioZandonella
I fell in love with data science! Collecting data, formulating hypotheses, and building models - this is a very creative and exciting process!
JOSS Publication
PRDA: An R package for Prospective and Retrospective Design Analysis
Published
February 21, 2021
Volume 6, Issue 58, Page 2810
Authors
Claudio Zandonella Callegher
Department of Developmental Psychology and Socialisation, University of Padova, Padova, Italy
Department of Developmental Psychology and Socialisation, University of Padova, Padova, Italy
Giulia Bertoldo
Department of Developmental Psychology and Socialisation, University of Padova, Padova, Italy
Department of Developmental Psychology and Socialisation, University of Padova, Padova, Italy
Tags
design analysis power analysis Type M error Type S error replicabiliytGitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Claudio Zandonella | c****a@g****m | 246 |
| angeella | a****8@g****m | 17 |
| Anna Vesely | 5****y | 14 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 9
- Total pull requests: 1
- Average time to close issues: 19 days
- Average time to close pull requests: 1 day
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 2.22
- 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
- DominiqueMakowski (6)
- mmrabe (3)
Pull Request Authors
- ClaudioZandonella (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 224 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: PRDA
Conduct a Prospective or Retrospective Design Analysis
- Homepage: https://claudiozandonella.github.io/PRDA/
- Documentation: http://cran.r-project.org/web/packages/PRDA/PRDA.pdf
- License: GPL-3
-
Latest release: 1.0.0
published about 5 years ago
Rankings
Forks count: 21.9%
Stargazers count: 22.5%
Dependent packages count: 29.8%
Average: 34.2%
Dependent repos count: 35.5%
Downloads: 61.3%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- MASS * imports
- Rcpp * imports
- pbapply * imports
- covr * suggests
- devtools * suggests
- ggplot2 * suggests
- knitr * suggests
- rmarkdown * suggests
- roxygen2 * suggests
- testthat * suggests
- tidyverse * suggests