0

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))    ))
}
Regina
  • 1
  • http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – shayaa Jul 26 '16 at 07:56
  • I found a solution, different from the linked solution: [code] (as.character(deparse(substitute(x1)))) – Regina Jul 26 '16 at 08:10

0 Answers0