<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/r-functions-for-bayesian-model-statistics-and-summaries-rstats-stan-brms/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://strengejacke.wordpress.com/2018/06/06/r-functions-for-bayesian-model-statistics-and-summaries-rstats-stan-brms/"> R – Strenge Jacke!</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>A new update of my <a rel="nofollow" href="https://cran.r-project.org/package=sjstats" target="_blank">sjstats-package</a> just arrived at CRAN. This blog post demontrates those functions of the sjstats-package that deal especially with Bayesian models. The update contains some new and some revised functions to compute summary statistics of Bayesian models, which are now described in more detail.</p>
<ul>
<li>hdi()</li>
<li>rope()</li>
<li>mcse()</li>
<li>n_eff()</li>
<li>tidy_stan()</li>
<li>equi_test()</li>
<li>mediation()</li>
<li>icc()</li>
<li>r2()</li>
</ul>
<p>Before we start, we fit some models, including a mediation-object from the mediation-package, which we use for comparison with brms. The functions work with <code>brmsfit</code>, <code>stanreg</code> and <code>stanfit</code>-objects.</p>
<p><span></span></p>
<pre><code>library(sjstats)
library(sjmisc)
library(mediation)
library(brms)

<span># load sample data</span>
data(jobs)
data(efc)
efc &lt;- to_factor(efc, e42dep, c172code, c161sex, e15relat)
zinb &lt;- read.csv(&quot;http://stats.idre.ucla.edu/stat/data/fish.csv&quot;)

<span># linear models, for mediation analysis</span>
b1 &lt;- lm(job_seek ~ treat + econ_hard + sex + age, data = jobs)
b2 &lt;- lm(depress2 ~ treat + job_seek + econ_hard + sex + age, data = jobs)

<span># mediation analysis, for comparison with brms</span>
m1 &lt;- mediate(b1, b2, sims = 1000, treat = &quot;treat&quot;, mediator = &quot;job_seek&quot;)

<span># fit Bayesian models</span>
f1 &lt;- bf(job_seek ~ treat + econ_hard + sex + age)
f2 &lt;- bf(depress2 ~ treat + job_seek + econ_hard + sex + age)

m2 &lt;- brm(f1 + f2 + set_rescor(FALSE), data = jobs, cores = 4)

m3 &lt;- brm(
  bf(count ~ child + camper + (1 | persons), 
     zi ~ child + camper + (1 | persons)),
  data = zinb,
  family = zero_inflated_poisson(),
  cores = 4
)

m4 &lt;- brm(
  mpg ~ wt + hp + (1 | cyl) + (1 + wt | gear), 
  data = mtcars, 
  cores = 4
)

m5 &lt;- brm(
  neg_c_7 ~ e42dep + c12hour + c172code + (1 | e15relat),
  data = efc,
  cores = 4
)</code></pre>
<h2>Highest Density Interval</h2>
<p><code>hdi()</code> computes the highest density interval for posterior samples. Unlike equal-tailed intervals that exclude 2.5% from each tail of the distribution, the HDI is not equal-tailed and therefor always includes the mode(s) of posterior distributions.</p>
<p>By default, <code>hdi()</code> prints the 90% intervals, however, the prob-argument can be used to calculate different or even multiple intervals.</p>
<pre><code>hdi(m2)
<span>#> # Highest Density Interval
#> #> HDI(90%)
#> b_jobseek_Intercept [ 3.45 3.87]
#> b_depress2_Intercept [ 1.95 2.44]
#> b_jobseek_treat [-0.02 0.15]
#> b_jobseek_econ_hard [ 0.01 0.09]
#> b_jobseek_sex [-0.09 0.07]
#> b_jobseek_age [ 0.00 0.01]
#> b_depress2_treat [-0.11 0.03]
#> b_depress2_job_seek [-0.29 -0.19]
#> b_depress2_econ_hard [ 0.12 0.18]
#> b_depress2_sex [ 0.04 0.18]
#> b_depress2_age [-0.00 0.00]
#> sigma_jobseek [ 0.70 0.75]
#> sigma_depress2 [ 0.59 0.64]</span>

hdi(m2, prob = c(.5, .89))
<span>#> # Highest Density Interval
#> #> HDI(50%) HDI(89%)
#> b_jobseek_Intercept [ 3.60 3.78] [ 3.47 3.88]
#> b_depress2_Intercept [ 2.10 2.30] [ 1.96 2.43]
#> b_jobseek_treat [ 0.03 0.10] [-0.02 0.15]
#> b_jobseek_econ_hard [ 0.03 0.07] [ 0.01 0.09]
#> b_jobseek_sex [-0.05 0.02] [-0.09 0.07]
#> b_jobseek_age [ 0.00 0.01] [ 0.00 0.01]
#> b_depress2_treat [-0.06 -0.01] [-0.10 0.03]
#> b_depress2_job_seek [-0.26 -0.22] [-0.29 -0.19]
#> b_depress2_econ_hard [ 0.14 0.16] [ 0.12 0.18]
#> b_depress2_sex [ 0.08 0.14] [ 0.04 0.18]
#> b_depress2_age [-0.00 0.00] [-0.00 0.00]
#> sigma_jobseek [ 0.71 0.74] [ 0.70 0.75]
#> sigma_depress2 [ 0.61 0.62] [ 0.59 0.64]</span></code></pre>
<h3>HDI for random effects</h3>
<p>For multilevel models, the type-argument defines whether the HDI of fixed, random or all effects are shown.</p>
<pre><code>hdi(m5, type = &quot;random&quot;)
<span>#> # Highest Density Interval
#> #> HDI(90%)
#> r_e15relat.1.Intercept. [-0.15 1.30]
#> r_e15relat.2.Intercept. [-0.15 1.02]
#> r_e15relat.3.Intercept. [-0.91 0.70]
#> r_e15relat.4.Intercept. [-0.61 0.75]
#> r_e15relat.5.Intercept. [-0.89 0.77]
#> r_e15relat.6.Intercept. [-1.66 0.23]
#> r_e15relat.7.Intercept. [-1.22 0.86]
#> r_e15relat.8.Intercept. [-0.89 0.43]</span></code></pre>
<p>The computation for the HDI is based on the code from <em>Kruschke 2015, pp. 727f</em>. For default sampling in Stan (4000 samples), the 90% intervals for HDI are more stable than, for instance, 95% intervals. An effective sample size of at least 10.000 is recommended if 95% intervals should be computed (see <em>Kruschke 2015, p. 183ff</em>).</p>
<h2>Region of Practical Equivalence (ROPE)</h2>
<p>Unlike a frequentist approach, Bayesian inference is not based on stastical significance, where effects need to be different from “zero”. Rather, the magnitude of a model’s parameter value and its uncertainty should not be ignored, and hence, an effect is not present when it simply differs from zero, but if it’s outside a specific range that can be considered as “practically no effect”. This range is called the <em>region of practical equivalence</em> (ROPE).</p>
<p><code>rope()</code> requires the <code>rope</code>-argument, which defined this region, and then gives a summary about the parameters and their proportion that lies inside and outside this ROPE.</p>
<pre><code>rope(m5, rope = c(-1, 1))
<span>#> # Proportions of samples inside and outside the ROPE
#> #> inside outside
#> b_Intercept 0.0% 100.0%
#> b_e42dep2 42.9% 57.1%
#> b_e42dep3 0.5% 99.5%
#> b_e42dep4 0.0% 100.0%
#> b_c12hour 100.0% 0.0%
#> b_c172code2 99.5% 0.5%
#> b_c172code3 78.3% 21.7%
#> sigma 0.0% 100.0%</span></code></pre>
<p><code>rope()</code> does not suggest limits for the region of practical equivalence and does not tell you how big is practically equivalent to the null value. However, there are suggestions how to choose reasonable limits (see <em>Kruschke 2018</em>), which are implemented in the <code>equi_test()</code> functions.</p>
<h2>Test for Practical Equivalence</h2>
<p><code>equi_test()</code> combines the two functions <code>hdi()</code> and <code>rope()</code> and performs a “HDI+ROPE decision rule” (Test for Practical Equivalence) (<em>Kruschke 2018</em>) to check whether parameter values should be accepted or rejected against the background of a formulated „null hypothesis“.</p>
<p><code>equi_test()</code> computes the 95%-HDI and checks if a model predictor’s HDI lies completely outside, completely inside or partially inside the ROPE. If the HDI is completely outside the ROPE, the “null hypothesis” for this parameter is “rejected”. If the ROPE completely covers the HDI, i.e. all most credible values of a parameter are inside the region of practical equivalence, the null hypothesis is accepted. Else, it’s undecided whether to accept or reject the null hypothesis. In short, desirable results are low proportions inside the ROPE (the closer to zero the better) and the H0 should be rejected.</p>
<p>If neither the <code>rope</code> nor <code>eff_size</code> argument are specified, the effect size will be set to 0.1 (half of a small effect according to Cohen) and the ROPE is then <code>0 +/- .1 * sd(y)</code> for <em>linear</em> models. This is the suggested way to specify the ROPE limits according to <em>Kruschke (2018)</em>.</p>
<pre><code>equi_test(m5)
<span>#> # Test for Practical Equivalence of Model Predictors
#> #> Effect Size: 0.10
#> ROPE: [-0.39 0.39]
#> Samples: 4000
#> #> H0 %inROPE HDI(95%)
#> b_Intercept (*) reject 0.00 [ 7.51 9.89]
#> b_e42dep2 (*) undecided 8.30 [ 0.09 2.12]
#> b_e42dep3 (*) reject 0.02 [ 1.32 3.32]
#> b_e42dep4 (*) reject 0.00 [ 2.79 4.91]
#> b_c12hour accept 100.00 [ 0.00 0.01]
#> b_c172code2 undecided 70.83 [-0.44 0.76]
#> b_c172code3 undecided 22.57 [-0.04 1.49]
#> sigma reject 0.00 [ 3.40 3.76]
#> #> (*) the number of effective samples may be insufficient for some parameters</span></code></pre>
<p>For models with <em>binary outcome</em>, there is no concrete way to derive the effect size that defines the ROPE limits. Two examples from Kruschke suggest that a negligible change is about .05 on the logit-scale. In these cases, it is recommended to specify the rope argument, however, if not specified, the ROPE limits are calculated in this way: <code>0 +/- .1 * sd(intercept) / 4</code>. For all other models, <code>0 +/- .1 * sd(intercept)</code> is used to determine the ROPE limits. These formulas are based on experience that worked well in real-life situations, but are most likely not generally the best approach.</p>
<p>Beside a numerical output, the results can also be printed as HTML-table or plotted, using the <code>out</code>-argument. For plots, the 95% distributions of the posterior samles are shown, the ROPE is a light-blue shaded region in the plot, and the distributions are colored depending on whether the parameter values are accepted, rejected or undecided.</p>
<pre><code>equi_test(m5, out = &quot;plot&quot;)</code></pre>
<p><img data-orig-file="https://strengejacke.files.wordpress.com/2018/06/unnamed-chunk-6-1.png" data-orig-size="1344,960" data-medium-file="https://strengejacke.files.wordpress.com/2018/06/unnamed-chunk-6-1.png?w=300" data-attachment-id="1616" data-image-meta="{" data-image-description="" src="https://strengejacke.files.wordpress.com/2018/06/unnamed-chunk-6-1.png?w=450&h=731&fit=1024%2C731" data-permalink="https://strengejacke.wordpress.com/2018/06/06/r-functions-for-bayesian-model-statistics-and-summaries-rstats-stan-brms/unnamed-chunk-6-1/" data-large-file="https://strengejacke.files.wordpress.com/2018/06/unnamed-chunk-6-1.png?w=450&amp;h=731&amp;fit=1024%2C731" alt="" data-image-title="equi_test()" sizes="(max-width: 1024px) 100vw, 1024px" data-comments-opened="0" class="wp-image-1616" data-recalc-dims="1"></p>
<h2>Tidy Summary of Bayesian Models</h2>
<p><code>tidy_stan()</code> is no substitute, but rather a convenient alternative to <code>summary()</code>. The major differences are: <code>tidy_stan()</code>…</p>
<ul>
<li>focusses on the parameter values (estimates) and gives no information on samples, data, or formula</li>
<li>calculates the HDI rather than equi-tailed intervals</li>
<li>separates different model parts, e.g. random from fixed effects, or conditional from zero-inflated models</li>
<li>and prints everything nicely</li>
</ul>
<pre><code>tidy_stan(m3)
<span>#> # Summary Statistics of Stan-Model
#> #> ## Conditional Model:
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> Intercept 1.23 0.75 [-0.27 2.80] 0.17 1 0.04
#> child -1.15 0.10 [-1.29 -1.00] 1.00 1 0.00
#> camper 0.73 0.10 [ 0.59 0.89] 1.00 1 0.00
#> #> ## Zero-Inflated Model:
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> Intercept -0.68 0.74 [-1.88 0.55] 0.27 1 0.02
#> child 1.89 0.33 [ 1.36 2.43] 0.85 1 0.01
#> camper -0.85 0.34 [-1.42 -0.30] 1.00 1 0.01</span></code></pre>
<p>Additional statistics in the output are:</p>
<ul>
<li>standard errors (which are actually median absolute deviations)</li>
<li>ratio of effective numbers of samples, neff_ratio, (i.e. effective number of samples divided by total number of samples); this ratio ranges from 0 to 1, and should be close to 1; the closer this ratio comes to zero means that the chains may be inefficient, but possibly still okay</li>
<li>Rhat statistics; when Rhat is above 1, it usually indicates that the chain has not yet converged, indicating that the drawn samples might not be trustworthy; drawing more iteration may solve this issue</li>
<li>Monte Carlo Standard Error (mcse)</li>
</ul>
<h3>Change „point“-estimate in output</h3>
<p>By default, the “estimate” is the median of the posterior distribution, but this can be changed with the <code>typical</code>-argument.</p>
<pre><code>tidy_stan(m3, typical = &quot;mean&quot;)
 <span>#> # Summary Statistics of Stan-Model
#> #> ## Conditional Model:
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> Intercept 1.18 0.75 [-0.27 2.80] 0.17 1 0.04
#> child -1.15 0.10 [-1.29 -1.00] 1.00 1 0.00
#> camper 0.73 0.10 [ 0.59 0.89] 1.00 1 0.00
#> #> ## Zero-Inflated Model:
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> Intercept -0.70 0.74 [-1.88 0.55] 0.27 1 0.02
#> child 1.89 0.33 [ 1.36 2.43] 0.85 1 0.01
#> camper -0.85 0.34 [-1.42 -0.30] 1.00 1 0.01</span></code></pre>
<h3>Show random effects in output</h3>
<p>To also show random effects of multilevel models, use the <code>type</code>-argument.</p>
<pre><code><span># printing fixed and random effects of multilevel model</span>
tidy_stan(m3, type = &quot;all&quot;)
<span>#> # Summary Statistics of Stan-Model
#> #> ## Conditional Model: Fixed effects
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> Intercept 1.23 0.75 [-0.27 2.80] 0.17 1 0.04
#> child -1.15 0.10 [-1.29 -1.00] 1.00 1 0.00
#> camper 0.73 0.10 [ 0.59 0.89] 1.00 1 0.00
#> #> ## Conditional Model: Random effect (Intercept: persons)
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> persons.1 -1.27 0.77 [-2.83 0.26] 0.17 1 0.04
#> persons.2 -0.31 0.75 [-1.90 1.18] 0.17 1 0.04
#> persons.3 0.40 0.75 [-1.07 1.97] 0.17 1 0.04
#> persons.4 1.28 0.73 [-0.27 2.77] 0.17 1 0.04
#> #> ## Zero-Inflated Model: Fixed effects
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> Intercept -0.68 0.74 [-1.88 0.55] 0.27 1 0.02
#> child 1.89 0.33 [ 1.36 2.43] 0.85 1 0.01
#> camper -0.85 0.34 [-1.42 -0.30] 1.00 1 0.01
#> #> ## Zero-Inflated Model: Random effect (Intercept: persons)
#> #> estimate std.error HDI(89%) neff_ratio Rhat mcse
#> persons.1 1.27 0.79 [ 0.07 2.68] 0.32 1 0.02
#> persons.2 0.32 0.70 [-0.86 1.57] 0.28 1 0.02
#> persons.3 -0.15 0.73 [-1.38 1.14] 0.28 1 0.02
#> persons.4 -1.30 0.77 [-2.66 -0.11] 0.30 1 0.02</span></code></pre>
<h3>Show multiple HDI’s in output</h3>
<p>By default, 89%-HDI are computed (a convention following <em>McElreath 2015</em>), but other or even multiple HDI can be computed using the <code>prob</code>-argument.</p>
<pre><code><span># two different HDI for multivariate response model</span>
tidy_stan(m2, prob = c(.5, .95))
<span>#> # Summary Statistics of Stan-Model
#> #> ## Response: jobseek
#> #> estimate std.error HDI(50%) HDI(95%) neff_ratio Rhat mcse
#> Intercept 3.67 0.13 [ 3.60 3.78] [ 3.43 3.93] 1 1 0
#> treat 0.07 0.05 [ 0.03 0.10] [-0.04 0.16] 1 1 0
#> econ_hard 0.05 0.03 [ 0.03 0.07] [ 0.00 0.10] 1 1 0
#> sex -0.01 0.05 [-0.05 0.02] [-0.10 0.09] 1 1 0
#> age 0.00 0.00 [ 0.00 0.01] [-0.00 0.01] 1 1 0
#> #> ## Response: depress2
#> #> estimate std.error HDI(50%) HDI(95%) neff_ratio Rhat mcse
#> Intercept 2.21 0.15 [ 2.10 2.30] [ 1.90 2.49] 1 1 0
#> treat -0.04 0.04 [-0.06 -0.01] [-0.12 0.04] 1 1 0
#> joseek -0.24 0.03 [-0.26 -0.22] [-0.30 -0.18] 1 1 0
#> econ_hard 0.15 0.02 [ 0.14 0.16] [ 0.11 0.19] 1 1 0
#> sex 0.11 0.04 [ 0.08 0.14] [ 0.02 0.18] 1 1 0
#> age 0.00 0.00 [-0.00 0.00] [-0.00 0.00] 1 1 0</span></code></pre>
<h2>Summary of Mediation Analysis</h2>
<p><code>mediation()</code> is another summary function, especially for mediation analysis, i.e. for multivariate response models with casual mediation effects.</p>
<p>Let us recall the models:</p>
<pre><code>f1 &lt;- bf(job_seek ~ treat + econ_hard + sex + age)
f2 &lt;- bf(depress2 ~ treat + job_seek + econ_hard + sex + age)
m2 &lt;- brm(f1 + f2 + set_rescor(FALSE), data = jobs, cores = 4)</code></pre>
<p>Here, <em>treat</em> is the treatment effect, <em>job_seek</em> is the mediator effect, <em>f1</em> describes the mediator model and <em>f2</em> describes the outcome model.</p>
<p><code>mediation()</code> returns a data frame with information on the <em>direct effect</em> (median value of posterior samples from treatment of the outcome model), <em>mediator effect</em> (median value of posterior samples from mediator of the outcome model), <em>indirect effect</em> (median value of the multiplication of the posterior samples from mediator of the outcome model and the posterior samples from treatment of the mediation model) and the <em>total effect</em> (median value of sums of posterior samples used for the direct and indirect effect). The <em>proportion mediated</em> is the indirect effect divided by the total effect.</p>
<p>The simplest call just needs the model-object.</p>
<pre><code>mediation(m2)
<span>#> # Causal Mediation Analysis for Stan Model
#> #> Treatment: treat
#> Mediator: job_seek
#> Response: depress2
#> #> Estimate HDI (90%)
#> Direct effect: -0.04 [-0.11 0.03]
#> Indirect effect: -0.02 [-0.04 0.01]
#> Total effect: -0.06 [-0.13 0.01]
#> #> Proportion mediated: 27.91% [-74.77% 130.58%]</span></code></pre>
<h3>Comparison to mediation-package</h3>
<p>Typically, <code>mediation()</code> finds the treatment and mediator variables automatically. If this does not work, use the <code>treatment</code> and <code>mediator</code> arguments to specify the related variable names. For all values, the 90% HDIs are calculated by default. Use <code>prob</code> to calculate a different interval.</p>
<p>Here is a comparison with the mediation package. Note that the <code>summary()</code>-output of the mediation package shows the indirect effect first, followed by the direct effect.</p>
<pre><code>summary(m1)
<span>#> Causal Mediation Analysis #> #> Quasi-Bayesian Confidence Intervals
#> #> Estimate 95% CI Lower 95% CI Upper p-value
#> ACME -0.0158 -0.0394 0.01 0.19
#> ADE -0.0402 -0.1186 0.05 0.33
#> Total Effect -0.0560 -0.1371 0.03 0.19
#> Prop. Mediated 0.2401 -1.5970 2.25 0.30
#> #> Sample Size Used: 899 #> #> #> Simulations: 1000</span>

mediation(m2, prob = .95)
<span>#> # Causal Mediation Analysis for Stan Model
#> #> Treatment: treat
#> Mediator: job_seek
#> Response: depress2
#> #> Estimate HDI (95%)
#> Direct effect: -0.04 [-0.12 0.04]
#> Indirect effect: -0.02 [-0.04 0.01]
#> Total effect: -0.06 [-0.14 0.03]
#> #> Proportion mediated: 27.91% [-176.9% 232.71%]</span></code></pre>
<h3>Tweak print-results</h3>
<p>If you want to calculate mean instead of median values from the posterior samples, use the <code>typical</code>-argument. Furthermore, there is a <code>print()</code>-method, which allows to print more digits.</p>
<pre><code>mediation(m2, typical = &quot;mean&quot;, prob = .95) %>% print(digits = 4)
<span>#> # Causal Mediation Analysis for Stan Model
#> #> Treatment: treat
#> Mediator: job_seek
#> Response: depress2
#> #> Estimate HDI (95%)
#> Direct effect: -0.0398 [-0.1239 0.0420]
#> Indirect effect: -0.0158 [-0.0422 0.0079]
#> Total effect: -0.0556 [-0.1437 0.0308]
#> #> Proportion mediated: 28.4146% [-176.3884% 233.2176%]</span></code></pre>
<p>As you can see, the results are similar to what the mediation package produces for non-Bayesian models.</p>
<h2>ICC for multilevel models</h2>
<p>Similar to frequentist multilevel models, <code>icc()</code> computes the intraclass correlation coefficient for Bayesian multilevel models. One advantage of the <strong>brms</strong> package is that you can compute the ICC for each sample of the posterior distribution, which allows you to easily calculate uncertainty intervals. By default, the 89% HDI is used as interval for the uncertainty, but the <code>print()</code>-method which allows you to specify the HDI-interval and digits:</p>
<pre><code>icc(m5, posterior = TRUE) %>% print(prob = .95, digits = 3)
<span>#> # Random Effect Variances and ICC
#> #> Family: gaussian (identity)
#> Formula: neg_c_7 ~ e42dep + c12hour + c172code + (1 | e15relat)
#> #> ## e15relat
#> ICC: 0.026 (HDI 95%: 0.000-0.133)
#> Between-group: 0.345 (HDI 95%: 0.000-1.999)
#> #> ## Residuals
#> Within-group: 12.810 (HDI 95%: 11.553-14.127)</span></code></pre>
<h2>Bayes r-squared and LOO-adjusted r-squared</h2>
<p><code>r2()</code> computes either the Bayes r-squared value, or – if <code>loo = TRUE</code> – a LOO-adjusted r-squared value (which comes conceptionally closer to an adjusted r-squared measure).</p>
<p>For the Bayes r-squared, the standard error is also reported. Note that <code>r2()</code> uses the median as measure of central tendency and the median absolute deviation as measure for variability.</p>
<pre><code>r2(m5)
<span>#> Bayes R2: 0.168
#> Standard Error: 0.021</span>

r2(m5, loo = TRUE)
<span>#> LOO-adjusted R2: 0.145</span></code></pre>
<h2>Finally</h2>
<p>There’a also a <a rel="nofollow" href="http://strengejacke.github.io/sjstats" target="_blank">dedicated website for sjstats</a> now…</p>
<h2>References</h2>
<p>Kruschke JK. Doing Bayesian Data Analysis: A Tutorial with R, JAGS, and Stan. 2nd edition. Academic Press, 2015</p>
<p>Kruschke JK. Rejecting or Accepting Parameter Values in Bayesian Estimation. Advances in Methods and Practices in Psychological Science. 2018; doi: 10.1177/2515245918771304</p>
<p>McElreath R. Statistical Rethinking. A Bayesian Course with Examples in R and Stan. Chapman and Hall, 2015</p>
<p>Norman GR, Sloan JA, Wyrwich KW. Interpretation of Changes in Health-related Quality of Life: The Remarkable Universality of Half a Standard Deviation. Medical Care. 2003;41: 582–592. doi: 10.1097/01.MLR.0000062554.74615.4C</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="https://strengejacke.wordpress.com/2018/06/06/r-functions-for-bayesian-model-statistics-and-summaries-rstats-stan-brms/"> R – Strenge Jacke!</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 alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/BLwpfVnAT9w" height="1"></a></div>