Hi
I am using SAS Enterprise Miner. I have a column "Gender" which has Male and Female. I just wanted to create dummy variable in Miner.
Want to assign Male =1 and Female = 0
I can create in SAS guide using Proc class function. But I do not know how to create in SAS Enterprise Miner. Please advise
Regards,
Dhiip
You can do this using a Code Node
I'm not sure if there is an easier way.
data have;
input id gender $8.;
cards;
1 Female
2 female
3 male
4 f
5 Male
6 mAle
7 eddy
;
data want;
set have;
if upcase(substr(gender,1,1))="F" then my_val = 0;
else if upcase(substr(gender,1,1))="M" then my_val = 1;
else my_val = .; /* catch the errors */
run;
In Enterprise Miner, use the Transform Variable node.
@PaigeMiller Thanks I will try with transform variables. I have one more issue with handling missing values in miner
I have a column Age which has 19% missing value. Also, it has a column name called travelled class. I need to assign mean in place of missing value according to the class. For example, If people travelled in the first class I then I need to assign 37. If it is the second class then it is 29 and 24 if people travelled in third class.
I tried to do in impute but it doesn't have an option to fill three values in the 'Age' column. Any suggestion about how to do this?
You can do this using a Code Node
I'm not sure if there is an easier way.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.