easystats / bayestestR

:ghost: Utilities for analyzing Bayesian models and posterior distributions
https://easystats.github.io/bayestestR/
GNU General Public License v3.0
577 stars 55 forks source link

Overview print-methods() #228

Closed strengejacke closed 5 years ago

strengejacke commented 5 years ago

This is a long example, so I though just for demonstration purposes, I show the print-out in this issue (instead of other issues, where this would clutter up the thread).

We could also fix the print for BF, what do you think? @mattansb @DominiqueMakowski

library(bayestestR)
library(insight)

m1 <- download_model("brms_zi_3")
#> Registered S3 method overwritten by 'xts':
#>   method     from
#>   as.zoo.xts zoo
m2 <- download_model("stanreg_glm_2")

# HDI, brms-model ---------------

hdi(m1)
#> # Highest Density Interval
#> 
#>  Parameter        89% HDI
#>  Intercept [ 0.05,  2.27]
#>      child [-1.32, -0.98]
#>     camper [ 0.59,  0.86]

hdi(m1, effects = "all")
#> # Highest Density Interval
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter        89% HDI
#>  Intercept [ 0.05,  2.27]
#>      child [-1.32, -0.98]
#>     camper [ 0.59,  0.86]
#> 
#> # random effects, conditional component
#> 
#>               Parameter        89% HDI
#>  r_persons.1.Intercept. [-2.55, -0.03]
#>  r_persons.2.Intercept. [-1.45,  1.01]
#>  r_persons.3.Intercept. [-0.73,  1.59]
#>  r_persons.4.Intercept. [ 0.29,  2.54]

hdi(m1, effects = "all", component = "all")
#> # Highest Density Interval
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter        89% HDI
#>  Intercept [ 0.05,  2.27]
#>      child [-1.32, -0.98]
#>     camper [ 0.59,  0.86]
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter        89% HDI
#>  Intercept [-1.89,  0.22]
#>      child [ 1.30,  2.30]
#>     camper [-1.34, -0.23]
#> 
#> # random effects, conditional component
#> 
#>               Parameter        89% HDI
#>  r_persons.1.Intercept. [-2.55, -0.03]
#>  r_persons.2.Intercept. [-1.45,  1.01]
#>  r_persons.3.Intercept. [-0.73,  1.59]
#>  r_persons.4.Intercept. [ 0.29,  2.54]
#> 
#> # random effects, zero-inflation component
#> 
#>               Parameter        89% HDI
#>  r_persons.1.Intercept. [ 0.37,  2.66]
#>  r_persons.2.Intercept. [-0.73,  1.49]
#>  r_persons.3.Intercept. [-1.16,  1.13]
#>  r_persons.4.Intercept. [-2.46, -0.06]

# HDI, rstanarm-model---------------

hdi(m2)
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [ 5.24, 14.26]
#>           wt [-0.89,  2.32]
#>          cyl [-3.03, -0.91]

hdi(m2, effects = "all")
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [ 5.24, 14.26]
#>           wt [-0.89,  2.32]
#>          cyl [-3.03, -0.91]

hdi(m2, effects = "all", component = "all")
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [ 5.24, 14.26]
#>           wt [-0.89,  2.32]
#>          cyl [-3.03, -0.91]

# pd, brms-model ---------------

pd(m1)
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept)  94.00%
#>        child 100.00%
#>       camper 100.00%

pd(m1, effects = "all")
#> # Probability of Direction (pd)
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter      pd
#>  (Intercept)  94.00%
#>        child 100.00%
#>       camper 100.00%
#> 
#> # random effects, conditional component
#> 
#>  Parameter     pd
#>  persons 1 94.00%
#>  persons 2 66.00%
#>  persons 3 70.80%
#>  persons 4 96.00%

pd(m1, effects = "all", component = "all")
#> # Probability of Direction (pd)
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter      pd
#>  (Intercept)  94.00%
#>        child 100.00%
#>       camper 100.00%
#> 
#> # fixed effects, zero-inflation component
#> 
#>    Parameter      pd
#>  (Intercept)  87.60%
#>        child 100.00%
#>       camper  99.20%
#> 
#> # random effects, conditional component
#> 
#>  Parameter     pd
#>  persons 1 94.00%
#>  persons 2 66.00%
#>  persons 3 70.80%
#>  persons 4 96.00%
#> 
#> # random effects, zero-inflation component
#> 
#>  Parameter     pd
#>  persons 1 95.60%
#>  persons 2 72.40%
#>  persons 3 58.00%
#>  persons 4 97.20%

# pd, rstanarm-model---------------

pd(m2)
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept) 100.00%
#>           wt  76.80%
#>          cyl 100.00%

pd(m2, effects = "all")
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept) 100.00%
#>           wt  76.80%
#>          cyl 100.00%

pd(m2, effects = "all", component = "all")
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept) 100.00%
#>           wt  76.80%
#>          cyl 100.00%

# point_estimate, brms-model ---------------

point_estimate(m1)
#> # Point Estimates
#> 
#>  Parameter Median
#>  Intercept   1.32
#>      child  -1.16
#>     camper   0.73

point_estimate(m1, centrality = "all", effects = "all")
#> # Point Estimates
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter Median  Mean   MAP
#>  Intercept   1.32  1.19  1.45
#>      child  -1.16 -1.16 -1.18
#>     camper   0.73  0.73  0.74
#> 
#> # random effects, conditional component
#> 
#>               Parameter Median  Mean   MAP
#>  r_persons.1.Intercept.  -1.32 -1.23 -1.40
#>  r_persons.2.Intercept.  -0.38 -0.26 -0.54
#>  r_persons.3.Intercept.   0.31  0.44  0.14
#>  r_persons.4.Intercept.   1.21  1.33  1.03

