Formatted correlation output with effect sizes

March 24, 2019
By

(This article was first published on R on easystats, and kindly contributed to R-bloggers)

One of the most time-consuming part of data analysis in science 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 increases the variability of statistical reporting. At the sime time, standardizing practices of what and how to report is crucial for reproducibility and clarity. The new report package was designed specifically to do this job.

Install report

report is part of the new easystats suite of packages. However, as it is not (yet) on CRAN, you’ll need to install it directly from github.

devtools::install_github("easystats/report")  # Install the latest psycho version

library(report)  # Load the package

Do a 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

Formatted output

The report package include a single function, namely report(), that can be applied to a correlation to format its content.

report(cor_results)
## The Pearson's product-moment correlation between df$Sepal.Length and
## df$Petal.Length is positive, significant and large (r = 0.87, p < .001).

The formatted output includes the direction, effect size (interpreted by default using 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.

Evolution

Of course, these reporting standards should change, depending on new expert recommendations or official guidelines. The goal of this package is to flexibly adaptive to 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.

To leave a comment for the author, please follow the link and comment on their blog: R on easystats.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)