glreg: Create a model object for group-level regression effects...

View source: R/mc_gl.R

glregR Documentation

Create a model object for group-level regression effects within a generic random effects component.

Description

This function is intended to be used to specify the formula.gl argument to the gen model component specification function. Group-level predictors and hierarchical centering are not used by default, and they currently cannot be used in a model component that is sampled together with another model component in the same Gibbs block.

Usage

glreg(
  formula = NULL,
  remove.redundant = FALSE,
  prior = NULL,
  Q0 = NULL,
  data = NULL,
  name = ""
)

Arguments

formula

a formula specifying the group-level predictors to be used within a model component. If no data is supplied the group-level predictors are derived as group-level means from the unit-level data passed as data argument to create_sampler or generate_data.

remove.redundant

whether redundant columns should be removed from the design matrix. Default is FALSE.

prior

prior specification for the group-level effects. Currently only normal priors with mean 0 can be specified, using function pr_normal.

Q0

prior precision matrix for the group-level effects. The default is a zero matrix corresponding to a noninformative improper prior. DEPRECATED, please use argument prior instead, i.e. prior = pr_normal(precision = Q0.value).

data

group-level data frame in which the group-level variables specified in formula are looked up.

name

the name of the model component. This name is used in the output of the MCMC simulation function MCMCsim. By default this name will be the name of the corresponding generic random effects component appended by '_gl'.

Value

An object with precomputed quantities for sampling from prior or conditional posterior distributions for this model component. Only intended for internal use by other package functions.


mcmcsae documentation built on Oct. 11, 2023, 1:06 a.m.