point_estimate(m1, centrality = "all", effects = "all", component = "all")
#> # Point Estimates
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter Median  Mean   MAP
#>  Intercept   1.32  1.19  1.45
#>      child  -1.16 -1.16 -1.18
#>     camper   0.73  0.73  0.74
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter Median  Mean   MAP
#>  Intercept  -0.78 -0.73 -0.89
#>      child   1.89  1.88  1.91
#>     camper  -0.84 -0.84 -0.78
#> 
#> # random effects, conditional component
#> 
#>               Parameter Median  Mean   MAP
#>  r_persons.1.Intercept.  -1.32 -1.23 -1.40
#>  r_persons.2.Intercept.  -0.38 -0.26 -0.54
#>  r_persons.3.Intercept.   0.31  0.44  0.14
#>  r_persons.4.Intercept.   1.21  1.33  1.03
#> 
#> # random effects, zero-inflation component
#> 
#>               Parameter Median  Mean   MAP
#>  r_persons.1.Intercept.   1.35  1.32  1.37
#>  r_persons.2.Intercept.   0.38  0.36  0.51
#>  r_persons.3.Intercept.  -0.12 -0.14 -0.10
#>  r_persons.4.Intercept.  -1.17 -1.27 -1.02

# point_estimate, rstanarm-model---------------

point_estimate(m2)
#> # Point Estimates
#> 
#>    Parameter Median
#>  (Intercept)   9.33
#>           wt   0.76
#>          cyl  -1.99

point_estimate(m2, centrality = "all", effects = "all")
#> # Point Estimates
#> 
#>    Parameter Median  Mean   MAP
#>  (Intercept)   9.33  9.64  9.04
#>           wt   0.76  0.71  0.97
#>          cyl  -1.99 -2.02 -1.98

point_estimate(m2, centrality = "all", effects = "all", component = "all")
#> # Point Estimates
#> 
#>    Parameter Median  Mean   MAP
#>  (Intercept)   9.33  9.64  9.04
#>           wt   0.76  0.71  0.97
#>          cyl  -1.99 -2.02 -1.98

# p_map, brms-model ---------------

p_map(m1)
#> # MAP-based p-value
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000

p_map(m1, effects = "all")
#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000
#> 
#> # random effects, conditional component
#> 
#>               Parameter  p_MAP
#>  r_persons.1.Intercept. 0.2119
#>  r_persons.2.Intercept. 0.6509
#>  r_persons.3.Intercept. 0.9571
#>  r_persons.4.Intercept. 0.0854

p_map(m1, effects = "all", component = "all")
#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter  p_MAP
#>  Intercept 0.4869
#>      child 0.0000
#>     camper 0.0574
#> 
#> # random effects, conditional component
#> 
#>               Parameter  p_MAP
#>  r_persons.1.Intercept. 0.2119
#>  r_persons.2.Intercept. 0.6509
#>  r_persons.3.Intercept. 0.9571
#>  r_persons.4.Intercept. 0.0854
#> 
#> # random effects, zero-inflation component
#> 
#>               Parameter p_MAP
#>  r_persons.1.Intercept. 0.181
#>  r_persons.2.Intercept. 0.802
#>  r_persons.3.Intercept. 0.984
#>  r_persons.4.Intercept. 0.166

# p_map, rstanarm-model---------------

p_map(m2)
#> # MAP-based p-value
#> 
#>    Parameter p_MAP
#>  (Intercept) 0.000
#>           wt 0.698
#>          cyl 0.000

p_map(m2, effects = "all")
#> # MAP-based p-value
#> 
#>    Parameter p_MAP
#>  (Intercept) 0.000
#>           wt 0.698
#>          cyl 0.000

p_map(m2, effects = "all", component = "all")
#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded
#> # MAP-based p-value
#> 
#>    Parameter p_MAP
#>  (Intercept) 0.000
#>           wt 0.698
#>          cyl 0.000

# bayesfactor_parameters, brms-model ---------------

bayesfactor_parameters(m1, m1)
#> Loading required namespace: logspline
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  b_Intercept            1   fixed conditional
#>      b_child            1   fixed conditional
#>     b_camper            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m1, m1, effects = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>               Parameter Bayes Factor Effects   Component
#>             b_Intercept            1   fixed conditional
#>                 b_child            1   fixed conditional
#>                b_camper            1   fixed conditional
#>  r_persons.1.Intercept.            1  random conditional
#>  r_persons.2.Intercept.            1  random conditional
#>  r_persons.3.Intercept.            1  random conditional
#>  r_persons.4.Intercept.            1  random conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m1, m1, effects = "all", component = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>                   Parameter Bayes Factor Effects     Component
#>                 b_Intercept            1   fixed   conditional
#>                     b_child            1   fixed   conditional
#>                    b_camper            1   fixed   conditional
#>      r_persons.1.Intercept.            1  random   conditional
#>      r_persons.2.Intercept.            1  random   conditional
#>      r_persons.3.Intercept.            1  random   conditional
#>      r_persons.4.Intercept.            1  random   conditional
#>              b_zi_Intercept            1   fixed zero_inflated
#>                  b_zi_child            1   fixed zero_inflated
#>                 b_zi_camper            1   fixed zero_inflated
#>  r_persons__zi.1.Intercept.            1  random zero_inflated
#>  r_persons__zi.2.Intercept.            1  random zero_inflated
#>  r_persons__zi.3.Intercept.            1  random zero_inflated
#>  r_persons__zi.4.Intercept.            1  random zero_inflated
#> 
#> * Evidence Against The Null: [0]

# bayesfactor_parameters, rstanarm-model---------------

bayesfactor_parameters(m2, m2)
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>           wt            1   fixed conditional
#>          cyl            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m2, m2, effects = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>           wt            1   fixed conditional
#>          cyl            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m2, m2, effects = "all", component = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>           wt            1   fixed conditional
#>          cyl            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

