Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
[Solved] Converting Numerical Values to Binomial
neilduggan
Member Posts: 18 Contributor II
Hi
Very new user here so apologies if this questions seems dumb!!
I have some survey data with answers to each question as follows:
Yes = 1
No = 2
Undecided = 3
Refused to answer = 4
etc
I want to remove all values not equal to 1 or 2 or set it to "N/A" and then set values = 1 to "True" and set values = 2 to "False"
At the moment, I'm using "Generate Attributes" to create new attributes called "answer_yes" (answer==1) and "answer_no" (answer==2)
I presume there is a much better way to do this?? Or is this way as simple as any??
Any help appreciated :-)
Thanks
Neil
Very new user here so apologies if this questions seems dumb!!
I have some survey data with answers to each question as follows:
Yes = 1
No = 2
Undecided = 3
Refused to answer = 4
etc
I want to remove all values not equal to 1 or 2 or set it to "N/A" and then set values = 1 to "True" and set values = 2 to "False"
At the moment, I'm using "Generate Attributes" to create new attributes called "answer_yes" (answer==1) and "answer_no" (answer==2)
I presume there is a much better way to do this?? Or is this way as simple as any??
Any help appreciated :-)
Thanks
Neil
0
Answers
does each row only contain the answer to a single question? Is the anwer column nominal? f so, you can use the Filter Examples operator to get ride of rows where the value is not 1 or 2. Then you can use Generate Attributes (on the very same answer column, the operator can overwrite existing values) with this expression: otherwise you can do Regards,
Marco
Thanks for your reponse Marco.
Each row contains the answer the multiple questions (i.e. each column is a question and each row is a respondent)
Each answer is nominal (i.e. 1, 2, 3, 4, etc) although is viewed by RapidMiner as numerical.
I'll have a try when I get home and let you know how I got on
Thanks