0

Is there a way to automate the process of categorizing like the function cut does when using sm.binning? https://i.stack.imgur.com/nwb5s.jpg

basically I want to have a new variable somehow that automatically puts it into the right category without right a bunch of nested ifelse statements.

Thanks!!

aman1230
  • 101
  • 3
  • Its a bit unclear what you are asking. It would be helpful if you could post a minimal example of what you are trying to accomplish https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – gfgm Apr 16 '18 at 21:40
  • Sorry. In the above image, ivtable shows that fare should be organized into 4 categories. Is there a way to automatically create a new variable to automatically assign these categories to fare? Like basically if the fare is 7.25, have a variable called Fare1 maybe and assign something like the letter "A" or "<10.1435" and if Fare is 43 then assign "B" or "<73.5" or something along those lines. Does smbinning come with these capabilities and if not, do you have any advice on how I can proceed? I'm using the titantic data set as a dummy set to experiment. The real dataset has 1000's of variables – aman1230 Apr 17 '18 at 23:50

0 Answers0