# Mixed response model
loading_matrix <- matrix(c(1, NA), ncol = 1)
families <- c(gaussian, binomial)
family_mapping <- ifelse(mresp$itemgroup == "a", 1, 2)
mixed_resp <- galamm(
formula = y ~ x + (0 + level | id),
data = mresp,
family = families,
family_mapping = family_mapping,
load.var = "itemgroup",
lambda = loading_matrix,
factor = "level"
)
# This model has two family objects
family(mixed_resp)
Run the code above in your browser using DataLab