Created on 2019-09-11 by the reprex package (v0.3.0)

strengejacke commented 5 years ago

Not sure, though, why pd() removes the .Intercept. suffix from the output of the random effects, while other methods don't?

mattansb commented 5 years ago

@strengejacke you can give bf_params a go - the printing method currently is a bit messy, but I swear all the pieces are there for a reason!

One minor styling note - too many empty lines? So maybes eg this:

#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000
#> 
#> # random effects, conditional component
#> 
#>               Parameter  p_MAP
#>  r_persons.1.Intercept. 0.2119
#>  r_persons.2.Intercept. 0.6509
#>  r_persons.3.Intercept. 0.9571
#>  r_persons.4.Intercept. 0.0854

can become this (especially considering as the headings are colored, right?):

#> # MAP-based p-value
#> # fixed effects, conditional component
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000
#> 
#> # random effects, conditional component
#>               Parameter  p_MAP
#>  r_persons.1.Intercept. 0.2119
#>  r_persons.2.Intercept. 0.6509
#>  r_persons.3.Intercept. 0.9571
#>  r_persons.4.Intercept. 0.0854
strengejacke commented 5 years ago

Yes, I'm a bit undecided, it's really a matter of taste and I don't mind changing it. Essentially, all print-metods for multiple components/effects call print_data_frame(), where we can fix it once for all print-outs: https://github.com/easystats/bayestestR/blob/master/R/utils_print_data_frame.R

The related code-line is here.

strengejacke commented 5 years ago

Fix

library(bayestestR)
library(insight)

m1 <- download_model("brms_zi_3")
#> Registered S3 method overwritten by 'xts':
#>   method     from
#>   as.zoo.xts zoo
m2 <- download_model("stanreg_glm_2")
m3 <- download_model("stanreg_merMod_5")

# HDI, brms-model ---------------

hdi(m1)
#> # Highest Density Interval
#> 
#>  Parameter        89% HDI
#>  Intercept [ 0.05,  2.27]
#>      child [-1.32, -0.98]
#>     camper [ 0.59,  0.86]

hdi(m1, effects = "all")
#> # Highest Density Interval
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter        89% HDI
#>  Intercept [ 0.05,  2.27]
#>      child [-1.32, -0.98]
#>     camper [ 0.59,  0.86]
#> 
#> # random effects, conditional component
#> 
#>  Parameter        89% HDI
#>  persons 1 [-2.55, -0.03]
#>  persons 2 [-1.45,  1.01]
#>  persons 3 [-0.73,  1.59]
#>  persons 4 [ 0.29,  2.54]

hdi(m1, effects = "all", component = "all")
#> # Highest Density Interval
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter        89% HDI
#>  Intercept [ 0.05,  2.27]
#>      child [-1.32, -0.98]
#>     camper [ 0.59,  0.86]
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter        89% HDI
#>  Intercept [-1.89,  0.22]
#>      child [ 1.30,  2.30]
#>     camper [-1.34, -0.23]
#> 
#> # random effects, conditional component
#> 
#>  Parameter        89% HDI
#>  persons 1 [-2.55, -0.03]
#>  persons 2 [-1.45,  1.01]
#>  persons 3 [-0.73,  1.59]
#>  persons 4 [ 0.29,  2.54]
#> 
#> # random effects, zero-inflation component
#> 
#>  Parameter        89% HDI
#>  persons 1 [ 0.37,  2.66]
#>  persons 2 [-0.73,  1.49]
#>  persons 3 [-1.16,  1.13]
#>  persons 4 [-2.46, -0.06]

# HDI, rstanarm-model---------------

hdi(m2)
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [ 5.24, 14.26]
#>           wt [-0.89,  2.32]
#>          cyl [-3.03, -0.91]

hdi(m2, effects = "all")
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [ 5.24, 14.26]
#>           wt [-0.89,  2.32]
#>          cyl [-3.03, -0.91]

hdi(m2, effects = "all", component = "all")
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [ 5.24, 14.26]
#>           wt [-0.89,  2.32]
#>          cyl [-3.03, -0.91]

# HDI, rstanarm-model---------------

hdi(m3)
#> # Highest Density Interval
#> 
#>    Parameter        89% HDI
#>  (Intercept) [-2.45, -0.52]
#>         size [-0.04,  0.05]
#>      period2 [-1.50, -0.51]
#>      period3 [-1.72, -0.63]
#>      period4 [-2.27, -0.87]

hdi(m3, effects = "all")
#> # Highest Density Interval
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter        89% HDI
#>  (Intercept) [-2.45, -0.52]
#>         size [-0.04,  0.05]
#>      period2 [-1.50, -0.51]
#>      period3 [-1.72, -0.63]
#>      period4 [-2.27, -0.87]
#> 
#> # random effects, conditional component
#> 
#>  Parameter        89% HDI
#>     herd:1 [-0.06,  1.35]
#>     herd:2 [-1.09,  0.33]
#>     herd:3 [-0.16,  1.01]
#>     herd:4 [-0.80,  0.75]
#>     herd:5 [-0.96,  0.36]
#>     herd:6 [-1.20,  0.25]
#>     herd:7 [ 0.18,  1.57]
#>     herd:8 [-0.21,  1.38]
#>     herd:9 [-1.21,  0.64]
#>    herd:10 [-1.22,  0.19]
#>    herd:11 [-0.76,  0.64]
#>    herd:12 [-0.96,  0.69]
#>    herd:13 [-1.48, -0.01]
#>    herd:14 [ 0.17,  1.74]
#>    herd:15 [-1.36,  0.20]

