I would like to create a function for the effect on a multinomial model. The Effect function requires a string with the predictor name and the predictor itself. I have tried different ways to convert the argument into a string, but I get the same error: "the following predictor is not in the model: activity" when calling for minmax(activity,model1). But it is. What am I doing wrong?
# effects when minimum und maximum ####
# minmax function
minmax <- function(x1,m){
Effect(paste0('"',deparse(substitute(x1)),'"'),m,xlevels=list(x=c(min(x1),max(x1)) ))
}