One of the most time-consuming part of data analysis in psychology is the copy-pasting of specific values of some R output to a manuscript or a report. This task is frustrating, prone to errors, and increase de variability of statistical reporting. At the sime time, standardizing practices of what and how to report is crucial for reproducibility and clarity. The psycho package was designed specifically to do this job, at first for complex Bayesian mixed models, but is now also compatible with basic methods, such as correlation.
df iris # Load the traditional iris dataset into an object called df (for dataframe) cor_results cor.test(df$Sepal.Length, df$Petal.Length) # Compute a correlation and store its result
# devtools::install_github("neuropsychology/psycho.R") # Install the latest psycho version library(psycho) # Load the psycho package psycho::analyze(cor_results) # Run the analyze function on the correlation
The Pearson's product-moment correlation between df$Sepal.Length and df$Petal.Length is significantly large and positive (r(148) = 0.87, 95% CI [0.83, 0.91], p
The formatted output includes the direction, effect size (interpreted by default with Cohen’s (1988) rules of thumb) and confidence intervals. Now, you can just copy and paste this line into your report and focus on more important things than formatting.
It is also possible to have all the values stored in a dataframe by running a summary on the analyzed object.
results analyze(cor_results) summary(results)
Nevertheless, we recommand doing a Bayesian correlation, which is even easier and quicker to do!
Of course, these reporting standards are bound to change, depending on new expert recommandations or official guidelines. The goal of this package is to flexibly accompany new changes and good practices evolution. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an issue or, even better, try to implement them yourself by contributing to the code.
This package helped you? Don’t forget to cite the various packages you used 🙂
You can cite
psycho as follows:
- Makowski, (2018). The psycho Package: An Efficient and Publishing-Oriented Workflow for Psychological Science. Journal of Open Source Software, 3(22), 470. https://doi.org/10.21105/joss.00470
Source link https://www.r-bloggers.com/formatted-correlation-with-effect-size/