data("dataMultilevelIV")
# Two levels
res.ml.L2 <- multilevelIV(y ~ X11 + X12 + X13 + X14 + X15 + X21 + X22 + X23 + X24 + X31 +
X32 + X33 + (1|SID) | endo(X15),
data = dataMultilevelIV, verbose = FALSE)
predict(res.ml.L2, model = "FE_L2")
# using the data used for fitting also for predicting,
# correctly results in fitted values
all.equal(predict(res.ml.L2, dataMultilevelIV, model = "GMM_L2"),
fitted(res.ml.L2, model = "GMM_L2")) # TRUE
Run the code above in your browser using DataLab