Movatterモバイル変換


[0]ホーム

URL:


PRDA:Prospective and Retrospective Design Analysis

Project Status: Active – The project has reached a stable, usable state and is being actively developed.CRAN statusAppVeyor build statusCodecov test coverageDOI

{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/.

Installation

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)

The Package

{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.

Functions

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.361

In 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.178

The required sample size is\(n=122\), the associated Type M error isaround 1.10 and the Type S error is approximately 0.

To know more about function arguments and further examples see thefunction documentation?prospective andvignette("prospective").

Hypothetical effect size

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").

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 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.

Bugs and New Features

To propose a new feature or to report a bug, please open an issue onGitHub.SeeCommunityguidelines.

Future Plans

Citation

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}  }

References

Altoè, Gianmarco, Giulia Bertoldo, Claudio Zandonella Callegher, EnricoToffalini, Antonio Calcagnì, Livio Finos, and Massimiliano Pastore.2020. “Enhancing Statistical Inference in Psychological Research viaProspective and Retrospective Design Analysis.”Frontiers inPsychology 10.https://doi.org/10.3389/fpsyg.2019.02893.Bertoldo, Giulia, Claudio Zandonella Callegher, and Gianmarco Altoè.2020. “Designing Studies and Evaluating Research Results: Type M andType S Errors for Pearson Correlation Coefficient.” Preprint. PsyArXiv.https://doi.org/10.31234/osf.io/q9f86.Gelman, Andrew, and John Carlin. 2014. “Beyond Power Calculations:Assessing Type S (Sign) and Type M (Magnitude) Errors.”Perspectiveson Psychological Science 9 (6): 641–51.https://doi.org/10.1177/1745691614551642.
[8]ページ先頭

©2009-2025 Movatter.jp