hdi(m3, effects = "all", component = "all")
#> # Highest Density Interval
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter        89% HDI
#>  (Intercept) [-2.45, -0.52]
#>         size [-0.04,  0.05]
#>      period2 [-1.50, -0.51]
#>      period3 [-1.72, -0.63]
#>      period4 [-2.27, -0.87]
#> 
#> # random effects, conditional component
#> 
#>  Parameter        89% HDI
#>     herd:1 [-0.06,  1.35]
#>     herd:2 [-1.09,  0.33]
#>     herd:3 [-0.16,  1.01]
#>     herd:4 [-0.80,  0.75]
#>     herd:5 [-0.96,  0.36]
#>     herd:6 [-1.20,  0.25]
#>     herd:7 [ 0.18,  1.57]
#>     herd:8 [-0.21,  1.38]
#>     herd:9 [-1.21,  0.64]
#>    herd:10 [-1.22,  0.19]
#>    herd:11 [-0.76,  0.64]
#>    herd:12 [-0.96,  0.69]
#>    herd:13 [-1.48, -0.01]
#>    herd:14 [ 0.17,  1.74]
#>    herd:15 [-1.36,  0.20]

# pd, brms-model ---------------

pd(m1)
#> # Probability of Direction (pd)
#> 
#>  Parameter      pd
#>  Intercept  94.00%
#>      child 100.00%
#>     camper 100.00%

pd(m1, effects = "all")
#> # Probability of Direction (pd)
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter      pd
#>  Intercept  94.00%
#>      child 100.00%
#>     camper 100.00%
#> 
#> # random effects, conditional component
#> 
#>  Parameter     pd
#>  persons 1 94.00%
#>  persons 2 66.00%
#>  persons 3 70.80%
#>  persons 4 96.00%

pd(m1, effects = "all", component = "all")
#> # Probability of Direction (pd)
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter      pd
#>  Intercept  94.00%
#>      child 100.00%
#>     camper 100.00%
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter      pd
#>  Intercept  87.60%
#>      child 100.00%
#>     camper  99.20%
#> 
#> # random effects, conditional component
#> 
#>  Parameter     pd
#>  persons 1 94.00%
#>  persons 2 66.00%
#>  persons 3 70.80%
#>  persons 4 96.00%
#> 
#> # random effects, zero-inflation component
#> 
#>  Parameter     pd
#>  persons 1 95.60%
#>  persons 2 72.40%
#>  persons 3 58.00%
#>  persons 4 97.20%

# pd, rstanarm-model---------------

pd(m2)
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept) 100.00%
#>           wt  76.80%
#>          cyl 100.00%

pd(m2, effects = "all")
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept) 100.00%
#>           wt  76.80%
#>          cyl 100.00%

pd(m2, effects = "all", component = "all")
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept) 100.00%
#>           wt  76.80%
#>          cyl 100.00%

# pd, rstanarm-model---------------

pd(m3)
#> # Probability of Direction (pd)
#> 
#>    Parameter      pd
#>  (Intercept)  99.40%
#>         size  58.20%
#>      period2 100.00%
#>      period3 100.00%
#>      period4 100.00%

pd(m3, effects = "all")
#> # Probability of Direction (pd)
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter      pd
#>  (Intercept)  99.40%
#>         size  58.20%
#>      period2 100.00%
#>      period3 100.00%
#>      period4 100.00%
#> 
#> # random effects, conditional component
#> 
#>  Parameter     pd
#>     herd:1 92.40%
#>     herd:2 81.40%
#>     herd:3 88.40%
#>     herd:4 52.60%
#>     herd:5 73.20%
#>     herd:6 84.80%
#>     herd:7 99.20%
#>     herd:8 85.00%
#>     herd:9 63.80%
#>    herd:10 93.60%
#>    herd:11 61.80%
#>    herd:12 52.80%
#>    herd:13 97.40%
#>    herd:14 98.60%
#>    herd:15 88.60%

pd(m3, effects = "all", component = "all")
#> # Probability of Direction (pd)
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter      pd
#>  (Intercept)  99.40%
#>         size  58.20%
#>      period2 100.00%
#>      period3 100.00%
#>      period4 100.00%
#> 
#> # random effects, conditional component
#> 
#>  Parameter     pd
#>     herd:1 92.40%
#>     herd:2 81.40%
#>     herd:3 88.40%
#>     herd:4 52.60%
#>     herd:5 73.20%
#>     herd:6 84.80%
#>     herd:7 99.20%
#>     herd:8 85.00%
#>     herd:9 63.80%
#>    herd:10 93.60%
#>    herd:11 61.80%
#>    herd:12 52.80%
#>    herd:13 97.40%
#>    herd:14 98.60%
#>    herd:15 88.60%

# point_estimate, brms-model ---------------

point_estimate(m1)
#> # Point Estimates
#> 
#>  Parameter Median
#>  Intercept   1.32
#>      child  -1.16
#>     camper   0.73

point_estimate(m1, centrality = "all", effects = "all")
#> # Point Estimates
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter Median  Mean   MAP
#>  Intercept   1.32  1.19  1.45
#>      child  -1.16 -1.16 -1.18
#>     camper   0.73  0.73  0.74
#> 
#> # random effects, conditional component
#> 
#>  Parameter Median  Mean   MAP
#>  persons 1  -1.32 -1.23 -1.40
#>  persons 2  -0.38 -0.26 -0.54
#>  persons 3   0.31  0.44  0.14
#>  persons 4   1.21  1.33  1.03

