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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.