I would like to do feature selection with a mixed effect model in R, but I cannot manage to combine the function rfe
of the package caret with the function me of the package nlme
.
Here is a example that works but does not use a mixed effect model:
data(iris)
names(iris) <- c("A", "B", "C", "D") # change names for compatibility
library(caret)
library(nlme)
rfeRes <- rfe(x = iris[c("B", "C", "D")],
y = iris[["A"]],
rfeControl = rfeControl(functions = lmFuncs)
)
And here is an outline of what I would like to do:
rfeRes <- rfe(x = iris[c("B", "C", "D")],
y = iris[["A"]],
rfeControl = rfeControl(functions = lme)
)
Do you have an idea if something like that is possible and how to do it?