point_estimate(m1, centrality = "all", effects = "all", component = "all")
#> # Point Estimates
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter Median  Mean   MAP
#>  Intercept   1.32  1.19  1.45
#>      child  -1.16 -1.16 -1.18
#>     camper   0.73  0.73  0.74
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter Median  Mean   MAP
#>  Intercept  -0.78 -0.73 -0.89
#>      child   1.89  1.88  1.91
#>     camper  -0.84 -0.84 -0.78
#> 
#> # random effects, conditional component
#> 
#>  Parameter Median  Mean   MAP
#>  persons 1  -1.32 -1.23 -1.40
#>  persons 2  -0.38 -0.26 -0.54
#>  persons 3   0.31  0.44  0.14
#>  persons 4   1.21  1.33  1.03
#> 
#> # random effects, zero-inflation component
#> 
#>  Parameter Median  Mean   MAP
#>  persons 1   1.35  1.32  1.37
#>  persons 2   0.38  0.36  0.51
#>  persons 3  -0.12 -0.14 -0.10
#>  persons 4  -1.17 -1.27 -1.02

# point_estimate, rstanarm-model---------------

point_estimate(m2)
#> # Point Estimates
#> 
#>    Parameter Median
#>  (Intercept)   9.33
#>           wt   0.76
#>          cyl  -1.99

point_estimate(m2, centrality = "all", effects = "all")
#> # Point Estimates
#> 
#>    Parameter Median  Mean   MAP
#>  (Intercept)   9.33  9.64  9.04
#>           wt   0.76  0.71  0.97
#>          cyl  -1.99 -2.02 -1.98

point_estimate(m2, centrality = "all", effects = "all", component = "all")
#> # Point Estimates
#> 
#>    Parameter Median  Mean   MAP
#>  (Intercept)   9.33  9.64  9.04
#>           wt   0.76  0.71  0.97
#>          cyl  -1.99 -2.02 -1.98

# point_estimate, rstanarm-model---------------

point_estimate(m3)
#> # Point Estimates
#> 
#>    Parameter  Median
#>  (Intercept) -1.4979
#>         size  0.0045
#>      period2 -0.9709
#>      period3 -1.1121
#>      period4 -1.6221

point_estimate(m3, centrality = "all", effects = "all")
#> # Point Estimates
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter  Median    Mean     MAP
#>  (Intercept) -1.4979 -1.5332 -1.2845
#>         size  0.0045  0.0064  0.0035
#>      period2 -0.9709 -0.9869 -0.9355
#>      period3 -1.1121 -1.1209 -1.1829
#>      period4 -1.6221 -1.6192 -1.6228
#> 
#> # random effects, conditional component
#> 
#>  Parameter Median   Mean    MAP
#>     herd:1  0.586  0.604  0.582
#>     herd:2 -0.374 -0.400 -0.182
#>     herd:3  0.376  0.400  0.308
#>     herd:4  0.036  0.021  0.078
#>     herd:5 -0.263 -0.287 -0.110
#>     herd:6 -0.439 -0.471 -0.358
#>     herd:7  0.887  0.920  0.861
#>     herd:8  0.523  0.515  0.530
#>     herd:9 -0.184 -0.246 -0.055
#>    herd:10 -0.631 -0.639 -0.562
#>    herd:11 -0.134 -0.137 -0.154
#>    herd:12 -0.051 -0.085  0.108
#>    herd:13 -0.786 -0.806 -0.742
#>    herd:14  0.973  1.019  0.871
#>    herd:15 -0.560 -0.601 -0.472

point_estimate(m3, centrality = "all", effects = "all", component = "all")
#> # Point Estimates
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter  Median    Mean     MAP
#>  (Intercept) -1.4979 -1.5332 -1.2845
#>         size  0.0045  0.0064  0.0035
#>      period2 -0.9709 -0.9869 -0.9355
#>      period3 -1.1121 -1.1209 -1.1829
#>      period4 -1.6221 -1.6192 -1.6228
#> 
#> # random effects, conditional component
#> 
#>  Parameter Median   Mean    MAP
#>     herd:1  0.586  0.604  0.582
#>     herd:2 -0.374 -0.400 -0.182
#>     herd:3  0.376  0.400  0.308
#>     herd:4  0.036  0.021  0.078
#>     herd:5 -0.263 -0.287 -0.110
#>     herd:6 -0.439 -0.471 -0.358
#>     herd:7  0.887  0.920  0.861
#>     herd:8  0.523  0.515  0.530
#>     herd:9 -0.184 -0.246 -0.055
#>    herd:10 -0.631 -0.639 -0.562
#>    herd:11 -0.134 -0.137 -0.154
#>    herd:12 -0.051 -0.085  0.108
#>    herd:13 -0.786 -0.806 -0.742
#>    herd:14  0.973  1.019  0.871
#>    herd:15 -0.560 -0.601 -0.472

# p_map, brms-model ---------------

p_map(m1)
#> # MAP-based p-value
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000

p_map(m1, effects = "all")
#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000
#> 
#> # random effects, conditional component
#> 
#>  Parameter  p_MAP
#>  persons 1 0.2119
#>  persons 2 0.6509
#>  persons 3 0.9571
#>  persons 4 0.0854

p_map(m1, effects = "all", component = "all")
#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter p_MAP
#>  Intercept 0.212
#>      child 0.000
#>     camper 0.000
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter  p_MAP
#>  Intercept 0.4869
#>      child 0.0000
#>     camper 0.0574
#> 
#> # random effects, conditional component
#> 
#>  Parameter  p_MAP
#>  persons 1 0.2119
#>  persons 2 0.6509
#>  persons 3 0.9571
#>  persons 4 0.0854
#> 
#> # random effects, zero-inflation component
#> 
#>  Parameter p_MAP
#>  persons 1 0.181
#>  persons 2 0.802
#>  persons 3 0.984
#>  persons 4 0.166

# p_map, rstanarm-model---------------

p_map(m2)
#> # MAP-based p-value
#> 
#>    Parameter p_MAP
#>  (Intercept) 0.000
#>           wt 0.698
#>          cyl 0.000

