library(brms)
## Loading required package: Rcpp
## Loading required package: ggplot2
## Loading 'brms' package (version 2.7.0). Useful instructions
## can be found by typing help('brms'). A more detailed introduction
## to the package is available through vignette('brms_overview').
## Run theme_set(theme_default()) to use the default bayesplot theme.
library(insight)

b1
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: neg_c_7 ~ e42dep + c12hour + c172code 
##    Data: efc (Number of observations: 834) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept     8.92      0.51     8.00     9.95        132 1.00
## e42dep2       1.17      0.52     0.15     2.10        116 1.00
## e42dep3       2.43      0.50     1.42     3.37        125 1.00
## e42dep4       4.00      0.52     2.97     5.10        138 1.00
## c12hour       0.01      0.00     0.00     0.01        250 1.00
## c172code2     0.10      0.29    -0.45     0.73        167 1.00
## c172code3     0.61      0.37    -0.09     1.43        151 1.03
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     3.61      0.10     3.42     3.82        224 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b1)
## $conditional
## neg_c_7 ~ e42dep + c12hour + c172code
## <environment: 0x0000000037fe53b0>
find_terms(b1)
## $response
## [1] "neg_c_7"
## 
## $conditional
## [1] "e42dep"   "c12hour"  "c172code"
head(get_data(b1))
##   neg_c_7 e42dep c12hour c172code
## 1      12      3      16        2
## 2      20      3     148        2
## 3      11      3      70        1
## 4      10      4     168        2
## 5      12      4     168        2
## 6      19      4      16        2
b2
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: neg_c_7 ~ e42dep + c12hour + c172code + (1 | e15relat) 
##    Data: efc (Number of observations: 834) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~e15relat (Number of levels: 8) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     0.66      0.43     0.08     1.83         81 1.00
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept     8.81      0.59     7.62     9.90        169 1.00
## e42dep2       1.07      0.50     0.12     2.02        160 1.00
## e42dep3       2.28      0.51     1.31     3.26        169 1.00
## e42dep4       3.85      0.54     2.82     4.87        142 1.00
## c12hour       0.01      0.00    -0.00     0.01        250 1.00
## c172code2     0.15      0.33    -0.50     0.77        104 1.02
## c172code3     0.67      0.40    -0.11     1.39        120 1.02
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     3.58      0.09     3.43     3.76        250 1.01
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b2)
## $conditional
## neg_c_7 ~ e42dep + c12hour + c172code
## <environment: 0x000000003bb9b520>
## 
## $random
## ~1 | e15relat
## <environment: 0x000000003bbc9c08>
find_terms(b2)
## $response
## [1] "neg_c_7"
## 
## $conditional
## [1] "e42dep"   "c12hour"  "c172code"
## 
## $random
## [1] "e15relat"
head(get_data(b2))
##   neg_c_7 e42dep c12hour c172code e15relat
## 1      12      3      16        2        2
## 2      20      3     148        2        2
## 3      11      3      70        1        1
## 4      10      4     168        2        1
## 5      12      4     168        2        2
## 6      19      4      16        2        2
b3
## Warning: The model has not converged (some Rhats are > 1.1). Do not analyse the results! 
## We recommend running more iterations and/or setting stronger priors.
## Warning: There were 149 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help.
## See http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: mpg ~ wt + (1 | cyl) + (1 + wt | gear) 
##    Data: mtcars (Number of observations: 32) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~cyl (Number of levels: 3) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     4.41      1.26     3.07     6.71          7 1.34
## 
## ~gear (Number of levels: 3) 
##                   Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)         7.74      1.61     4.14    10.12          8 1.27
## sd(wt)                5.08      1.04     1.59     6.08         15 1.00
## cor(Intercept,wt)    -0.43      0.26    -0.84     0.49         48 1.08
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept    26.47      2.11    25.24    34.67         12 1.07
## wt           -4.98      0.51    -5.80    -3.40         24 1.10
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     2.61      0.15     2.51     3.18         43 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b3)
## $conditional
## mpg ~ wt
## <environment: 0x000000003d7d1d68>
## 
## $random
## $random[[1]]
## ~1 | cyl
## <environment: 0x000000003d80f660>
## 
## $random[[2]]
## ~1 + wt | gear
## <environment: 0x000000003d818c88>
find_terms(b3)
## $response
## [1] "mpg"
## 
## $conditional
## [1] "wt"
## 
## $random
## [1] "cyl"  "gear"
head(get_data(b3))
##                    mpg    wt cyl gear
## Mazda RX4         21.0 2.620   6    4
## Mazda RX4 Wag     21.0 2.875   6    4
## Datsun 710        22.8 2.320   4    4
## Hornet 4 Drive    21.4 3.215   6    3
## Hornet Sportabout 18.7 3.440   8    3
## Valiant           18.1 3.460   6    3
b4
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: mpg ~ wt + cyl + gear 
##    Data: mtcars (Number of observations: 32) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept    42.46      5.01    32.47    52.50        250 1.00
## wt           -3.47      0.84    -5.16    -1.68        139 1.00
## cyl          -1.49      0.41    -2.23    -0.71        146 1.00
## gear         -0.53      0.85    -2.22     1.09        250 1.00
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     2.71      0.35     2.12     3.47        213 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b4)
## $conditional
## mpg ~ wt + cyl + gear
## <environment: 0x000000003eaed740>
find_terms(b4)
## $response
## [1] "mpg"
## 
## $conditional
## [1] "wt"   "cyl"  "gear"
head(get_data(b4))
##                    mpg    wt cyl gear
## Mazda RX4         21.0 2.620   6    4
## Mazda RX4 Wag     21.0 2.875   6    4
## Datsun 710        22.8 2.320   4    4
## Hornet 4 Drive    21.4 3.215   6    3
## Hornet Sportabout 18.7 3.440   8    3
## Valiant           18.1 3.460   6    3
b5
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: Reaction ~ Days + (1 + Days | Subject) 
##    Data: sleepstudy (Number of observations: 180) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup samples = 4000
## 
## Group-Level Effects: 
## ~Subject (Number of levels: 18) 
##                     Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)          27.00      6.70    15.88    42.11       1792 1.00
## sd(Days)                6.63      1.57     4.15    10.18       1465 1.00
## cor(Intercept,Days)     0.09      0.30    -0.49     0.67       1012 1.00
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept   251.37      7.35   236.96   265.93       1629 1.00
## Days         10.46      1.69     7.12    13.79       1341 1.00
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma    25.89      1.53    23.10    29.13       4000 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b5)
## $conditional
## Reaction ~ Days
## <environment: 0x0000000036ea5538>
## 
## $random
## ~1 + Days | Subject
## <environment: 0x0000000036f08300>
find_terms(b5)
## $response
## [1] "Reaction"
## 
## $conditional
## [1] "Days"
## 
## $random
## [1] "Subject"
head(get_data(b5))
##   Reaction Days Subject
## 1 249.5600    0     308
## 2 258.7047    1     308
## 3 250.8006    2     308
## 4 321.4398    3     308
## 5 356.8519    4     308
## 6 414.6901    5     308
b6
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: Reaction ~ Days + (1 | grp/subgrp) + (1 | Subject) 
##    Data: sleepstudy (Number of observations: 180) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~grp (Number of levels: 5) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     7.91      6.21     0.47    24.29         79 1.00
## 
## ~grp:subgrp (Number of levels: 71) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     3.91      2.78     0.21     9.60        110 1.00
## 
## ~Subject (Number of levels: 18) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)    38.68      6.99    28.26    53.51         97 1.00
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept   251.62     11.78   225.97   272.81         38 1.07
## Days         10.67      0.82     8.95    12.31        545 1.00
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma    30.61      1.51    27.86    33.71        205 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b6)
## $conditional
## Reaction ~ Days
## <environment: 0x000000003b26efc0>
## 
## $random
## $random[[1]]
## ~1 | subgrp:grp
## <environment: 0x000000003b2ac850>
## 
## $random[[2]]
## ~1 | grp
## <environment: 0x000000003b2b7eb0>
## 
## $random[[3]]
## ~1 | Subject
## <environment: 0x000000003b2bd7b8>
find_terms(b6)
## $response
## [1] "Reaction"
## 
## $conditional
## [1] "Days"
## 
## $random
## [1] "subgrp"  "grp"     "Subject"
head(get_data(b6))
##   Reaction Days grp Subject subgrp grp:subgrp
## 1 249.5600    0   2     308      7        2_7
## 2 258.7047    1   2     308      6        2_6
## 3 250.8006    2   4     308      9        4_9
## 4 321.4398    3   4     308     12       4_12
## 5 356.8519    4   2     308      6        2_6
## 6 414.6901    5   1     308      6        1_6
b7
##  Family: MV(gaussian, gaussian, gaussian) 
##   Links: mu = identity; sigma = identity
##          mu = identity; sigma = identity
##          mu = identity; sigma = identity 
## Formula: c82cop1 ~ c161sex + e42dep 
##          c83cop2 ~ c161sex + e42dep 
##          c84cop3 ~ c161sex + e42dep 
##    Data: efc (Number of observations: 899) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Population-Level Effects: 
##                   Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## c82cop1_Intercept     3.41      0.08     3.24     3.55        156 1.00
## c83cop2_Intercept     1.51      0.09     1.35     1.68        176 1.00
## c84cop3_Intercept     1.16      0.12     0.91     1.38        114 1.00
## c82cop1_c161sex2     -0.06      0.05    -0.15     0.04        250 1.00
## c82cop1_e42dep2      -0.11      0.08    -0.25     0.06        158 1.00
## c82cop1_e42dep3      -0.29      0.08    -0.44    -0.13        148 1.00
## c82cop1_e42dep4      -0.34      0.08    -0.48    -0.19        160 1.00
## c83cop2_c161sex2      0.06      0.06    -0.04     0.17        250 1.00
## c83cop2_e42dep2       0.21      0.09     0.02     0.39        133 1.02
## c83cop2_e42dep3       0.50      0.09     0.32     0.67        155 1.00
## c83cop2_e42dep4       0.73      0.09     0.54     0.90        152 1.00
## c84cop3_c161sex2     -0.03      0.07    -0.15     0.10        250 1.00
## c84cop3_e42dep2       0.23      0.12     0.01     0.46        102 1.00
## c84cop3_e42dep3       0.49      0.11     0.27     0.68        102 1.00
## c84cop3_e42dep4       0.81      0.12     0.60     1.02        100 1.00
## 
## Family Specific Parameters: 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma_c82cop1     0.57      0.01     0.55     0.60        250 1.00
## sigma_c83cop2     0.69      0.02     0.65     0.72        250 1.00
## sigma_c84cop3     0.83      0.02     0.80     0.87        250 1.00
## 
## Residual Correlations: 
##                         Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## rescor(c82cop1,c83cop2)    -0.35      0.03    -0.41    -0.29        243
## rescor(c82cop1,c84cop3)    -0.17      0.03    -0.23    -0.10        250
## rescor(c83cop2,c84cop3)     0.31      0.03     0.25     0.38        250
##                         Rhat
## rescor(c82cop1,c83cop2) 1.00
## rescor(c82cop1,c84cop3) 1.00
## rescor(c83cop2,c84cop3) 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b7)
## $c82cop1
## $c82cop1$conditional
## c82cop1 ~ c161sex + e42dep
## <environment: 0x000000003dd8b780>
## 
## 
## $c83cop2
## $c83cop2$conditional
## c83cop2 ~ c161sex + e42dep
## <environment: 0x000000003dda9588>
## 
## 
## $c84cop3
## $c84cop3$conditional
## c84cop3 ~ c161sex + e42dep
## <environment: 0x000000003ddc8170>
## 
## 
## attr(,"is_mv")
## [1] "1"
find_terms(b7)
## $response
##   c82cop1   c83cop2   c84cop3 
## "c82cop1" "c83cop2" "c84cop3" 
## 
## $c82cop1
## $c82cop1$conditional
## [1] "c161sex" "e42dep" 
## 
## 
## $c83cop2
## $c83cop2$conditional
## [1] "c161sex" "e42dep" 
## 
## 
## $c84cop3
## $c84cop3$conditional
## [1] "c161sex" "e42dep"
head(get_data(b7))
##   c82cop1 c161sex e42dep c83cop2 c84cop3
## 1       3       2      3       2       2
## 2       3       2      3       3       3
## 3       2       1      3       2       1
## 4       4       1      4       1       3
## 5       3       2      4       2       1
## 6       2       1      4       2       3
b8
##  Family: MV(gaussian, gaussian) 
##   Links: mu = identity; sigma = identity
##          mu = identity; sigma = identity 
## Formula: neg_c_7 ~ e42dep + c12hour + c172code 
##          c12hour ~ c172code 
##    Data: efc (Number of observations: 834) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Population-Level Effects: 
##                   Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## negc7_Intercept       8.91      0.53     7.89     9.94        168 1.00
## c12hour_Intercept    50.02      3.71    42.40    56.46        250 1.00
## negc7_e42dep2         1.16      0.55     0.19     2.18        143 1.01
## negc7_e42dep3         2.44      0.54     1.38     3.59        138 1.02
## negc7_e42dep4         4.02      0.58     2.91     5.16        130 1.00
## negc7_c12hour         0.01      0.00     0.00     0.01        250 1.00
## negc7_c172code2       0.09      0.35    -0.57     0.67        250 1.00
## negc7_c172code3       0.63      0.45    -0.26     1.43        250 1.00
## c12hour_c172code2    -8.30      4.28   -16.00     0.07        250 1.00
## c12hour_c172code3   -15.45      5.54   -26.15    -5.42        250 1.00
## 
## Family Specific Parameters: 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma_negc7       3.59      0.09     3.45     3.79        250 1.01
## sigma_c12hour    50.37      1.37    47.75    53.23        250 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b8)
## $negc7
## $negc7$conditional
## neg_c_7 ~ e42dep + c12hour + c172code
## <environment: 0x00000000400225a0>
## 
## 
## $c12hour
## $c12hour$conditional
## c12hour ~ c172code
## <environment: 0x0000000040043880>
## 
## 
## attr(,"is_mv")
## [1] "1"
find_terms(b8)
## $response
##     negc7   c12hour 
## "neg_c_7" "c12hour" 
## 
## $negc7
## $negc7$conditional
## [1] "e42dep"   "c12hour"  "c172code"
## 
## 
## $c12hour
## $c12hour$conditional
## [1] "c172code"
head(get_data(b8))
##   neg_c_7 e42dep c12hour c172code
## 1      12      3      16        2
## 2      20      3     148        2
## 3      11      3      70        1
## 4      10      4     168        2
## 5      12      4     168        2
## 6      19      4      16        2
b9
##  Family: zero_inflated_poisson 
##   Links: mu = log; zi = identity 
## Formula: count ~ persons + child + camper 
##    Data: zinb (Number of observations: 250) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept    -1.00      0.17    -1.31    -0.69        174 1.00
## persons       0.87      0.04     0.78     0.97        179 1.00
## child        -1.36      0.09    -1.53    -1.20        156 1.01
## camper        0.79      0.09     0.61     0.94        169 1.01
## 
## Family Specific Parameters: 
##    Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## zi     0.41      0.04     0.31     0.48        134 1.02
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b9)
## $conditional
## count ~ persons + child + camper
## <environment: 0x00000000412c3b40>
find_terms(b9)
## $response
## [1] "count"
## 
## $conditional
## [1] "persons" "child"   "camper"
head(get_data(b9))
##   count persons child camper
## 1     0       1     0      0
## 2     0       1     0      1
## 3     0       1     0      0
## 4     0       2     1      1
## 5     1       1     0      0
## 6     0       4     2      1
b10
##  Family: zero_inflated_poisson 
##   Links: mu = log; zi = logit 
## Formula: count ~ persons + child + camper 
##          zi ~ child + camper
##    Data: zinb (Number of observations: 250) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Population-Level Effects: 
##              Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept       -1.07      0.16    -1.35    -0.77        218 1.00
## zi_Intercept    -0.58      0.33    -1.19     0.06        250 1.00
## persons          0.90      0.04     0.81     0.97        250 1.00
## child           -1.18      0.09    -1.36    -1.00        136 1.00
## camper           0.75      0.10     0.58     0.96        250 1.00
## zi_child         1.24      0.27     0.74     1.77        250 1.00
## zi_camper       -0.61      0.36    -1.22     0.02        203 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b10)
## $conditional
## count ~ persons + child + camper
## <environment: 0x00000000368f9ab0>
## 
## $zero_inflated
## ~child + camper
## <environment: 0x00000000368f9ab0>
find_terms(b10)
## $response
## [1] "count"
## 
## $conditional
## [1] "persons" "child"   "camper" 
## 
## $zero_inflated
## [1] "child"  "camper"
head(get_data(b10))
##   count persons child camper
## 1     0       1     0      0
## 2     0       1     0      1
## 3     0       1     0      0
## 4     0       2     1      1
## 5     1       1     0      0
## 6     0       4     2      1
b11
## Warning: There were 4 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help.
## See http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
##  Family: zero_inflated_poisson 
##   Links: mu = log; zi = logit 
## Formula: count ~ child + camper + (1 | persons) 
##          zi ~ child + camper
##    Data: zinb (Number of observations: 250) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~persons (Number of levels: 4) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     2.09      1.13     0.79     5.33         85 1.01
## 
## Population-Level Effects: 
##              Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept        1.09      1.12    -1.27     2.98         53 1.02
## zi_Intercept    -0.65      0.34    -1.32    -0.01        244 1.00
## child           -1.18      0.09    -1.36    -0.99        250 1.00
## camper           0.74      0.10     0.56     0.92        250 1.00
## zi_child         1.38      0.32     0.76     1.97        205 1.00
## zi_camper       -0.74      0.39    -1.57    -0.00        241 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b11)
## $conditional
## count ~ child + camper
## <environment: 0x000000003910b9b0>
## 
## $random
## ~1 | persons
## <environment: 0x0000000039136638>
## 
## $zero_inflated
## ~child + camper
## <environment: 0x000000003910b9b0>
find_terms(b11)
## $response
## [1] "count"
## 
## $conditional
## [1] "child"  "camper"
## 
## $random
## [1] "persons"
## 
## $zero_inflated
## [1] "child"  "camper"
head(get_data(b11))
##   count child camper persons
## 1     0     0      0       1
## 2     0     0      1       1
## 3     0     0      0       1
## 4     0     1      1       2
## 5     1     0      0       1
## 6     0     2      1       4
b12
## Warning: There were 8 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help.
## See http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
##  Family: zero_inflated_poisson 
##   Links: mu = log; zi = logit 
## Formula: count ~ child + camper + (1 | persons) 
##          zi ~ child + camper + (1 | persons)
##    Data: zinb (Number of observations: 250) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~persons (Number of levels: 4) 
##                  Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)        1.58      0.67     0.71     3.13        134 1.00
## sd(zi_Intercept)     1.74      0.90     0.60     3.80         88 1.00
## 
## Population-Level Effects: 
##              Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept        1.34      0.78    -0.36     3.36         68 1.00
## zi_Intercept    -0.64      0.83    -2.30     0.98        110 1.01
## child           -1.15      0.10    -1.36    -0.99        137 1.02
## camper           0.72      0.09     0.56     0.91        144 1.00
## zi_child         1.89      0.32     1.35     2.55        242 1.00
## zi_camper       -0.84      0.36    -1.54    -0.22        208 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b12)
## $conditional
## count ~ child + camper
## <environment: 0x000000003b815388>
## 
## $random
## ~1 | persons
## <environment: 0x000000003b84c550>
## 
## $zero_inflated
## ~child + camper
## <environment: 0x000000003b815388>
## 
## $zero_inflated_random
## ~1 | persons
## <environment: 0x000000003b88a058>
find_terms(b12)
## $response
## [1] "count"
## 
## $conditional
## [1] "child"  "camper"
## 
## $random
## [1] "persons"
## 
## $zero_inflated
## [1] "child"  "camper"
## 
## $zero_inflated_random
## [1] "persons"
head(get_data(b12))
##   count child camper persons
## 1     0     0      0       1
## 2     0     0      1       1
## 3     0     0      0       1
## 4     0     1      1       2
## 5     1     0      0       1
## 6     0     2      1       4
b13
## Warning: There were 2 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help.
## See http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
##  Family: MV(gaussian, gaussian, gaussian) 
##   Links: mu = identity; sigma = identity
##          mu = identity; sigma = identity
##          mu = identity; sigma = identity 
## Formula: c82cop1 ~ c161sex + e42dep + (1 | e15relat) 
##          c83cop2 ~ c161sex + e42dep + (1 | e15relat) 
##          c84cop3 ~ c161sex + e42dep + (1 | e15relat) 
##    Data: efc (Number of observations: 898) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~e15relat (Number of levels: 8) 
##                       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(c82cop1_Intercept)     0.09      0.07     0.01     0.27         58 1.00
## sd(c83cop2_Intercept)     0.05      0.04     0.00     0.14        112 1.00
## sd(c84cop3_Intercept)     0.09      0.07     0.01     0.27         98 1.00
## 
## Population-Level Effects: 
##                   Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## c82cop1_Intercept     3.41      0.08     3.27     3.58         89 1.00
## c83cop2_Intercept     1.50      0.09     1.34     1.69        111 1.00
## c84cop3_Intercept     1.13      0.11     0.92     1.34        110 1.00
## c82cop1_c161sex2     -0.06      0.04    -0.14     0.03        190 1.00
## c82cop1_e42dep2      -0.11      0.07    -0.25     0.04        102 1.00
## c82cop1_e42dep3      -0.30      0.07    -0.45    -0.16        108 1.00
## c82cop1_e42dep4      -0.34      0.08    -0.50    -0.20        112 1.00
## c83cop2_c161sex2      0.07      0.05    -0.05     0.17        202 1.00
## c83cop2_e42dep2       0.20      0.09     0.00     0.37        132 1.00
## c83cop2_e42dep3       0.49      0.09     0.30     0.67        115 1.00
## c83cop2_e42dep4       0.72      0.10     0.51     0.87        117 1.00
## c84cop3_c161sex2     -0.02      0.06    -0.14     0.11        250 1.00
## c84cop3_e42dep2       0.25      0.11     0.04     0.47        124 1.00
## c84cop3_e42dep3       0.49      0.10     0.28     0.68         95 1.00
## c84cop3_e42dep4       0.81      0.10     0.63     1.02        106 1.00
## 
## Family Specific Parameters: 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma_c82cop1     0.57      0.01     0.55     0.60        250 1.00
## sigma_c83cop2     0.69      0.02     0.65     0.72        250 1.00
## sigma_c84cop3     0.83      0.02     0.78     0.87        250 1.00
## 
## Residual Correlations: 
##                         Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## rescor(c82cop1,c83cop2)    -0.35      0.03    -0.41    -0.29        240
## rescor(c82cop1,c84cop3)    -0.17      0.03    -0.23    -0.11        250
## rescor(c83cop2,c84cop3)     0.31      0.03     0.25     0.37        250
##                         Rhat
## rescor(c82cop1,c83cop2) 1.01
## rescor(c82cop1,c84cop3) 1.00
## rescor(c83cop2,c84cop3) 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b13)
## $c82cop1
## $c82cop1$conditional
## c82cop1 ~ c161sex + e42dep
## <environment: 0x0000000040a20f20>
## 
## $c82cop1$random
## ~1 | e15relat
## <environment: 0x0000000040482d88>
## 
## 
## $c83cop2
## $c83cop2$conditional
## c83cop2 ~ c161sex + e42dep
## <environment: 0x0000000040338d50>
## 
## $c83cop2$random
## ~1 | e15relat
## <environment: 0x0000000040157458>
## 
## 
## $c84cop3
## $c84cop3$conditional
## c84cop3 ~ c161sex + e42dep
## <environment: 0x000000003ff29c50>
## 
## $c84cop3$random
## ~1 | e15relat
## <environment: 0x0000000038639020>
## 
## 
## attr(,"is_mv")
## [1] "1"
find_terms(b13)
## $response
##   c82cop1   c83cop2   c84cop3 
## "c82cop1" "c83cop2" "c84cop3" 
## 
## $c82cop1
## $c82cop1$conditional
## [1] "c161sex" "e42dep" 
## 
## $c82cop1$random
## [1] "e15relat"
## 
## 
## $c83cop2
## $c83cop2$conditional
## [1] "c161sex" "e42dep" 
## 
## $c83cop2$random
## [1] "e15relat"
## 
## 
## $c84cop3
## $c84cop3$conditional
## [1] "c161sex" "e42dep" 
## 
## $c84cop3$random
## [1] "e15relat"
head(get_data(b13))
##   c82cop1 c161sex e42dep e15relat c83cop2 c84cop3
## 1       3       2      3        2       2       2
## 2       3       2      3        2       3       3
## 3       2       1      3        1       2       1
## 4       4       1      4        1       1       3
## 5       3       2      4        2       2       1
## 6       2       1      4        2       2       3
b14
## Warning: There were 3 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help.
## See http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
##  Family: MV(gaussian, gaussian) 
##   Links: mu = identity; sigma = identity
##          mu = identity; sigma = identity 
## Formula: neg_c_7 ~ e42dep + c12hour + c172code + (1 | ID | e15relat) 
##          c12hour ~ c172code + (1 | ID | e15relat) 
##    Data: efc (Number of observations: 834) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~e15relat (Number of levels: 8) 
##                                        Estimate Est.Error l-95% CI
## sd(negc7_Intercept)                        0.63      0.38     0.16
## sd(c12hour_Intercept)                     28.69      8.29    16.06
## cor(negc7_Intercept,c12hour_Intercept)     0.54      0.33    -0.14
##                                        u-95% CI Eff.Sample Rhat
## sd(negc7_Intercept)                        1.61         85 1.00
## sd(c12hour_Intercept)                     45.59         86 1.00
## cor(negc7_Intercept,c12hour_Intercept)     0.97         88 1.00
## 
## Population-Level Effects: 
##                   Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## negc7_Intercept       8.64      0.59     7.52     9.89        142 1.00
## c12hour_Intercept    37.88      9.78    19.34    61.45        128 1.00
## negc7_e42dep2         1.19      0.52     0.11     2.23        136 1.00
## negc7_e42dep3         2.38      0.54     1.21     3.40        145 1.00
## negc7_e42dep4         3.97      0.55     2.89     5.02        121 1.00
## negc7_c12hour         0.01      0.00     0.00     0.01        250 1.00
## negc7_c172code2       0.20      0.30    -0.30     0.83        250 1.00
## negc7_c172code3       0.74      0.41    -0.09     1.51        250 1.00
## c12hour_c172code2    -0.73      3.82    -8.60     6.27        250 1.00
## c12hour_c172code3    -7.10      4.43   -16.48     1.36        250 1.00
## 
## Family Specific Parameters: 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma_negc7       3.58      0.09     3.42     3.75        250 1.00
## sigma_c12hour    46.29      1.05    44.43    48.58        250 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b14)
## $negc7
## $negc7$conditional
## neg_c_7 ~ e42dep + c12hour + c172code
## <environment: 0x0000000042e9b368>
## 
## $negc7$random
## ~1 | ID | e15relat
## <environment: 0x0000000042ed03a8>
## 
## 
## $c12hour
## $c12hour$conditional
## c12hour ~ c172code
## <environment: 0x0000000042ee44c0>
## 
## $c12hour$random
## ~1 | ID | e15relat
## <environment: 0x0000000042f06e00>
## 
## 
## attr(,"is_mv")
## [1] "1"
find_terms(b14)
## $response
##     negc7   c12hour 
## "neg_c_7" "c12hour" 
## 
## $negc7
## $negc7$conditional
## [1] "e42dep"   "c12hour"  "c172code"
## 
## $negc7$random
## [1] "ID | e15relat"
## 
## 
## $c12hour
## $c12hour$conditional
## [1] "c172code"
## 
## $c12hour$random
## [1] "ID | e15relat"
head(get_data(b14))
##   neg_c_7 e42dep c12hour c172code e15relat
## 1      12      3      16        2        2
## 2      20      3     148        2        2
## 3      11      3      70        1        1
## 4      10      4     168        2        1
## 5      12      4     168        2        2
## 6      19      4      16        2        2
b15
##  Family: cumulative 
##   Links: mu = logit; disc = identity 
## Formula: rating ~ temp + contact + (1 | bottle) + (1 | judge) 
##    Data: wine (Number of observations: 72) 
## Samples: 1 chains, each with iter = 500; warmup = 250; thin = 1;
##          total post-warmup samples = 250
## 
## Group-Level Effects: 
## ~bottle (Number of levels: 8) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     0.50      0.45     0.04     1.66         65 1.01
## 
## ~judge (Number of levels: 9) 
##               Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)     1.51      0.73     0.66     3.05         60 1.01
## 
## Population-Level Effects: 
##              Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept[1]    -1.75      0.89    -3.46    -0.06        108 1.00
## Intercept[2]     1.62      0.83     0.03     3.42        140 1.00
## Intercept[3]     4.53      1.03     2.72     6.89        159 1.00
## Intercept[4]     6.61      1.12     4.63     9.00        163 1.00
## tempwarm         3.38      0.87     1.97     5.57        131 1.01
## contactyes       1.96      0.66     0.91     3.26        168 1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
find_formula(b15)
## $conditional
## rating ~ temp + contact
## <environment: 0x000000004171f218>
## 
## $random
## $random[[1]]
## ~1 | bottle
## <environment: 0x00000000416dd400>
## 
## $random[[2]]
## ~1 | judge
## <environment: 0x00000000416cfe58>
find_terms(b15)
## $response
## [1] "rating"
## 
## $conditional
## [1] "temp"    "contact"
## 
## $random
## [1] "bottle" "judge"
head(get_data(b15))
##   rating temp contact bottle judge
## 1      2 cold      no      1     1
## 2      3 cold      no      2     1
## 3      3 cold     yes      3     1
## 4      4 cold     yes      4     1
## 5      4 warm      no      5     1
## 6      4 warm      no      6     1