Do a t-test
APA formatted output
Flexibility
Dataframe of Values
Contribute
Credits
Previous blogposts
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 increases the variability of statistical reporting. This is an important issue, as standardizing practices of what and how to report might be a key to overcome the reproducibility crisis of psychology. The psycho package was designed specifically to do this job. At first, for complex Bayesian mixed models, but the package is now compatible with basic methods, such as t-tests.
Do a t-test
# Load packages
library(tidyverse)
# devtools::install_github(&quot;neuropsychology/psycho.R&quot;) # Install the latest psycho version
library(psycho)
df % psycho::analyze()
The Two Sample t-test suggests that the difference of df$Adjusting by df$Sex (mean in group F = 3.72, mean in group M = 4.13, difference = -0.41) is significant (t(1249) = -4.13, 90% CI [-0.58, -0.25], p __ .001).
t.test(df$Adjusting,
mu=0,
conf.level = .90) %__% psycho::analyze()
The One Sample t-test suggests that the difference between df$Adjusting (mean = 3.80) and mu = 0 is significant (t(1250) = 93.93, 90% CI [3.74, 3.87], p __ .001).
Dataframe of Values
It is also possible to have all the values stored in a dataframe by running a summary on the analyzed object.
library(tidyverse)
t.test(df$Adjusting ~ df$Sex) %__% psycho::analyze() %__% summary()
effect
statistic
df
p
CI_lower
CI_higher
-0.4149661
-4.067008
377.8364
5.8e-05
-0.6155884
-0.2143439
Contribute
Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. The goal of this package is to flexibly adapt to new changes and accompany the evolution of best practices. Therefore, if you have any advices, opinions or ideas, we encourage you to let us know by opening an issue or, even better, to try to implement changes yourself by contributing to the code.
Credits
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
Previous blogposts
APA Formatted Bayesian Correlation
Fancy Plot (with Posterior Samples) for Bayesian Regressions
How Many Factors to Retain in Factor Analysis
Beautiful and Powerful Correlation Tables
Format and Interpret Linear Mixed Models
How to do Repeated Measures ANOVAs
Standardize (Z-score) a dataframe
Compute Signal Detection Theory Indices