p_map(m2, effects = "all")
#> # MAP-based p-value
#> 
#>    Parameter p_MAP
#>  (Intercept) 0.000
#>           wt 0.698
#>          cyl 0.000

p_map(m2, effects = "all", component = "all")
#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded
#> # MAP-based p-value
#> 
#>    Parameter p_MAP
#>  (Intercept) 0.000
#>           wt 0.698
#>          cyl 0.000

# p_map, rstanarm-model---------------

p_map(m3)
#> # MAP-based p-value
#> 
#>    Parameter  p_MAP
#>  (Intercept) 0.0476
#>         size 0.9907
#>      period2 0.0000
#>      period3 0.0000
#>      period4 0.0000

p_map(m3, effects = "all")
#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter  p_MAP
#>  (Intercept) 0.0476
#>         size 0.9907
#>      period2 0.0000
#>      period3 0.0000
#>      period4 0.0000
#> 
#> # random effects, conditional component
#> 
#>  Parameter p_MAP
#>     herd:1 0.424
#>     herd:2 0.818
#>     herd:3 0.507
#>     herd:4 0.990
#>     herd:5 0.949
#>     herd:6 0.619
#>     herd:7 0.104
#>     herd:8 0.572
#>     herd:9 0.994
#>    herd:10 0.449
#>    herd:11 0.950
#>    herd:12 0.956
#>    herd:13 0.284
#>    herd:14 0.107
#>    herd:15 0.588

p_map(m3, effects = "all", component = "all")
#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded

#> Warning: In density.default(x, n = precision, bw = bw, from = x_range[1], 
#>     to = x_range[2], ...) :
#>  extra argument 'component' will be disregarded
#> # MAP-based p-value
#> 
#> # fixed effects, conditional component
#> 
#>    Parameter  p_MAP
#>  (Intercept) 0.0476
#>         size 0.9907
#>      period2 0.0000
#>      period3 0.0000
#>      period4 0.0000
#> 
#> # random effects, conditional component
#> 
#>  Parameter p_MAP
#>     herd:1 0.424
#>     herd:2 0.818
#>     herd:3 0.507
#>     herd:4 0.990
#>     herd:5 0.949
#>     herd:6 0.619
#>     herd:7 0.104
#>     herd:8 0.572
#>     herd:9 0.994
#>    herd:10 0.449
#>    herd:11 0.950
#>    herd:12 0.956
#>    herd:13 0.284
#>    herd:14 0.107
#>    herd:15 0.588

# describe_posterior, brms-model ---------------

describe_posterior(m1)
#> # Description of Posterior Distributions
#> 
#>  Parameter Median CI  CI_low CI_high   pd ROPE_CI ROPE_low ROPE_high
#>  Intercept  1.319 89  0.0495   2.275 0.94      89     -0.1       0.1
#>      child -1.162 89 -1.3201  -0.980 1.00      89     -0.1       0.1
#>     camper  0.727 89  0.5875   0.858 1.00      89     -0.1       0.1
#>  ROPE_Percentage ESS  Rhat
#>           0.0223  78 1.005
#>           0.0000 172 0.996
#>           0.0000 233 0.996

describe_posterior(m1, effects = "all")
#> # Description of Posterior Distributions
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter Median CI  CI_low CI_high   pd ROPE_CI ROPE_low ROPE_high
#>  Intercept  1.319 89  0.0495   2.275 0.94      89     -0.1       0.1
#>      child -1.162 89 -1.3201  -0.980 1.00      89     -0.1       0.1
#>     camper  0.727 89  0.5875   0.858 1.00      89     -0.1       0.1
#>  ROPE_Percentage ESS  Rhat
#>           0.0223  78 1.005
#>           0.0000 172 0.996
#>           0.0000 233 0.996
#> 
#> # random effects, conditional component
#> 
#>  Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  persons 1 -1.315 89 -2.555 -0.0314 0.940      89     -0.1       0.1
#>  persons 2 -0.380 89 -1.451  1.0085 0.660      89     -0.1       0.1
#>  persons 3  0.307 89 -0.728  1.5882 0.708      89     -0.1       0.1
#>  persons 4  1.207 89  0.290  2.5374 0.960      89     -0.1       0.1
#>  ROPE_Percentage ESS Rhat
#>           0.0179  80 1.00
#>           0.0848  78 1.01
#>           0.1205  77 1.00
#>           0.0000  78 1.00

describe_posterior(m1, effects = "all", component = "all")
#> # Description of Posterior Distributions
#> 
#> # fixed effects, conditional component
#> 
#>  Parameter Median CI  CI_low CI_high   pd ROPE_CI ROPE_low ROPE_high
#>  Intercept  1.319 89  0.0495   2.275 0.94      89     -0.1       0.1
#>      child -1.162 89 -1.3201  -0.980 1.00      89     -0.1       0.1
#>     camper  0.727 89  0.5875   0.858 1.00      89     -0.1       0.1
#>  ROPE_Percentage ESS  Rhat
#>           0.0223  78 1.005
#>           0.0000 172 0.996
#>           0.0000 233 0.996
#> 
#> # fixed effects, zero-inflation component
#> 
#>  Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  Intercept -0.778 89  -1.89   0.218 0.876      89     -0.1       0.1
#>      child  1.888 89   1.30   2.304 1.000      89     -0.1       0.1
#>     camper -0.840 89  -1.34  -0.231 0.992      89     -0.1       0.1
#>  ROPE_Percentage ESS  Rhat
#>           0.0625  92 1.004
#>           0.0000  72 1.015
#>           0.0000 182 0.998
#> 
#> # random effects, conditional component
#> 
#>  Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  persons 1 -1.315 89 -2.555 -0.0314 0.940      89     -0.1       0.1
#>  persons 2 -0.380 89 -1.451  1.0085 0.660      89     -0.1       0.1
#>  persons 3  0.307 89 -0.728  1.5882 0.708      89     -0.1       0.1
#>  persons 4  1.207 89  0.290  2.5374 0.960      89     -0.1       0.1
#>  ROPE_Percentage ESS Rhat
#>           0.0179  80 1.00
#>           0.0848  78 1.01
#>           0.1205  77 1.00
#>           0.0000  78 1.00
#> 
#> # random effects, zero-inflation component
#> 
#>  Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  persons 1  1.355 89  0.368  2.6592 0.956      89     -0.1       0.1
#>  persons 2  0.382 89 -0.726  1.4880 0.724      89     -0.1       0.1
#>  persons 3 -0.117 89 -1.162  1.1283 0.580      89     -0.1       0.1
#>  persons 4 -1.166 89 -2.462 -0.0609 0.972      89     -0.1       0.1
#>  ROPE_Percentage ESS  Rhat
#>           0.0000  91 1.005
#>           0.1205  99 1.000
#>           0.1429  94 0.997
#>           0.0134 113 0.997

