extract_posterior_effect {makemyprior}R Documentation

Extract the posterior of a random effect

Description

Extract the posterior of a random effect in the model for inference done with Stan

Usage

extract_posterior_effect(obj, effname)

Arguments

obj

An object from inference_stan.

effname

Name of the random effect, same name as in the data.

Value

Returns a matrix with the posterior samples of the chosen effect

Examples


if (interactive() && requireNamespace("rstan")){
  ex_prior <- makemyprior_example_model()
  res_stan <- inference_stan(ex_prior, iter = 100)
  # Note: For reliable results, increase the number of iterations (e.g., 'iter = 2000')
  extract_posterior_effect(res_stan, "a")
}


[Package makemyprior version 1.2.1 Index]