library(DImodels)
data(sim1)
# Fit DI models with different ID effect groupings
mod1 <- DI(y = "response", prop = 3:6,
data = sim1, DImodel = "AV") # No ID grouping
mod2 <- DI(y = "response", prop = 3:6,
data = sim1, DImodel = "AV",
ID = c("ID1", "ID1", "ID2", "ID2"))
mod3 <- DI(y = "response", prop = 3:6,
data = sim1, DImodel = "AV",
ID = c("ID1", "ID1", "ID1", "ID1"))
# Create new data for adding interaction terms
newdata <- sim1[sim1$block == 1, 3:6]
print(head(newdata))
add_ID_terms(data = newdata, model = mod1)
add_ID_terms(data = newdata, model = mod2)
add_ID_terms(data = newdata, model = mod3)
Run the code above in your browser using DataLab