# describe_posterior, rstanarm-model---------------

describe_posterior(m2)
#> Possible multicollinearity between cyl and wt (r = 0.7). This might lead to inappropriate results. See 'Details' in '?rope'.
#> # Description of Posterior Distributions
#> 
#>    Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  (Intercept)  9.333 89  5.243  14.263 1.000      89   -0.181     0.181
#>           wt  0.759 89 -0.891   2.319 0.768      89   -0.181     0.181
#>          cyl -1.985 89 -3.032  -0.907 1.000      89   -0.181     0.181
#>  ROPE_Percentage  ESS Rhat Prior_Distribution Prior_Location Prior_Scale
#>            0.000 2678    1             normal              0       10.00
#>            0.111 1745    1             normal              0        2.56
#>            0.000 1871    1             normal              0        1.40

describe_posterior(m2, effects = "all")
#> Possible multicollinearity between cyl and wt (r = 0.7). This might lead to inappropriate results. See 'Details' in '?rope'.
#> # Description of Posterior Distributions
#> 
#>    Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  (Intercept)  9.333 89  5.243  14.263 1.000      89   -0.181     0.181
#>           wt  0.759 89 -0.891   2.319 0.768      89   -0.181     0.181
#>          cyl -1.985 89 -3.032  -0.907 1.000      89   -0.181     0.181
#>  ROPE_Percentage  ESS Rhat Prior_Distribution Prior_Location Prior_Scale
#>            0.000 2678    1             normal              0       10.00
#>            0.111 1745    1             normal              0        2.56
#>            0.000 1871    1             normal              0        1.40

describe_posterior(m2, effects = "all", component = "all")
#> Possible multicollinearity between cyl and wt (r = 0.7). This might lead to inappropriate results. See 'Details' in '?rope'.
#> # Description of Posterior Distributions
#> 
#>    Parameter Median CI CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  (Intercept)  9.333 89  5.243  14.263 1.000      89   -0.181     0.181
#>           wt  0.759 89 -0.891   2.319 0.768      89   -0.181     0.181
#>          cyl -1.985 89 -3.032  -0.907 1.000      89   -0.181     0.181
#>  ROPE_Percentage  ESS Rhat Prior_Distribution Prior_Location Prior_Scale
#>            0.000 2678    1             normal              0       10.00
#>            0.111 1745    1             normal              0        2.56
#>            0.000 1871    1             normal              0        1.40

# describe_posterior, rstanarm-model---------------

describe_posterior(m3)
#> # Description of Posterior Distributions
#> 
#>    Parameter   Median CI  CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  (Intercept) -1.49792 89 -2.4521 -0.5200 0.994      89   -0.181     0.181
#>         size  0.00452 89 -0.0409  0.0478 0.582      89   -0.181     0.181
#>      period2 -0.97091 89 -1.4971 -0.5142 1.000      89   -0.181     0.181
#>      period3 -1.11212 89 -1.7238 -0.6297 1.000      89   -0.181     0.181
#>      period4 -1.62208 89 -2.2674 -0.8655 1.000      89   -0.181     0.181
#>  ROPE_Percentage ESS  Rhat Prior_Distribution Prior_Location Prior_Scale
#>                0 201 1.008             normal              0        10.0
#>                1 282 1.004             normal              0         2.5
#>                0 537 0.999             normal              0         2.5
#>                0 648 1.000             normal              0         2.5
#>                0 537 0.997             normal              0         2.5

describe_posterior(m3, effects = "all")
#> # Description of Posterior Distributions
#> 
#>    Parameter   Median CI  CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  (Intercept) -1.49792 89 -2.4521 -0.5200 0.994      89   -0.181     0.181
#>         size  0.00452 89 -0.0409  0.0478 0.582      89   -0.181     0.181
#>      period2 -0.97091 89 -1.4971 -0.5142 1.000      89   -0.181     0.181
#>      period3 -1.11212 89 -1.7238 -0.6297 1.000      89   -0.181     0.181
#>      period4 -1.62208 89 -2.2674 -0.8655 1.000      89   -0.181     0.181
#>  ROPE_Percentage ESS  Rhat Prior_Distribution Prior_Location Prior_Scale
#>                0 201 1.008             normal              0        10.0
#>                1 282 1.004             normal              0         2.5
#>                0 537 0.999             normal              0         2.5
#>                0 648 1.000             normal              0         2.5
#>                0 537 0.997             normal              0         2.5

