0

I am trying to write a code in R to be incorporated in Alteryx. part of the code is

for(var in names(df2)) { 
df1[[paste0('updown_', var)]] <- ifelse((df1[[var]] * 
         coef(summary(mjlogit))[var,"Estimate"])>0, "up", 
         (ifelse((df1[[var]] * coef(summary(mjlogit))[var,"Estimate"])==0, 
                 "zero", "down")))
}

In this I am defining up and down variables to be further used in Model.

and the error I am getting is

Error in coef(summary(mjlogit))[var, "Estimate"] : subscript out of bounds Calls: ifelse

Help will be highly appreciated

user20650
  • 24,654
  • 5
  • 56
  • 91
Pooja
  • 1
  • 3
    Could you please edit your question with the libraries that you are using and also some of your data? – erasmortg Aug 07 '15 at 12:26
  • 2
    Please see [how to create a reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – MrFlick Aug 07 '15 at 13:21

0 Answers0