This is a short demonstration of the various outputs for different Stan models, provided by the tidy_stan() function of the sjstats-package.
The aim of this functions is, first, to return a tidy data frame of the results of regression models. And, second, to print the results in a compact and clear way, focussing on the model “coefficients” and help the user to quickly glance at different structural parts of the model (random vs. fixed effects, conditional vs. zero-inflation part and so on).
To demonstrate the function, several different models were fitted using the great brms package.
Note that the output in the R console is colored, unlike what is shown here (knitr supports coloured output created by the crayon package only with additional effort.)
As of today, if you download the current GitHub-version from sjstats (see link above), you could fully reproduce the below examples.
library(lme4)
library(sjstats)
library(sjmisc)
library(brms)
library(rstanarm)
library(dplyr)
data(efc)
data(sleepstudy)
zinb <- read.csv("http://stats.idre.ucla.edu/stat/data/fish.csv")
sleepstudy$grp <- sample(1:5, size = 180, replace = TRUE)
sleepstudy <- sleepstudy %>%
group_by(grp) %>%
mutate(subgrp = sample(1:15, size = n(), replace = TRUE))
efc <- to_factor(efc, e42dep, c172code, c161sex, e15relat)
Here we fit some (nonsense) models…
b1 <- brm(neg_c_7 ~ e42dep + c12hour + c172code, data = efc)
b2 <- brm(neg_c_7 ~ e42dep + c12hour + c172code + (1 | e15relat), data = efc)
b3 <- brm(mpg ~ wt + (1|cyl) + (1+wt|gear), data = mtcars)
b5 <- brm(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
b6 <- brm(Reaction ~ Days + (1 | grp / subgrp) + (1 | Subject), data = sleepstudy)
b7 <- brm(cbind(c82cop1, c83cop2, c84cop3) ~ c161sex + e42dep, data = efc)
f1 <- bf(neg_c_7 ~ e42dep + c12hour + c172code)
f2 <- bf(c12hour ~ c172code)
b8 <- brm(f1 + f2 + set_rescor(FALSE), data = efc)
b9 <- brm(
count ~ persons + child + camper,
data = zinb,
family = zero_inflated_poisson()
)
b10 <-brm(
bf(count ~ persons + child + camper, zi ~ child + camper),
data = zinb,
family = zero_inflated_poisson()
)
b11 <- brm(
bf(count ~ child + camper + (1 | persons),
zi ~ child + camper),
data = zinb,
family = zero_inflated_poisson()
)
b12 <- brm(
bf(count ~ child + camper + (1 | persons),
zi ~ child + camper + (1 | persons)),
data = zinb,
family = zero_inflated_poisson()
)
b13 <- brm(
cbind(c82cop1, c83cop2, c84cop3) ~ c161sex + e42dep + (1 | e15relat),
data = efc
)
f3 <- bf(neg_c_7 ~ e42dep + c12hour + c172code + (1 |ID| e15relat))
f4 <- bf(c12hour ~ c172code + (1 |ID| e15relat))
b14 <- brm(f3 + f4 + set_rescor(FALSE), data = efc)
Here we see the different summary outputs. tidy_stan() has some options; for instance, for multilevel models, you can either print the fixed effects coefficients (default), only random effects coefficients (type = "random") or both (type = "all"). For demonstration purposes, the latter option is always used here.
tidy_stan(b1, type = "all")
# Summary Statistics of Stan-Model
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 8.91 0.50 [ 8.10 9.74] 0.53 1.00 0.04
e42dep2 1.20 0.53 [ 0.45 2.09] 0.47 1.00 0.05
e42dep3 2.43 0.51 [ 1.57 3.17] 0.50 1.00 0.05
e42dep4 3.97 0.49 [ 3.27 4.92] 0.55 1.00 0.04
c12hour 0.01 0.00 [ 0.00 0.01] 1.00 1.00 0.00
c172code2 0.08 0.29 [-0.37 0.52] 0.67 1.00 0.02
c172code3 0.60 0.37 [-0.12 1.05] 0.61 1.03 0.03
sigma 3.61 0.10 [ 3.45 3.75] 0.90 1.00 0.01
For the sake of demonstration, another example with multiple HDI’s and posterior mean instead of median.
tidy_stan(b1, prob = c(.5, .8), typical = "mean")
# Summary Statistics of Stan-Model
estimate std.error HDI(50%) HDI(80%) n_eff Rhat mcse
Intercept 8.92 0.50 [ 8.49 9.13] [ 8.29 9.54] 0.53 1.00 0.04
e42dep2 1.17 0.53 [ 0.91 1.57] [ 0.54 1.82] 0.47 1.00 0.05
e42dep3 2.43 0.51 [ 1.99 2.64] [ 1.91 3.17] 0.50 1.00 0.05
e42dep4 4.00 0.49 [ 3.69 4.34] [ 3.27 4.56] 0.55 1.00 0.04
c12hour 0.01 0.00 [ 0.01 0.01] [ 0.00 0.01] 1.00 1.00 0.00
c172code2 0.10 0.29 [-0.09 0.29] [-0.24 0.46] 0.67 1.00 0.02
c172code3 0.61 0.37 [ 0.26 0.74] [ 0.17 1.03] 0.61 1.03 0.03
sigma 3.61 0.10 [ 3.52 3.65] [ 3.49 3.73] 0.90 1.00 0.01
tidy_stan(b2, type = "all")
# Summary Statistics of Stan-Model
## Fixed effects:
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 8.82 0.60 [ 7.85 9.82] 0.68 1.00 0.05
e42dep2 1.10 0.47 [ 0.10 1.78] 0.64 1.00 0.04
e42dep3 2.28 0.55 [ 1.47 3.13] 0.68 1.00 0.04
e42dep4 3.82 0.53 [ 3.10 4.86] 0.57 1.00 0.05
c12hour 0.01 0.00 [ 0.00 0.01] 1.00 1.00 0.00
c172code2 0.16 0.36 [-0.32 0.69] 0.41 1.02 0.03
c172code3 0.67 0.42 [-0.01 1.28] 0.48 1.02 0.04
sigma 3.58 0.09 [ 3.43 3.71] 1.00 1.01 0.01
## Random effect (Intercept)
estimate std.error HDI(89%) n_eff Rhat mcse
e15relat.1 0.52 0.46 [-0.09 1.06] 0.52 1.00 0.04
e15relat.2 0.35 0.32 [-0.14 0.80] 0.55 1.00 0.03
e15relat.3 -0.04 0.33 [-0.68 0.82] 1.00 1.00 0.03
e15relat.4 0.03 0.33 [-0.67 0.55] 0.78 1.00 0.03
e15relat.5 -0.04 0.32 [-0.72 0.76] 1.00 1.01 0.03
e15relat.6 -0.51 0.60 [-1.61 0.19] 0.57 1.00 0.05
e15relat.7 -0.08 0.39 [-1.12 0.86] 0.62 1.00 0.05
e15relat.8 -0.17 0.28 [-0.69 0.45] 0.72 1.00 0.03
tidy_stan(b5, type = "all")
# Summary Statistics of Stan-Model
## Fixed effects:
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 251.37 7.17 [239.97 262.85] 0.41 1 0.18
Days 10.44 1.60 [ 7.85 13.18] 0.34 1 0.05
sigma 25.82 1.50 [ 23.49 28.26] 1.00 1 0.02
## Random effect (Intercept)
estimate std.error HDI(89%) n_eff Rhat mcse
Subject.308 2.68 14.22 [-19.83 24.45] 0.68 1 0.27
Subject.309 -40.00 14.24 [-62.62 -17.70] 1.00 1 0.23
Subject.310 -38.31 14.48 [-60.97 -14.96] 1.00 1 0.23
Subject.330 23.03 14.38 [ 0.12 45.19] 1.00 1 0.23
Subject.331 21.44 14.14 [ -0.87 44.68] 0.72 1 0.27
Subject.332 9.11 13.23 [-11.93 30.02] 0.81 1 0.24
Subject.333 16.38 13.75 [ -4.22 37.80] 1.00 1 0.22
Subject.334 -6.40 12.97 [-28.30 13.19] 0.73 1 0.24
Subject.335 -0.60 14.42 [-24.00 22.52] 0.55 1 0.31
Subject.337 34.60 13.69 [ 13.15 57.87] 1.00 1 0.22
Subject.349 -24.45 13.58 [-46.83 -2.73] 0.66 1 0.27
Subject.350 -12.33 13.98 [-34.93 9.99] 0.62 1 0.28
Subject.351 4.22 14.34 [-16.91 27.99] 1.00 1 0.23
Subject.352 20.70 13.48 [ -0.35 42.87] 1.00 1 0.22
Subject.369 3.23 12.87 [-18.04 23.89] 0.79 1 0.24
Subject.370 -24.06 14.63 [-47.74 -1.96] 0.67 1 0.28
Subject.371 0.72 13.45 [-20.66 21.54] 0.82 1 0.23
Subject.372 11.94 12.92 [ -8.43 33.42] 0.84 1 0.23
## Random effect Days
estimate std.error HDI(89%) n_eff Rhat mcse
Subject.308 9.09 2.94 [ 4.62 13.76] 0.56 1 0.06
Subject.309 -8.63 2.88 [-13.42 -4.21] 0.69 1 0.06
Subject.310 -5.54 2.79 [ -9.99 -0.78] 0.69 1 0.05
Subject.330 -4.68 2.87 [ -9.08 0.22] 0.56 1 0.06
Subject.331 -2.96 2.80 [ -7.56 1.54] 0.59 1 0.06
Subject.332 -0.27 2.71 [ -4.37 4.13] 0.56 1 0.06
Subject.333 -0.11 2.68 [ -4.98 3.92] 0.64 1 0.05
Subject.334 0.99 2.69 [ -3.48 5.28] 0.62 1 0.05
Subject.335 -10.61 2.87 [-15.52 -6.13] 0.61 1 0.06
Subject.337 8.68 2.79 [ 4.27 13.29] 0.65 1 0.06
Subject.349 1.02 2.72 [ -3.46 5.30] 0.63 1 0.06
Subject.350 6.57 2.72 [ 1.97 11.07] 0.56 1 0.06
Subject.351 -2.98 2.78 [ -7.65 1.33] 0.68 1 0.05
Subject.352 3.51 2.74 [ -0.81 8.01] 0.66 1 0.05
Subject.369 0.86 2.56 [ -3.42 5.15] 0.60 1 0.05
Subject.370 4.64 2.89 [ 0.64 9.84] 0.55 1 0.06
Subject.371 -0.98 2.74 [ -4.96 3.59] 0.64 1 0.05
Subject.372 1.31 2.73 [ -3.05 5.72] 0.63 1 0.05
tidy_stan(b3, type = "all")
# Summary Statistics of Stan-Model
## Fixed effects:
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 25.79 0.54 [25.24 28.24] 0.05 1.07 0.60
wt -5.03 0.20 [-5.32 -4.83] 0.10 1.10 0.10
sigma 2.58 0.04 [ 2.52 2.70] 0.17 1.00 0.02
## Random effect (Intercept: cyl)
estimate std.error HDI(89%) n_eff Rhat mcse
cyl.4 -0.28 0.28 [-0.93 0.05] 0.08 1.05 0.33
cyl.6 -1.92 0.73 [-3.89 -1.15] 0.07 1.08 0.32
cyl.8 -4.12 0.82 [-6.48 -3.36] 0.07 1.04 0.41
## Random effect (Intercept: gear)
estimate std.error HDI(89%) n_eff Rhat mcse
gear.3 1.82 1.03 [-1.93 3.01] 0.04 1.00 0.62
gear.4 18.00 2.19 [11.60 21.73] 0.03 1.14 1.94
gear.5 7.59 1.44 [ 5.88 11.31] 0.03 1.30 1.08
## Random effect wt
estimate std.error HDI(89%) n_eff Rhat mcse
gear.3 3.07 0.45 [ 2.40 4.51] 0.06 1.04 0.24
gear.4 -1.95 1.04 [-3.05 -0.05] 0.03 1.11 0.40
gear.5 0.84 0.63 [ 0.06 2.16] 0.06 1.07 0.24
tidy_stan(b6, type = "all")
# Summary Statistics of Stan-Model
## Fixed effects:
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 251.73 11.98 [231.20 268.84] 0.15 1.07 1.93
Days 10.65 0.84 [ 9.45 12.08] 1.00 1.00 0.05
sigma 30.59 1.43 [ 27.86 32.78] 1.00 1.00 0.10
## Random effect (Intercept: grp)
estimate std.error HDI(89%) n_eff Rhat mcse
grp.1 3.19 5.38 [ -2.47 16.72] 0.61 1 0.53
grp.2 -0.26 3.92 [-10.92 6.75] 1.00 1 0.35
grp.3 -1.29 3.39 [-13.16 4.32] 1.00 1 0.34
grp.4 -4.24 5.73 [-16.40 2.10] 0.36 1 0.70
grp.5 1.51 4.19 [ -4.21 11.76] 1.00 1 0.33
## Random effect (Intercept: grp.subgrp)
estimate std.error HDI(89%) n_eff Rhat mcse
grp.subgrp.1_1 0.22 2.86 [ -7.08 7.98] 1.00 1.00 0.33
grp.subgrp.1_10 -0.06 3.04 [ -7.43 6.91] 1.00 1.00 0.29
grp.subgrp.1_11 0.73 2.81 [ -7.17 7.69] 1.00 1.00 0.36
grp.subgrp.1_12 -0.12 2.90 [ -7.40 7.79] 1.00 1.00 0.31
grp.subgrp.1_13 0.18 2.48 [ -6.10 6.06] 1.00 1.00 0.25
grp.subgrp.1_14 0.62 3.21 [ -5.17 10.07] 1.00 1.00 0.34
grp.subgrp.1_15 0.03 2.61 [ -6.78 7.75] 1.00 1.00 0.29
grp.subgrp.1_2 0.00 2.97 [ -7.45 7.88] 1.00 1.00 0.30
grp.subgrp.1_3 0.00 2.53 [ -4.80 6.30] 1.00 1.00 0.22
grp.subgrp.1_4 0.31 2.70 [ -4.63 7.25] 1.00 1.00 0.26
grp.subgrp.1_5 0.40 2.60 [ -6.40 9.03] 1.00 1.01 0.31
grp.subgrp.1_6 0.33 2.33 [ -6.19 7.18] 1.00 1.00 0.28
grp.subgrp.1_7 0.04 2.73 [ -7.33 8.37] 1.00 1.00 0.33
grp.subgrp.1_8 -0.31 2.75 [ -9.45 4.29] 1.00 1.00 0.29
grp.subgrp.1_9 -0.68 2.89 [ -7.95 8.42] 1.00 1.00 0.31
grp.subgrp.2_1 0.01 2.65 [ -6.68 6.40] 1.00 1.00 0.27
grp.subgrp.2_10 -0.05 2.94 [-11.04 4.63] 1.00 1.01 0.32
grp.subgrp.2_11 -0.04 2.70 [ -7.29 6.88] 1.00 1.00 0.30
grp.subgrp.2_12 -0.05 2.53 [ -5.98 5.51] 1.00 1.00 0.23
grp.subgrp.2_13 -0.07 2.73 [-11.13 5.31] 1.00 1.00 0.32
grp.subgrp.2_14 0.18 2.10 [ -5.55 7.26] 1.00 1.00 0.30
grp.subgrp.2_15 -0.39 3.22 [-10.74 6.45] 1.00 1.00 0.32
grp.subgrp.2_2 -0.03 3.08 [ -6.27 9.10] 1.00 1.01 0.29
grp.subgrp.2_3 -0.04 2.93 [ -6.14 7.83] 1.00 1.01 0.28
grp.subgrp.2_4 -0.32 2.16 [ -6.20 5.36] 1.00 1.00 0.25
grp.subgrp.2_5 0.06 3.02 [ -6.36 8.90] 1.00 1.00 0.35
grp.subgrp.2_6 0.24 2.84 [ -5.54 7.86] 1.00 1.00 0.27
grp.subgrp.2_7 -0.43 3.00 [ -7.93 4.83] 1.00 1.00 0.26
grp.subgrp.2_8 -0.20 3.46 [ -8.51 7.64] 1.00 1.00 0.31
grp.subgrp.2_9 0.21 2.25 [ -5.55 8.00] 1.00 1.00 0.29
grp.subgrp.3_1 -0.02 2.53 [ -5.33 6.96] 1.00 1.00 0.25
grp.subgrp.3_10 0.09 3.55 [ -8.51 7.27] 1.00 1.00 0.33
grp.subgrp.3_11 -0.26 2.84 [ -8.01 4.97] 1.00 1.00 0.28
grp.subgrp.3_12 -0.13 2.67 [ -6.59 6.22] 1.00 1.00 0.28
grp.subgrp.3_13 -0.19 2.27 [ -8.67 7.47] 1.00 1.00 0.36
grp.subgrp.3_14 -0.33 2.32 [ -5.93 6.14] 1.00 1.00 0.25
grp.subgrp.3_15 0.43 3.47 [ -6.22 8.61] 1.00 1.00 0.30
grp.subgrp.3_3 -0.03 2.48 [ -7.59 6.41] 1.00 1.00 0.28
grp.subgrp.3_4 0.13 2.68 [ -6.56 6.99] 1.00 1.00 0.27
grp.subgrp.3_5 0.30 2.35 [ -4.45 9.64] 1.00 1.00 0.30
grp.subgrp.3_6 0.30 2.43 [ -5.13 7.11] 1.00 1.00 0.27
grp.subgrp.3_7 -0.58 2.94 [ -9.18 6.56] 1.00 1.00 0.33
grp.subgrp.3_8 0.52 2.60 [ -4.65 6.75] 1.00 1.00 0.24
grp.subgrp.3_9 -0.17 2.81 [ -6.62 5.83] 1.00 1.00 0.25
grp.subgrp.4_1 0.23 2.83 [ -5.25 9.38] 1.00 1.00 0.29
grp.subgrp.4_10 -0.16 2.90 [ -6.28 6.55] 1.00 1.01 0.31
grp.subgrp.4_12 -0.24 2.46 [-10.40 2.96] 1.00 1.00 0.26
grp.subgrp.4_13 0.06 2.28 [ -6.77 6.90] 1.00 1.00 0.28
grp.subgrp.4_14 -0.05 2.40 [ -7.72 5.46] 1.00 1.00 0.25
grp.subgrp.4_15 -0.04 2.62 [ -8.05 8.28] 1.00 1.00 0.31
grp.subgrp.4_2 0.00 3.27 [ -7.54 8.75] 1.00 1.00 0.34
grp.subgrp.4_3 -0.78 2.60 [ -9.97 4.00] 1.00 1.00 0.32
grp.subgrp.4_4 0.62 2.99 [ -4.11 8.83] 1.00 1.00 0.28
grp.subgrp.4_5 -0.05 2.77 [ -6.97 7.02] 1.00 1.00 0.30
grp.subgrp.4_6 0.41 2.70 [ -7.69 9.59] 1.00 1.00 0.34
grp.subgrp.4_7 -0.02 2.13 [ -6.53 6.59] 1.00 1.00 0.26
grp.subgrp.4_9 -0.40 2.67 [ -8.80 5.31] 1.00 1.00 0.29
grp.subgrp.5_1 -0.01 2.88 [ -8.14 6.65] 1.00 1.00 0.30
grp.subgrp.5_10 0.09 2.66 [ -5.87 7.70] 0.91 1.00 0.30
grp.subgrp.5_11 0.08 2.68 [ -6.77 7.67] 1.00 1.00 0.30
grp.subgrp.5_12 0.28 2.21 [ -6.25 6.66] 1.00 1.00 0.26
grp.subgrp.5_13 0.02 2.51 [ -7.19 7.51] 1.00 1.00 0.31
grp.subgrp.5_14 -0.61 2.59 [-10.02 3.86] 1.00 1.00 0.28
grp.subgrp.5_15 -0.32 2.83 [ -8.37 7.50] 1.00 1.00 0.34
grp.subgrp.5_2 -0.10 2.53 [ -7.71 5.74] 1.00 1.00 0.28
grp.subgrp.5_3 0.11 2.53 [ -4.40 11.42] 1.00 1.00 0.31
grp.subgrp.5_4 -0.16 2.99 [ -6.96 7.04] 1.00 1.00 0.30
grp.subgrp.5_6 0.00 2.59 [ -7.16 6.90] 1.00 1.00 0.27
grp.subgrp.5_7 -0.04 2.60 [ -5.69 5.81] 1.00 1.00 0.25
grp.subgrp.5_8 -0.03 2.89 [ -6.38 6.80] 1.00 1.00 0.27
grp.subgrp.5_9 0.77 2.75 [ -4.45 8.76] 1.00 1.00 0.28
## Random effect (Intercept: Subject)
estimate std.error HDI(89%) n_eff Rhat mcse
Subject.308 40.61 13.82 [ 22.12 63.53] 0.20 1.03 1.91
Subject.309 -80.04 14.23 [-103.32 -59.21] 0.21 1.03 1.91
Subject.310 -65.22 12.95 [ -82.35 -43.26] 0.20 1.04 1.77
Subject.330 3.60 14.96 [ -21.30 22.46] 0.18 1.07 2.02
Subject.331 10.17 13.01 [ -12.21 29.16] 0.21 1.03 1.84
Subject.332 6.00 14.37 [ -16.51 27.21] 0.16 1.06 2.17
Subject.333 17.29 13.30 [ -2.94 40.57] 0.26 1.03 1.72
Subject.334 -2.57 14.54 [ -24.31 18.46] 0.15 1.07 2.14
Subject.335 -46.92 14.64 [ -66.88 -25.52] 0.21 1.05 1.88
Subject.337 71.01 11.32 [ 52.30 92.85] 0.19 1.05 1.85
Subject.349 -23.99 13.69 [ -45.77 2.03] 0.24 1.06 1.89
Subject.350 11.32 13.37 [ -8.25 36.65] 0.22 1.05 1.88
Subject.351 -8.57 14.11 [ -28.05 14.09] 0.22 1.06 1.80
Subject.352 35.28 14.77 [ 15.44 56.45] 0.21 1.02 1.84
Subject.369 4.32 12.78 [ -13.53 29.51] 0.18 1.07 2.03
Subject.370 -6.74 13.64 [ -27.43 13.46] 0.17 1.06 2.02
Subject.371 -4.36 14.02 [ -22.81 18.83] 0.21 1.05 1.84
Subject.372 16.36 14.24 [ -5.68 35.05] 0.20 1.05 1.88
tidy_stan(b7, type = "all")
# Summary Statistics of Stan-Model
## Response: c82cop1
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 3.41 0.07 [ 3.29 3.54] 0.63 1 0.01
c161sex2 -0.06 0.05 [-0.14 0.02] 1.00 1 0.00
e42dep2 -0.11 0.08 [-0.25 0.01] 0.63 1 0.01
e42dep3 -0.29 0.09 [-0.42 -0.17] 0.59 1 0.01
e42dep4 -0.35 0.08 [-0.44 -0.19] 0.64 1 0.01
## Response: c83cop2
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 1.51 0.09 [ 1.35 1.63] 0.71 1.00 0.01
c161sex2 0.06 0.06 [-0.03 0.15] 1.00 1.00 0.00
e42dep2 0.20 0.09 [ 0.09 0.36] 0.53 1.02 0.01
e42dep3 0.49 0.09 [ 0.37 0.65] 0.62 1.00 0.01
e42dep4 0.73 0.09 [ 0.62 0.90] 0.61 1.00 0.01
## Response: c84cop3
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 1.16 0.12 [ 0.97 1.34] 0.46 1 0.01
c161sex2 -0.03 0.07 [-0.12 0.09] 1.00 1 0.00
e42dep2 0.24 0.13 [ 0.06 0.43] 0.41 1 0.01
e42dep3 0.50 0.12 [ 0.31 0.65] 0.41 1 0.01
e42dep4 0.82 0.14 [ 0.66 1.00] 0.40 1 0.01
## Residual Correlations
estimate std.error HDI(89%) n_eff Rhat mcse
c82cop1-c83cop2 -0.35 0.03 [-0.39 -0.30] 0.97 1 0
c82cop1-c84cop3 -0.17 0.03 [-0.22 -0.12] 1.00 1 0
c83cop2-c84cop3 0.31 0.03 [ 0.27 0.36] 1.00 1 0
tidy_stan(b8, type = "all")
# Summary Statistics of Stan-Model
## Response: negc7
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 8.92 0.56 [ 8.21 9.81] 0.67 1.00 0.04
e42dep2 1.14 0.53 [ 0.31 1.98] 0.57 1.01 0.05
e42dep3 2.43 0.49 [ 1.67 3.30] 0.55 1.02 0.05
e42dep4 4.01 0.51 [ 3.17 5.02] 0.52 1.00 0.05
c12hour 0.01 0.00 [ 0.00 0.01] 1.00 1.00 0.00
c172code2 0.09 0.34 [-0.39 0.67] 1.00 1.00 0.02
c172code3 0.67 0.44 [ 0.00 1.39] 1.00 1.00 0.03
## Response: c12hour
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 50.02 3.78 [ 44.86 55.60] 1 1 0.23
c172code2 -8.27 4.26 [-15.32 -2.02] 1 1 0.27
c172code3 -15.69 5.23 [-22.84 -5.39] 1 1 0.35
tidy_stan(b9, type = "all")
# Summary Statistics of Stan-Model
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept -1.00 0.19 [-1.26 -0.74] 0.70 1.00 0.01
persons 0.87 0.05 [ 0.82 0.95] 0.72 1.00 0.00
child -1.36 0.09 [-1.50 -1.22] 0.62 1.01 0.01
camper 0.79 0.09 [ 0.66 0.93] 0.67 1.01 0.01
zi 0.41 0.04 [ 0.34 0.47] 0.53 1.02 0.00
tidy_stan(b10, type = "all")
# Summary Statistics of Stan-Model
## Conditional Model:
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept -1.07 0.18 [-1.33 -0.82] 0.87 1 0.01
persons 0.90 0.04 [ 0.83 0.96] 1.00 1 0.00
child -1.17 0.10 [-1.33 -1.04] 0.54 1 0.01
camper 0.75 0.10 [ 0.61 0.91] 1.00 1 0.01
## Zero-Inflated Model:
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept -0.58 0.32 [-1.08 -0.08] 1.00 1 0.02
child 1.24 0.27 [ 0.78 1.61] 1.00 1 0.02
camper -0.60 0.36 [-1.15 -0.09] 0.81 1 0.02
tidy_stan(b11, type = "all")
# Summary Statistics of Stan-Model
## Conditional Model: Fixed effects
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 1.16 0.82 [-0.24 2.98] 0.21 1.02 0.15
child -1.18 0.10 [-1.33 -1.03] 1.00 1.00 0.01
camper 0.74 0.10 [ 0.59 0.90] 1.00 1.00 0.01
## Conditional Model: Random effect (Intercept)
estimate std.error HDI(89%) n_eff Rhat mcse
persons.1 -1.52 0.84 [-3.44 0.00] 0.22 1.02 0.15
persons.2 -0.27 0.85 [-2.09 1.24] 0.22 1.02 0.15
persons.3 0.44 0.86 [-1.49 1.92] 0.21 1.02 0.16
persons.4 1.36 0.83 [-0.47 2.77] 0.21 1.02 0.15
## Zero-Inflated Model: Fixed effects
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept -0.63 0.35 [-1.24 -0.19] 0.98 1 0.02
child 1.37 0.35 [ 0.87 1.84] 0.82 1 0.02
camper -0.74 0.39 [-1.38 -0.18] 0.96 1 0.03
tidy_stan(b12, type = "all")
# Summary Statistics of Stan-Model
## Conditional Model: Fixed effects
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 1.26 0.67 [ 0.20 2.34] 0.27 1.00 0.09
child -1.15 0.10 [-1.29 -1.00] 0.55 1.02 0.01
camper 0.73 0.09 [ 0.58 0.86] 0.58 1.00 0.01
## Conditional Model: Random effect (Intercept: persons)
estimate std.error HDI(89%) n_eff Rhat mcse
persons.1 -1.33 0.68 [-2.66 -0.23] 0.28 1 0.10
persons.2 -0.38 0.67 [-1.73 0.60] 0.27 1 0.09
persons.3 0.33 0.73 [-0.71 1.51] 0.28 1 0.09
persons.4 1.26 0.67 [ 0.09 2.35] 0.27 1 0.09
## Zero-Inflated Model: Fixed effects
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept -0.66 0.78 [-1.90 0.67] 0.44 1.01 0.08
child 1.88 0.32 [ 1.43 2.41] 0.97 1.00 0.02
camper -0.83 0.35 [-1.39 -0.22] 0.83 1.00 0.03
## Zero-Inflated Model: Random effect (Intercept: persons)
estimate std.error HDI(89%) n_eff Rhat mcse
persons.1 1.25 0.81 [-0.45 2.57] 0.31 1.00 0.13
persons.2 0.23 0.66 [-1.24 1.41] 0.46 1.01 0.08
persons.3 -0.23 0.70 [-1.45 1.00] 0.44 1.01 0.08
persons.4 -1.34 0.70 [-2.46 0.10] 0.46 1.01 0.08
tidy_stan(b13, type = "all")
# Summary Statistics of Stan-Model
## Fixed effects for response: c82cop1
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 3.42 0.08 [ 3.29 3.56] 0.36 1 0.01
c161sex2 -0.06 0.04 [-0.14 0.00] 0.76 1 0.00
e42dep2 -0.10 0.07 [-0.22 0.01] 0.41 1 0.01
e42dep3 -0.30 0.07 [-0.41 -0.18] 0.43 1 0.01
e42dep4 -0.34 0.08 [-0.45 -0.21] 0.45 1 0.01
## Random effect (Intercept: e15relat) for response c82cop1
estimate std.error HDI(89%) n_eff Rhat mcse
e15relat.1 0.01 0.05 [-0.07 0.11] 0.46 1.00 0.01
e15relat.2 -0.02 0.04 [-0.12 0.04] 0.39 1.00 0.01
e15relat.3 -0.05 0.07 [-0.18 0.05] 0.33 1.00 0.01
e15relat.4 -0.02 0.05 [-0.11 0.07] 0.62 1.00 0.00
e15relat.5 -0.02 0.06 [-0.16 0.07] 0.63 1.00 0.01
e15relat.6 0.04 0.07 [-0.03 0.21] 0.38 1.00 0.01
e15relat.7 0.00 0.05 [-0.11 0.14] 1.00 1.00 0.01
e15relat.8 0.05 0.06 [-0.06 0.13] 0.43 1.02 0.01
## Fixed effects for response: c83cop2
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 1.49 0.10 [ 1.37 1.66] 0.44 1 0.01
c161sex2 0.07 0.05 [-0.01 0.16] 0.81 1 0.00
e42dep2 0.20 0.09 [ 0.06 0.36] 0.53 1 0.01
e42dep3 0.50 0.08 [ 0.36 0.65] 0.46 1 0.01
e42dep4 0.73 0.09 [ 0.57 0.87] 0.47 1 0.01
## Random effect (Intercept: e15relat) for response c83cop2
estimate std.error HDI(89%) n_eff Rhat mcse
e15relat.1 0.00 0.03 [-0.05 0.06] 0.90 1.01 0
e15relat.2 0.01 0.03 [-0.03 0.08] 0.56 1.00 0
e15relat.3 0.00 0.03 [-0.08 0.05] 0.91 1.00 0
e15relat.4 0.00 0.02 [-0.05 0.08] 0.72 1.00 0
e15relat.5 0.00 0.03 [-0.07 0.08] 0.83 1.00 0
e15relat.6 0.00 0.03 [-0.08 0.05] 1.00 1.00 0
e15relat.7 0.00 0.03 [-0.04 0.12] 0.94 1.00 0
e15relat.8 -0.01 0.03 [-0.09 0.03] 1.00 1.00 0
## Fixed effects for response: c84cop3
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 1.13 0.12 [ 0.96 1.31] 0.44 1 0.01
c161sex2 -0.01 0.07 [-0.11 0.06] 1.00 1 0.00
e42dep2 0.26 0.11 [ 0.06 0.39] 0.50 1 0.01
e42dep3 0.49 0.09 [ 0.33 0.65] 0.38 1 0.01
e42dep4 0.81 0.11 [ 0.62 0.95] 0.42 1 0.01
## Random effect (Intercept: e15relat) for response c84cop3
estimate std.error HDI(89%) n_eff Rhat mcse
e15relat.1 0.06 0.08 [-0.02 0.20] 0.43 1.00 0.01
e15relat.2 0.00 0.04 [-0.09 0.08] 0.59 1.00 0.00
e15relat.3 0.01 0.06 [-0.10 0.17] 1.00 1.00 0.01
e15relat.4 -0.01 0.06 [-0.14 0.08] 1.00 1.00 0.00
e15relat.5 0.00 0.05 [-0.10 0.11] 1.00 1.01 0.00
e15relat.6 -0.04 0.08 [-0.28 0.04] 0.82 1.00 0.01
e15relat.7 0.00 0.06 [-0.19 0.14] 0.70 1.00 0.01
e15relat.8 0.00 0.05 [-0.11 0.11] 1.00 1.00 0.00
## Residual Correlations
correlation estimate std.error HDI(89%) n_eff Rhat mcse
c82cop1-c83cop2 -0.34 0.03 [-0.39 -0.30] 0.96 1.01 0
c82cop1-c84cop3 -0.17 0.03 [-0.22 -0.12] 1.00 1.00 0
c83cop2-c84cop3 0.31 0.03 [ 0.26 0.36] 1.00 1.00 0
tidy_stan(b14, type = "all")
# Summary Statistics of Stan-Model
## Fixed effects for response: negc7
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 8.65 0.55 [ 7.62 9.43] 0.57 1 0.05
e42dep2 1.17 0.46 [ 0.35 2.09] 0.54 1 0.04
e42dep3 2.36 0.56 [ 1.48 3.18] 0.58 1 0.05
e42dep4 3.92 0.55 [ 3.34 5.03] 0.48 1 0.05
c12hour 0.01 0.00 [ 0.00 0.01] 1.00 1 0.00
c172code2 0.18 0.27 [-0.22 0.68] 1.00 1 0.02
c172code3 0.77 0.40 [-0.03 1.31] 1.00 1 0.03
## Random effect (Intercept: e15relat) for response negc7
estimate std.error HDI(89%) n_eff Rhat mcse
e15relat.1 0.66 0.37 [ 0.10 1.41] 0.42 1.00 0.04
e15relat.2 0.34 0.35 [-0.11 0.91] 0.30 1.00 0.04
e15relat.3 -0.04 0.31 [-0.82 0.44] 0.92 1.00 0.03
e15relat.4 0.05 0.29 [-0.48 0.65] 0.69 1.00 0.03
e15relat.5 -0.24 0.45 [-0.94 0.56] 0.71 1.00 0.04
e15relat.6 -0.54 0.53 [-1.50 0.23] 0.51 1.00 0.05
e15relat.7 0.13 0.40 [-0.73 0.95] 0.67 1.01 0.04
e15relat.8 -0.20 0.29 [-0.95 0.28] 0.48 1.00 0.04
## Fixed effects for response: c12hour
estimate std.error HDI(89%) n_eff Rhat mcse
Intercept 36.92 8.39 [ 24.07 52.95] 0.51 1 0.87
c172code2 -0.51 3.61 [ -6.31 6.29] 1.00 1 0.24
c172code3 -7.14 4.07 [-13.88 0.18] 1.00 1 0.28
## Random effect (Intercept: e15relat) for response c12hour
estimate std.error HDI(89%) n_eff Rhat mcse
e15relat.1 46.23 9.34 [ 30.34 60.29] 0.54 1.00 0.86
e15relat.2 2.20 7.93 [-12.51 15.42] 0.51 1.00 0.85
e15relat.3 -1.49 10.38 [-17.92 15.05] 1.00 1.00 0.71
e15relat.4 -2.13 10.23 [-17.45 14.68] 0.57 1.00 0.86
e15relat.5 -17.43 11.08 [-39.18 -0.82] 0.84 1.00 0.84
e15relat.6 -21.49 14.09 [-42.85 -3.79] 1.00 1.00 0.83
e15relat.7 19.22 15.84 [ -0.33 63.66] 0.25 1.01 2.45
e15relat.8 -15.76 10.27 [-29.95 2.17] 0.63 1.00 0.84