describe_posterior(m3, effects = "all", component = "all")
#> # Description of Posterior Distributions
#> 
#>    Parameter   Median CI  CI_low CI_high    pd ROPE_CI ROPE_low ROPE_high
#>  (Intercept) -1.49792 89 -2.4521 -0.5200 0.994      89   -0.181     0.181
#>         size  0.00452 89 -0.0409  0.0478 0.582      89   -0.181     0.181
#>      period2 -0.97091 89 -1.4971 -0.5142 1.000      89   -0.181     0.181
#>      period3 -1.11212 89 -1.7238 -0.6297 1.000      89   -0.181     0.181
#>      period4 -1.62208 89 -2.2674 -0.8655 1.000      89   -0.181     0.181
#>  ROPE_Percentage ESS  Rhat Prior_Distribution Prior_Location Prior_Scale
#>                0 201 1.008             normal              0        10.0
#>                1 282 1.004             normal              0         2.5
#>                0 537 0.999             normal              0         2.5
#>                0 648 1.000             normal              0         2.5
#>                0 537 0.997             normal              0         2.5

# bayesfactor_parameters, brms-model ---------------

bayesfactor_parameters(m1, m1)
#> Loading required namespace: logspline
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  b_Intercept            1   fixed conditional
#>      b_child            1   fixed conditional
#>     b_camper            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m1, m1, effects = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>               Parameter Bayes Factor Effects   Component
#>             b_Intercept            1   fixed conditional
#>                 b_child            1   fixed conditional
#>                b_camper            1   fixed conditional
#>  r_persons.1.Intercept.            1  random conditional
#>  r_persons.2.Intercept.            1  random conditional
#>  r_persons.3.Intercept.            1  random conditional
#>  r_persons.4.Intercept.            1  random conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m1, m1, effects = "all", component = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>                   Parameter Bayes Factor Effects     Component
#>                 b_Intercept            1   fixed   conditional
#>                     b_child            1   fixed   conditional
#>                    b_camper            1   fixed   conditional
#>      r_persons.1.Intercept.            1  random   conditional
#>      r_persons.2.Intercept.            1  random   conditional
#>      r_persons.3.Intercept.            1  random   conditional
#>      r_persons.4.Intercept.            1  random   conditional
#>              b_zi_Intercept            1   fixed zero_inflated
#>                  b_zi_child            1   fixed zero_inflated
#>                 b_zi_camper            1   fixed zero_inflated
#>  r_persons__zi.1.Intercept.            1  random zero_inflated
#>  r_persons__zi.2.Intercept.            1  random zero_inflated
#>  r_persons__zi.3.Intercept.            1  random zero_inflated
#>  r_persons__zi.4.Intercept.            1  random zero_inflated
#> 
#> * Evidence Against The Null: [0]

# bayesfactor_parameters, rstanarm-model---------------

bayesfactor_parameters(m2, m2)
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>           wt            1   fixed conditional
#>          cyl            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m2, m2, effects = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>           wt            1   fixed conditional
#>          cyl            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m2, m2, effects = "all", component = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>           wt            1   fixed conditional
#>          cyl            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

# bayesfactor_parameters, rstanarm-model---------------

bayesfactor_parameters(m3, m3)
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>    Parameter Bayes Factor Effects   Component
#>  (Intercept)            1   fixed conditional
#>         size            1   fixed conditional
#>      period2            1   fixed conditional
#>      period3            1   fixed conditional
#>      period4            1   fixed conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m3, m3, effects = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>               Parameter Bayes Factor Effects   Component
#>             (Intercept)            1   fixed conditional
#>                    size            1   fixed conditional
#>                 period2            1   fixed conditional
#>                 period3            1   fixed conditional
#>                 period4            1   fixed conditional
#>   b[(Intercept) herd:1]            1  random conditional
#>   b[(Intercept) herd:2]            1  random conditional
#>   b[(Intercept) herd:3]            1  random conditional
#>   b[(Intercept) herd:4]            1  random conditional
#>   b[(Intercept) herd:5]            1  random conditional
#>   b[(Intercept) herd:6]            1  random conditional
#>   b[(Intercept) herd:7]            1  random conditional
#>   b[(Intercept) herd:8]            1  random conditional
#>   b[(Intercept) herd:9]            1  random conditional
#>  b[(Intercept) herd:10]            1  random conditional
#>  b[(Intercept) herd:11]            1  random conditional
#>  b[(Intercept) herd:12]            1  random conditional
#>  b[(Intercept) herd:13]            1  random conditional
#>  b[(Intercept) herd:14]            1  random conditional
#>  b[(Intercept) herd:15]            1  random conditional
#> 
#> * Evidence Against The Null: [0]

bayesfactor_parameters(m3, m3, effects = "all", component = "all")
#> # Bayes Factor (Savage-Dickey density ratio)
#> 
#>               Parameter Bayes Factor Effects   Component
#>             (Intercept)            1   fixed conditional
#>                    size            1   fixed conditional
#>                 period2            1   fixed conditional
#>                 period3            1   fixed conditional
#>                 period4            1   fixed conditional
#>   b[(Intercept) herd:1]            1  random conditional
#>   b[(Intercept) herd:2]            1  random conditional
#>   b[(Intercept) herd:3]            1  random conditional
#>   b[(Intercept) herd:4]            1  random conditional
#>   b[(Intercept) herd:5]            1  random conditional
#>   b[(Intercept) herd:6]            1  random conditional
#>   b[(Intercept) herd:7]            1  random conditional
#>   b[(Intercept) herd:8]            1  random conditional
#>   b[(Intercept) herd:9]            1  random conditional
#>  b[(Intercept) herd:10]            1  random conditional
#>  b[(Intercept) herd:11]            1  random conditional
#>  b[(Intercept) herd:12]            1  random conditional
#>  b[(Intercept) herd:13]            1  random conditional
#>  b[(Intercept) herd:14]            1  random conditional
#>  b[(Intercept) herd:15]            1  random conditional
#> 
#> * Evidence Against The Null: [0]

Created on 2019-09-11 by the reprex package (v0.3.0)