# Load MCMC samples

files <- dir("models")
file <- files[grepl(x = files, pattern = "RDS$")]
filepath <- glue::glue("models/backup-mcmc/{file}")

informed_any <- readRDS(filepath[1])
noninformed_any <- readRDS(filepath[2])
informed_major <- readRDS(filepath[3])
noninformed_major <- readRDS(filepath[4])

Non Informed Model for Any-Amputation

# assign the model
model <- noninformed_any[[4]]

Effective Sample Size

The effective sample size and the effective sample size in comparison to the actual sample size.

summary(model) %>% 
  as.data.frame() %>% 
  as_tibble(rownames = "Predictors") %>% 
  select(Predictors, any_non = n_eff) %>% 
  slice(1:8) %>% 
  kable()
Predictors any_non
(Intercept) 26516
p 24728
e_ordinal_5 25087
d 26378
i 28326
s 32397
alter_bei_aufnahme 28275
gender 31458
neff_ratio(model) %>% kable()
x
(Intercept) 0.8838667
p 0.8242667
e_ordinal_5 0.8362333
d 0.8792667
i 0.9442000
s 1.0799000
alter_bei_aufnahme 0.9425000
gender 1.0486000

Autorcorrelation in the MCMC chains

Autocorrelation shown with lag plots and trace plots

mcmc_acf(as.matrix(model), lags = 10)

style <- trace_style_np(div_alpha = .1, div_size = 0.01)

mcmc_trace(as.array(model),
                n_warmup = 500,
                np_style = style)