re_model: Fit the Normal Theory Random Effects Model

Description Usage Arguments Value

View source: R/fn_random_effects.R

Description

Fits the random effects model using standard Gibbs Sampling μ ~ N(μ_0, σ^2_0); τ^2 ~ IG(α_t, β_t) θ_j~N(μ, τ^2), j = 1,2,...,J; σ^2~IG(α_s, β_s), y_{ij}~N(θ_j), σ^2), i = 1,2,...,n_j

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
re_model(
  Y,
  mu_0,
  sigma2_0,
  alpha_t,
  beta_t,
  alpha_s,
  beta_s,
  nkeep = 1000,
  nburn = 1000
)

Arguments

Y

list; jth element is a vector of the y_ij

mu_0, sigma2_0

prior mean and variance for μ

alpha_t, beta_t

prior shape and scale for τ^2

alpha_s, beta_s

prior shape and scale for σ^2

nkeep

number of iterations to keep

nburn

number of iterations to toss

Value

list with mcmc sample and mean fitted values


jrlewi/brlm documentation built on March 17, 2021, 1:10 a.m.