BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sdhilip
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
5 REPLIES 5
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13
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;
sdhilip
Quartz | Level 8

Hi @VDD 

 

Thanks. But how to create this code in SAS Enterprise miner?

 

sdhilip
Quartz | Level 8

@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?

 

 

PaigeMiller
Diamond | Level 26

You can do this using a Code Node

https://support.sas.com/documentation/cdl/en/emxndg/64759/HTML/default/viewer.htm#n1t582v60um7p9n1h9...

 

I'm not sure if there is an easier way.

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to choose a machine learning algorithm

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.

Discussion stats
  • 5 replies
  • 3854 views
  • 1 like
  • 3 in conversation