rae: Defining random effects in DDPstar formulae

View source: R/DDPstar.rae.R

raeR Documentation

Defining random effects in DDPstar formulae

Description

Auxiliary function used to define random effects terms in a DDPstar model formula.

Usage

rae(x, atau = 1, btau = 0.005)

Arguments

x

the x-variable (factor) that defines the random effects term.

atau

A numeric value. Hyperparameter; shape parameter of the gamma prior distribution for the precision (inverse variance) of the random effect term. The default is 1.

btau

A numeric value. Hyperparameter; rate parameter of the gamma prior distribution for the precision (inverse variance) of the random effect term. The default is 0.005.

Details

The functions is designed to represent random effects in DDPstar formulae.

Value

The function is interpreted in the formula of a DDPstar model and creates the right framework for fitting the random effect. List containing the following elements:

vars

name of the covariate involved.

atau

shape parameter of the gamma prior distribution

btau

rate parameter of the gamma prior distribution

References

Rodriguez-Alvarez, M. X, Inacio, V. and Klein N. (2025). Density regression via Dirichlet process mixtures of normal structured additive regression models. Accepted for publication in Statistics and Computing (DOI: 10.1007/s11222-025-10567-0).

See Also

f, DDPstar

Examples

# For an example including random effects, we refer to Rodriguez-Alvarez, Inacio et al. (2025) 
# and associated codes (found in https://bitbucket.org/mxrodriguez/ddpstar)

DDPstar documentation built on April 3, 2025, 8:46 p.m.