<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/the-end-of-errors-in-anova-reporting/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html"> Dominique Makowski</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<ul>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html#fit-an-anova" target="_blank">Fit an anova</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html#apa-formatted-output" target="_blank">APA formatted output</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html#correlations-t-tests-regressions..." target="_blank">Correlations, t-tests, regressions…</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html#evolution" target="_blank">Evolution</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html#credits" target="_blank">Credits</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html#on-similar-topics" target="_blank">On similar topics</a></li>
</ul>
<p><strong>Psychology is still (<a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/05/01/repeated_measure_anovas.html" target="_blank">unfortunately</a>) massively using analysis of variance (ANOVA)</strong>. Despite its relative simplicity, I am very often confronted to <strong>errors in its reporting</strong>, for instance in student’s theses or manuscripts. Beyond the incomplete, uncomprehensible or just wrong reporting, one can find a tremendous amount of genuine errors (that could influence the results and their intepretation), even in published papers! (See the excellent <a rel="nofollow" href="http://statcheck.io/" target="_blank">statcheck</a> to quickly check the stats of a paper). This error proneness can be at least partially explained by the fact that copy/pasting the (appropriate) values of any statistical software and formatting them textually is a very annoying process.</p>
<p><strong>How to end it?</strong></p>
<p>We believe that this could be solved (at least, partially) by the <strong>default implementation of current best practices of statistical reporting</strong>. A tool that automatically transforms a statistical result into a copy/pastable text. Of course, this automation cannot be suitable for each and every advanced usage, but would probably be satisfying for a substantial proportion of use cases. <strong>Implementing this unified, end-user oriented pipeline is the goal of the <a rel="nofollow" href="https://github.com/neuropsychology/psycho.R" target="_blank">psycho</a> package.</strong></p>
<h1>Fit an anova</h1>
<p>Let’s start by doing a traditional ANOVA with <em>adjusting</em> (the ability to flexibly regulate one’s emotions) as dependent variable, and <em>sex</em> and <em>salary</em> as categorical predictors.</p>
<div>
<div>
<pre><code><span># devtools::install_github(&quot;neuropsychology/psycho.R&quot;) # Install the latest psycho version</span><span>
</span><span>library</span><span>(</span><span>psycho</span><span>)</span><span>
</span><span>df</span><span> </span><span>&lt;-</span><span> </span><span>psycho</span><span>::</span><span>affective</span><span> </span><span># load a dataset available in the psycho package</span><span>
</span><span>aov_results</span><span> </span><span>&lt;-</span><span> </span><span>aov</span><span>(</span><span>Adjusting</span><span> </span><span>~</span><span> </span><span>Sex</span><span> </span><span>*</span><span> </span><span>Salary</span><span>,</span><span> </span><span>data</span><span>=</span><span>df</span><span>)</span><span> </span><span># Fit the ANOVA</span><span>
</span><span>summary</span><span>(</span><span>aov_results</span><span>)</span><span> </span><span># Inspect the results</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>             Df Sum Sq Mean Sq F value   Pr(>F)    
Sex           1   35.9   35.94  18.162 2.25e-05 ***
Salary        2    9.4    4.70   2.376   0.0936 .  
Sex:Salary    2    3.0    1.51   0.761   0.4674    
Residuals   859 1699.9    1.98                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
386 observations deleted due to missingness
</code></pre>
</div>
</div>
<h1>APA formatted output</h1>
<p>The <code>psycho</code> package include a simple function, <code>analyze()</code> that can be applied to an ANOVA object to format its content.</p>
<div>
<div>
<pre><code><span>analyze</span><span>(</span><span>aov_results</span><span>)</span><span>
</span></code></pre>
</div>
</div>
<div>
<div>
<pre><code>   - The effect of Sex is significant (F(1, 859) = 18.16, p &lt; .001) and can be considered as small (Partial Omega-squared = 0.019).
   - The effect of Salary is not significant (F(2, 859) = 2.38, p = 0.09°) and can be considered as very small (Partial Omega-squared = 0.0032).
   - The interaction between Sex and Salary is not significant (F(2, 859) = 0.76, p > .1) and can be considered as very small (Partial Omega-squared = 0).
</code></pre>
</div>
</div>
<p>It formats the results, computes the partial omega-squared as an index of effect size (better than the eta2, see <a rel="nofollow" href="https://academic.oup.com/hcr/article-abstract/28/4/612/4331349" target="_blank">Levine et al. 2002</a>, <a rel="nofollow" href="http://journals.sagepub.com/doi/abs/10.1177/0013164404264848" target="_blank">Pierce et al. 2004</a>) as well as its <a rel="nofollow" href="http://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/effectSize" target="_blank">interpretation</a> and presents the results in a APA-compatible way.</p>
<h1>Correlations, t-tests, regressions…</h1>
<p>Note that the <code>analyze()</code> method also exists for other statistical procudures, such as <a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/28/analyze_correlation.html" target="_blank">correlations</a>, <a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/19/analyze_ttest.html" target="_blank">t-tests</a> and <a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/05/01/repeated_measure_anovas.html" target="_blank">regressions</a>.</p>
<h1>Evolution</h1>
<p>Of course, these reporting standards should change, depending on new expert recommandations or official guidelines. <strong>The goal of this package is to flexibly adaptive to new changes and good practices evolution</strong>. Therefore, if you have any advices, opinions or such, we encourage you to either let us know by opening an <a rel="nofollow" href="https://github.com/neuropsychology/psycho.R/issues" target="_blank">issue</a>, or even better, try to implement them yourself by <a rel="nofollow" href="https://github.com/neuropsychology/psycho.R/blob/master/.github/CONTRIBUTING.md" target="_blank">contributing</a> to the code.</p>
<h1>Credits</h1>
<p>This package helped you? Don’t forget to cite the various packages you used <img alt="🙂" src="https://s.w.org/images/core/emoji/2.4/72x72/1f642.png" class="wp-smiley"></p>
<p>You can cite <code>psycho</code> as follows:</p>
<ul>
<li>Makowski, (2018). <em>The psycho Package: An Efficient and Publishing-Oriented Workflow for Psychological Science</em>. Journal of Open Source Software, 3(22), 470. <a rel="nofollow" href="https://doi.org/10.21105/joss.00470" target="_blank">https://doi.org/10.21105/joss.00470</a></li>
</ul>
<h1>On similar topics</h1>
<ul>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/07/14/standardize_grouped_df.html" target="_blank">Variable vs. Participant-wise Standardization</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/28/analyze_correlation.html" target="_blank">Formatted Correlation with Effect Size</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/25/refdata.html" target="_blank">Extracting a Reference Grid of your Data for Machine Learning Models Visualization</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/19/analyze_ttest.html" target="_blank">Copy/paste t-tests Directly to Manuscripts</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/11/bayesian_correlation.html" target="_blank">Easy APA Formatted Bayesian Correlation</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/06/03/plot_bayesian_model.html" target="_blank">Fancy Plot (with Posterior Samples) for Bayesian Regressions</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/05/24/n_factors.html" target="_blank">How Many Factors to Retain in Factor Analysis</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/05/20/correlation.html" target="_blank">Beautiful and Powerful Correlation Tables</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/05/10/interpret_mixed_models.html" target="_blank">Format and Interpret Linear Mixed Models</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/05/01/repeated_measure_anovas.html" target="_blank">How to do Repeated Measures ANOVAs</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/03/29/standardize.html" target="_blank">Standardize (Z-score) a dataframe</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/03/29/SDT.html" target="_blank">Compute Signal Detection Theory Indices</a></li>
<li><a rel="nofollow" href="https://neuropsychology.github.io/psycho.R/2018/03/21/installingR.html" target="_blank">Installing R, R Studio and psycho</a></li>
</ul>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://neuropsychology.github.io/psycho.R//2018/07/20/analyze_anova.html"> Dominique Makowski</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/wEruN7nvjd8" height="1"></a></div>