06-08-2017 09:41 AM
I am trying to implement the K-means Clustering algorithm. I imported the data set(CREDIT) to sas , replaced the missing values (NA) with 0 of the variable that i need ( MonthlyIncome ) but variable have the character data type. But when i try to convert this variable to numeric to do the Scaling process with the following code the log is showing the following errors. please help me..
error 1: Found " Monthly_Income" when expecting " ;"
error2: Statement "Monthly_Income" is not valid;
Proc standerd data=CREDIT mean=0 std=1;
var age MonthlyIncome debtratio etc...............;
Var Monthly_Inc=(MonthlyIncome, best12.);
06-08-2017 11:14 AM
Data step..? you mean..? at the time of importing the data set to sas.? or change the type directly.?
Best would be to insure that the data was read into SAS as a numeric.
If that isn't practical for some reason you can use a data step to change:
set have (rename=(income=textincome));
income = input(textincome,best10.);
/* assign format or labels as desired*/
the rename is so you could use the same varaible name as you cannot change sas data types directly.