<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/tost-equivalence-testing-r-package-toster-and-spreadsheet/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://daniellakens.blogspot.com/2016/12/tost-equivalence-testing-r-package.html"> The 20% Statistician</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><br>I’m happy to announce my first R package ‘TOSTER’ for equivalence tests (but don’t worry, there is an old-fashioned spreadsheet as well). <div></div>
<div>In an earlier blog post I talked about equivalence tests. Sometimes you perform a study where you might expect the effect is zero or very small. So how can we conclude an effect is ‘zero or very small’? One approach is to specify effect sizes we consider ‘not small’. For example, we might decide that effects larger than d = 0.3 (or smaller than d = -0.3 in a two-sided <i>t</i>-test), are ‘not small’. Now, if we observe an effect that falls between the two equivalence bounds of d = -0.3 and d = 0.3 we can act (in good old-fashioned Neyman-Pearson approach to statistical inferences) as if the effect is ‘zero or very small’. It might not be exactly zero, but it is small enough. You can check out a great <a target="_blank" rel="nofollow" href="http://rpsychologist.com/d3/equivalence/">interactive visualization of equivalence testing</a> by RPsychologist. </div>
<p>
<div></div>
<div>We can use two one-sided tests to statistically reject effects <span>≤</span>-0.3, and <span>≥ 0.3. This is the basic idea of the TOST (two one-sided tests) equivalence procedure. The idea is simple, and it is conceptually similar to the traditional null-hypothesis test you probably use in your article to reject an effect of zero. But where all statistics programs will allow you to perform a normal <i>t</i>-test, it is not yet that easy to perform a TOST equivalence test (<a target="_blank" rel="nofollow" href="https://www.minitab.com/en-us/">Minitab </a>is one exception). </span></div>
<div></div>
<div><span>But psychology really needs a way to show effects are too small to matter (see ‘<a target="_blank" rel="nofollow" href="https://raw.githubusercontent.com/richarddmorey/psychology_resolution/master/paper/response.pdf">Why most findings in psychology are statistically unfalsifiable</a>’ by Richard Morey and me). So I made a <a target="_blank" rel="nofollow" href="https://osf.io/qzjaj/">spreadsheet </a>and R package to perform the TOST procedure. The R package is available from CRAN, which means you can install it using install.packages(“TOSTER”). </span></div>
<div></div>
<div><span>Let’s try a practical example (this is one of the examples from the <a target="_blank" rel="nofollow" href="https://cran.rstudio.com/web/packages/TOSTER/vignettes/IntroductionToTOSTER.html">vignette </a>that comes with the R package). </span></div>
<div></div>
<div><span>Eskine (2013) showed that participants who had been exposed to organic food were substantially harsher in their moral judgments relative to those in the control condition (Cohen’s <i>d</i> = 0.81, 95% CI: [0.19, 1.45]). A replication by Moery &amp; Calin-Jageman (2016, Study 2) did not observe a significant effect (Control: n = 95, M = 5.25, SD = 0.95, Organic Food: n = 89, M = 5.22, SD = 0.83). The authors have used Simonsohn’s recommendation to power their study so that they have 80% power to detect an effect the original study had 33% power to detect. This is the same as saying: We consider an effect to be ‘small’ when it is smaller than the effect size the original study had 33% power to detect.</span></div>
<div></div>
<div><span>With n = 21 in each condition, Eskine (2013) had 33% to detect an effect of d = 0.48. This is the effect the authors of the replication study designed their study to detect. The original study had shown an effect of d = 0.81, and the authors performing the replication decided that an effect size of d = 0.48 would be the smallest effect size they will aim to detect with 80% power. So we can use this effect size as the equivalence bound. We can use R to perform an equivalence test: </span></div>
<div></div>
<div><b><span>install.packages(“TOSTER”)</span></b></div>
<div><b><span>library(“TOSTER”)</span></b></div>
<div><b><span>TOSTtwo(m1=5.25, m2=5.22, sd1=0.95, sd2=0.83, n1=95, n2=89, low_eqbound_d=-0.43, high_eqbound_d=0.43, alpha = 0.05)</span></b></div>
<div></div>
<div><span>Which gives us the following output:</span></div>
<div></div>
<div><b><span><span>Using alpha = 0.05 Student’s t-test was non-significant, t(182) = 0.2274761, p = 0.8203089</span></span></b></div>
<div><b><span><span>Using alpha = 0.05 the equivalence test based on Student’s t-test was significant, t(182) = -3.026311, p = 0.001417168</span></span></b></div>
<p><b><span> </span></b>
<div><b><span><span>TOST results:</span></span></b></div>
<div><b><span><span><span>  </span>t-value 1<span>    </span>p-value 1 t-value 2<span>   </span>p-value 2<span>  </span>df</span></span></b><br><b><span><span>1<span>  </span>3.481263 0.0003123764 -3.026311 0.001417168 182</span></span></b></div>
<p><b><span> </span></b>
<div><b><span><span>Equivalence bounds (Cohen’s d):</span></span></b></div>
<div><b><span><span><span>  </span>low bound d high bound d</span></span></b></div>
<div><b><span><span>1<span>       </span>-0.48<span>         </span>0.48</span></span></b></div>
<p><b><span> </span></b>
<div><b><span><span>Equivalence bounds (raw scores):</span></span></b></div>
<div><b><span><span><span>  </span>low bound raw high bound raw</span></span></b></div>
<div><b><span><span>1<span>    </span>-0.4291159<span>      </span>0.4291159</span></span></b></div>
<p><b><span> </span></b>
<div><b><span><span>TOST confidence interval:</span></span></b></div>
<div><b><span><span><span>  </span>Lower Limit 90% CI raw Upper Limit 90% CI raw</span></span></b></div>
<div><b><span><span>1<span>             </span>-0.1880364<span>              </span>0.2480364</span></span></b></div>
<div><span>You see, we are just using R like a fancy calculator, entering all the numbers in a single function. But I can understand if you are a bit intimidated by R. So, you can also fill in the same info in the <a target="_blank" rel="nofollow" href="https://osf.io/qzjaj/">spreadsheet</a> (click picture to zoom):</span></div>
<div></div>
<p>
<div><a target="_blank" rel="nofollow" href="https://i1.wp.com/1.bp.blogspot.com/-45iYY5cGCrc/WEp3sqg6AwI/AAAAAAAADzk/D8UuNfL2VFkrtZSHlD9oJD-sW5R2vdmpwCLcB/s1600/TOSTERexample.png?ssl=1"><img src="https://i1.wp.com/1.bp.blogspot.com/-45iYY5cGCrc/WEp3sqg6AwI/AAAAAAAADzk/D8UuNfL2VFkrtZSHlD9oJD-sW5R2vdmpwCLcB/s400/TOSTERexample.png?resize=400%2C122&ssl=1" border="0" data-recalc-dims="1"></a></div>
<div></div>
<div></div>
<div><span>Using a TOST equivalence procedure with alpha = 0.05, and without assuming equal variances (because when sample sizes are unequal, <a target="_blank" rel="nofollow" href="http://daniellakens.blogspot.nl/2015/01/always-use-welchs-t-test-instead-of.html">you should report Welch’s t-test by default</a>), we can reject effects larger than d = 0.48: t(182) = -3.03, p = 0.001. </span></div>
<div></div>
<div>The R package also gives a graph, where you see the observed mean difference (in raw scale units), the equivalence bounds (also in raw scores), and the 90% and 95% CI. If the 90% CI does not include the equivalence bounds, we can declare equivalence. </div>
<div></div>
<div></div>
<div><a target="_blank" rel="nofollow" href="https://i1.wp.com/1.bp.blogspot.com/-mD6z7kFAUWQ/WEp3dXUJInI/AAAAAAAADzg/wngkppBwFGY-w7HJIefk5zIjq_rkE0qqQCLcB/s1600/TOSTERCI.png?ssl=1"><img src="https://i0.wp.com/1.bp.blogspot.com/-mD6z7kFAUWQ/WEp3dXUJInI/AAAAAAAADzg/wngkppBwFGY-w7HJIefk5zIjq_rkE0qqQCLcB/s400/TOSTERCI.png?resize=400%2C263&ssl=1" border="0" data-recalc-dims="1"></a></div>
<div></div>
<div></div>
<div>Moery and Calin-Jageman concluded from this study: “We again found that food exposure has little to no effect on moral judgments” But what is ‘little to no”? The equivalence test tells us the authors successfully rejected effects of a size the original study had 33% power to reject. Instead of saying ‘little to no’ we can put a number on the effect size we have rejected by performing an equivalence test. </div>
<div></div>
<div>If you want to read more about equivalence tests, including how to perform them for one-sample <i>t</i>-tests, dependent <i>t</i>-tests, correlations, or meta-analyses, you can check out a practical primer on equivalence testing using the TOST procedure I’ve written. It’s available as a <a target="_blank" rel="nofollow" href="https://osf.io/preprints/psyarxiv/97gpc/">pre-print on PsyArXiv</a>. The R code is available on <a target="_blank" rel="nofollow" href="https://github.com/Lakens/TOSTER">GitHub</a>. </div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://daniellakens.blogspot.com/2016/12/tost-equivalence-testing-r-package.html"> The 20% Statistician</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/xFjqPjrliVw"></a></div>