{PRDA} allows performing a prospective or retrospective designanalysis to evaluate inferential risks (i.e., power, Type M error, andType S error) in a study considering Pearson’s correlation between twovariables or mean comparisons (one-sample, paired, two-sample, andWelch’st-test).
For an introduction to design analysis and a general overview of thepackage seevignette("PRDA"). Examples for retrospectivedesign analysis and prospective design analysis are provided invignette("retrospective") andvignette("prospective") respectively.
All the documentation is available athttps://claudiozandonella.github.io/PRDA/.
You can install the released version of PRDA fromCRAN with:
install.packages("PRDA")And the development version fromGitHubwith:
# install.packages("devtools")devtools::install_github("ClaudioZandonella/PRDA",build_vignettes =TRUE){PRDA} package can be used for Pearson’s correlation between twovariables or mean comparisons (i.e., one-sample, paired, two-sample, andWelch’s t-test) considering an hypothetical value ofρ orCohen’sd respectively. Seevignette("retrospective") andvignette("prospective") to know how to set functionarguments for the different effect types.
In {PRDA} there are two main functionsretrospective()andprospective().
retrospective()Given the hypothetical population effect size and the study samplesize, the functionretrospective() performs a retrospectivedesign analysis. According to the defined alternative hypothesis and thesignificance level, the inferential risks (i.e., Power level, Type Merror, and Type S error) are computed together with the critical effectvalue (i.e., the minimum absolute effect size value that would resultsignificant).
Consider a study that evaluated the correlation between two variableswith a sample of 30 subjects. Suppose that according to the literaturethe hypothesized effect isρ = .25. To evaluate the inferentialrisks related to the study we use the functionretrospective().
set.seed(2020)# set seed to make results reproducibleretrospective(effect_size = .25,sample_n1 =30,test_method ="pearson")#>#> Design Analysis#>#> Hypothesized effect: rho = 0.25#>#> Study characteristics:#> test_method sample_n1 sample_n2 alternative sig_level df#> pearson 30 NULL two_sided 0.05 28#>#> Inferential risks:#> power typeM typeS#> 0.27 1.826 0.003#>#> Critical value(s): rho = ± 0.361In this case, the statistical power is almost 30% and the associatedType M error and Type S error are respectively around 1.80 and 0.003.That means, statistical significant results are on average anoverestimation of 80% of the hypothesized population effect and there isa .3% probability of obtaining a statistically significant result in theopposite direction.
To know more about function arguments and further examples see thefunction documentation?retrospective andvignette("retrospective").
prospective()Given the hypothetical population effect size and the required powerlevel, the functionprospective() performs a prospectivedesign analysis. According to the defined alternative hypothesis and thesignificance level, the required sample size is computed together withthe associated Type M error, Type S error, and the critical effect value(i.e., the minimum absolute effect size value that would resultsignificant).
Consider a study that will evaluate the correlation between twovariables. Knowing from the literature that we expect an effect size ofρ = .25, the functionprospective() can be used tocompute the required sample size to obtain a power of 80%.
prospective(effect_size = .25,power = .80,test_method ="pearson",display_message =FALSE)#>#> Design Analysis#>#> Hypothesized effect: rho = 0.25#>#> Study characteristics:#> test_method sample_n1 sample_n2 alternative sig_level df#> pearson 122 NULL two_sided 0.05 120#>#> Inferential risks:#> power typeM typeS#> 0.797 1.119 0#>#> Critical value(s): rho = ± 0.178The required sample size is
To know more about function arguments and further examples see thefunction documentation?prospective andvignette("prospective").
The hypothetical population effect size can be defined as a singlevalue according to previous results in the literature or expertsindications. Alternatively, {PRDA} allows users to specify adistribution of plausible values to account for their uncertainty aboutthe hypothetical population effect size. To know how to specify thehypothetical effect size according to a distribution and an example ofapplication seevignette("retrospective").
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 iswelcome to contribute to the PRDA package.
Please note that this project is released under aContributor Code ofConduct. By contributing to this project, you agree to abide by itsterms.
To propose a new feature or to report a bug, please open an issue onGitHub.SeeCommunityguidelines.
To cite {PRDA} in publications use:
Zandonella Callegher, C., Pastore, M., Andreella, A., Vesely, A.,Toffalini, E., Bertoldo, G., & Altoè G. (2020). PRDA: Prospectiveand 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} }