<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/rope-and-equivalence-testing-practically-equivalent/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://daniellakens.blogspot.com/2017/02/rope-and-equivalence-testing.html"> The 20% Statistician</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div><i>In a <a target="_blank" rel="nofollow" href="http://daniellakens.blogspot.nl/2017/01/examining-non-significant-results-with.html">previous post</a>, I compared equivalence tests to Bayes factors, and pointed out several benefits of equivalence tests. But a much more logical comparison, and one I did not give enough attention to so far, is the ROPE procedure using Bayesian estimation. I’d like to thank John Kruschke for feedback on a draft of this blog post. Check out his own recent blog comparing ROPE to Bayes factors <a target="_blank" rel="nofollow" href="http://doingbayesiandataanalysis.blogspot.nl/2016/12/bayesian-assessment-of-null-values.html">here</a>. </i>
<p>When we perform a study, we would like to conclude there is an effect, when there is an effect. But it is just as important to be able to conclude there is no effect, when there is no effect. I’ve recently published a <a target="_blank" rel="nofollow" href="https://osf.io/preprints/psyarxiv/97gpc/">paper</a> that makes Frequentist equivalence tests (using the two-one-sided tests, or TOST, approach) as easy as possible <span>(Lakens, 2017)</span>. Equivalence tests allow you to reject the presence of any effect you care about. In Bayesian estimation, one way to argue for the absence of a meaningful effect is the Region of Practical Equivalence (ROPE) procedure (Kruschke, 2014, chapter 12), which is “somewhat analogous to frequentist equivalence testing” <span>(Kruschke &amp; Liddell, 2017)</span>.</div>
<div></div>
<div>In the ROPE procedure, a 95% Highest Density Interval (HDI) is calculated based on a posterior distribution (which is calculated based on a prior and the data). Kruschke suggests that: “<i>if the 95 % HDI falls entirely inside the ROPE then we decide to accept the ROPE’d value for practical purposes</i>”. Note that the same HDI can also be used to reject the null hypothesis, where in Frequentist statistics, even though the confidence interval plays a similar role, you would still perform both a traditional <i>t</i>-test and the TOST procedure. </div>
<div></div>
<div>The only real difference with equivalence testing is that instead of using a confidence interval, a Bayesian Highest Density Interval is used. If the prior used by Kruschke was perfectly uniform, ROPE and equivalence testing would identical, barring philosophical differences in how the numbers should be interpreted. The BEST package by default uses a ‘broad’ prior, and therefore the 95% CI and 95% HDI are not exactly the same, but they are very close, for single comparisons. When multiple comparisons are made, (for example when using sequential analyses, <span>Lakens, 2014)</span>, the CI needs to be adjusted to maintain the desired error rate, but in Bayesian statistics, error rates are not directly controlled (they are limited due to ‘shrinkage’, but can be inflated beyond 5%, and often considerably so).
<p>In the code below, I randomly generate random normally distributed data (with means of 0 and a sd of 1) and perform the ROPE procedure and the TOST. The 95% HDI is from -0.10 to 0.42, and the 95% CI is from -0.11 to 0.41, with mean differences of 0.17 or 0.15. </p></div>
<div></div>
<div></div>
<div>
<div><a target="_blank" rel="nofollow" href="https://i2.wp.com/1.bp.blogspot.com/-yspzszE-FUk/WKAjJxBK6fI/AAAAAAAAD3E/OU4ohyevVjYbxfclOhQYr_w6lHCpM7FfACLcB/s1600/BEST.png?ssl=1"><img src="https://i1.wp.com/1.bp.blogspot.com/-yspzszE-FUk/WKAjJxBK6fI/AAAAAAAAD3E/OU4ohyevVjYbxfclOhQYr_w6lHCpM7FfACLcB/s400/BEST.png?resize=400%2C260&ssl=1" border="0" data-recalc-dims="1"></a></div>
<p>
<div><a target="_blank" rel="nofollow" href="https://i1.wp.com/4.bp.blogspot.com/-Jnaf5kccEbw/WKAjJ8VPWqI/AAAAAAAAD3A/iMdIfm_uGZ8YShqCfT5IkQYYSVp8ogVIgCLcB/s1600/TOST.png?ssl=1"><img src="https://i0.wp.com/4.bp.blogspot.com/-Jnaf5kccEbw/WKAjJ8VPWqI/AAAAAAAAD3A/iMdIfm_uGZ8YShqCfT5IkQYYSVp8ogVIgCLcB/s400/TOST.png?resize=400%2C260&ssl=1" border="0" data-recalc-dims="1"></a></div>
<p></div>
<div></div>
<div></div>
<div>Indeed, if you will forgive me the pun, you might say these two approaches are practically equivalent. But there are some subtle differences between ROPE and TOST</div>
<div></div>
<div><b>95% HDI vs 90% CI</b></div>
<div></div>
<div>Kruschke <span>(2014</span>, Chapter 5) writes: “<i>How should we define “reasonably credible”? One way is by saying that any points within the 95% HDI are reasonably credible.</i>” There is not a strong justification for the use of a 95% HDI over a 96% of 93% HDI, except that it mirrors the familiar use of a 95% CI in Frequentist statistics. In Frequentist statistics, the 95% confidence interval is directly related to the 5% alpha level that is commonly deemed acceptable for a maximum Type 1 error rate (even though this alpha level is in itself a convention without strong justification).</div>
<div></div>
<div>But here’s the catch: The TOST equivalence testing procedure does not use a 95% CI, but a 90% CI. The reason for this is that two one-sided tests are performed. Each of these tests has a 5% error rate. You might intuitively think that doing two tests with a 5% error rate will increase the overall Type 1 error rate, but in this case, that’s not true. You could easily replace the two tests, with just one test, testing the observed effect against the equivalence bound (upper or lower) closest to it. If this test is statistically significant, so is the other – and thus, there is no alpha inflation in this specific case. That’s why the TOST procedure uses a 90% CI to have a 5% error rate, while the same researcher would use a 95% CI in a traditional two-sided <i>t</i>-test to examine whether the observed effect is statistically different from 0, while maintaining a 5% error rate (see <span>also Senn, 2007, section 22.2.4)</span> </div>
<div></div>
<div>This nicely illustrates the difference between estimation (where you just want to have a certain level of accuracy, such as 95%), and Frequentist hypothesis testing, where you want to distinguish between signal and noise, and not be wrong more than 5% of the time when you declare there is a signal. ROPE keeps the accuracy the same across tests, Frequentist approaches keep the error rate constant. From a Frequentist perspective, ROPE is more conservative than TOST, like the use of alpha = 0.025 is more conservative than the use of alpha = 0.05.</div>
<div></div>
<div><b>Power analysis</b></div>
<div></div>
<div>For an equivalence test, power analysis can be performed based on closed functions, and the calculations take just a fraction of a second. I find that useful, for example in my role in our ethics board, where we evaluate proposals that have to justify their sample size, and we often check power calculations. Kruschke has an excellent R package (BEST) that can do power analyses for the ROPE procedure. This is great work – but the simulations take a while (a little bit over an hour for 1000 simulations). </div>
<div></div>
<div>Because the BESTpower function relies on simulations, you need to specify the sample size, and it will calculate the power. That’s actually the reverse of what you typically want in a power analysis (you want to input the desired power, and see which sample size you need). This means you most likely need to run multiple simulations in BESTpower, before you have determined the sample size that will yield good power. Furthermore, the software requires your to specify the expected means and standard deviations, instead of simply an expected effect size. Instead of Frequentist power analysis, where the hypothesized effect size is a point value (e.g., d = 0.4), Bayesian power analysis models the alternative as a distribution, acknowledging there is uncertainty.</div>
<div></div>
<div>In the end, however, the result of a power analysis for ROPE and for TOST is actually remarkably similar. Using the code below to perform the power analysis for ROPE, we see that 100 participants in each group give us approximately 88.4% power (with 2000 simulations, this estimate is still a bit uncertain) to get a 95% HDI that falls within our ROPE of -0.5 to 0.5, assuming standard deviations of 1.</div>
<div></div>
<div>We can use the powerTOSTtwo.raw function in the TOSTER package (using an alpha of 0.025 instead of 0.05, to mirror to 95% HDI) to calculate the sample size we would need to achieve 88.4% power for independent t-test (using equivalence bounds of -0.5 and 0.5, and standard deviations of 1):</div>
<div></div>
<div><b><span>powerTOSTtwo.raw(alpha=0.025,statistical_power=0.875,low_eqbound=-0.5,high_eqbound=0.5,sdpooled=1)</span></b></div>
<div></div>
<div>The outcome is 100 as well. So if you use a broad prior, it seems you can save yourself some time by using the power analysis for equivalence tests, without severe consequences.</div>
<div></div>
<div><b>Use of prior information</b></div>
<div></div>
<div><a target="_blank" rel="nofollow" href="https://www.blogger.com/blogger.g?blogID=987850932434001559"></a><a target="_blank" rel="nofollow" href="https://www.blogger.com/blogger.g?blogID=987850932434001559"></a>The biggest benefit of ROPE over TOST is that is allows you to incorporate prior information in your data analysis. If you have reliable prior information, ROPE can use this information, which is especially useful if you don’t have a lot of data. If you use priors, it is typically advised to check the robustness of the posterior against reasonable changes in the prior <span>(Kruschke, 2013)</span>. </div>
<div></div>
<div><b>Conclusion</b></div>
<div></div>
<div>Using the ROPE procedure or the TOST procedure will most likely lead to very similar inferences. For all practical purposes, the differences are small. It’s quite a lot easier to perform a power analysis for TOST, and by default, TOST has greater statistical power because it uses 90% CI. But power analysis is possible for ROPE (which is a rare pleasure to see for Bayesian analyses), and you could choose to use a 90% HDI, or any other value that matches your goals. TOST will be easier and more familiar because it is just a twist on the classic <i>t</i>-test, but ROPE might be a great way to dip your toes in Bayesian waters and explore the many more things you can do with Bayesian posterior distributions. </div>
<div></div>
<div><b>References<i> </i></b></div>
<div><span>Kruschke, J. (2013). Bayesian estimation supersedes the t test. <i>Journal of Experimental Psychology: General</i>, <i>142</i>(2), 573–603. https://doi.org/10.1037/a0029146</span></div>
<div><span>Kruschke, J. (2014). <i>Doing Bayesian Data Analysis, Second Edition: A Tutorial with R, JAGS, and Stan</i> (2 edition). Boston: Academic Press.</span></div>
<div><span>Kruschke, J., &amp; Liddell, T. M. (2017). The Bayesian New Statistics: Hypothesis testing, estimation, meta-analysis, and power analysis from a Bayesian perspective. <i>Psychonomic Bulletin &amp; Review</i>. https://doi.org/10.3758/s13423-016-1221-4</span></div>
<div><span>Lakens, D. (2014). Performing high-powered studies efficiently with sequential analyses: Sequential analyses. <i>European Journal of Social Psychology</i>, <i>44</i>(7), 701–710. https://doi.org/10.1002/ejsp.2023</span></div>
<div><span>Lakens, D. (2017). Equivalence tests: A practical primer for t-tests, correlations, and meta-analyses. <i>Social Psychological and Personality Science</i>.</span></div>
<div><span>Senn, S. (2007). <i>Statistical issues in drug development</i> (2nd ed). Chichester, England ; Hoboken, NJ: John Wiley &amp; Sons.</span></div>
<div></div>
<div></div>
<div></div>
<p></p>
<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/2017/02/rope-and-equivalence-testing.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/Fd5LFQ9sV9g"></a></div>