data_stack_dirich_formula
prepares the data using inla.stack from the package INLA.
Author
Joaquín Martínez-Minaya jomarminaya@gmail.com
Examples
n <- 100
d <- 4
V <- matrix(rnorm(4*n, 0, 1), ncol=4)
V <- as.data.frame(V)
names(V) <- c('v1', 'v2', 'v3', 'v4' )
covariates <- names(V)
formula <- y ~ 1 + v1 + v2 | 1 + v1 | 1 + v1
names_cat <- formula_list(formula)
data_stack_construct <- data_stack_dirich(y = as.vector(rep(NA, n*d)),
covariates = names_cat,
share = NULL,
data = V,
d = d,
n = n )