BookmarkSubscribeRSS Feed
Keigo
Fluorite | Level 6

I used SAS Enterprise Miner to build a prediction model and now am applying it to score a new excel data where the numerical target variable is an empty column. I believe that the empty values cause the target variable to be recognized as categorical in the score data and I cannot select 'interval' as the role. How can I use the model to predict the numerical target variable in the score data? I already tried to change blanks to '.' in the excel file for SAS to take this column as numerical but it doesn't work.  

6 REPLIES 6
Keigo
Fluorite | Level 6

Thanks for the response. The variable with all missing values is not used to build the model. Instead, this empty  target variable is in a score data where the model is used for prediction. 

Kurt_Bremser
Super User

@Keigo wrote:

Thanks for the response. The variable with all missing values is not used to build the model. Instead, this empty  target variable is in a score data where the model is used for prediction. 


So it will be overwritten anyway, which means it can have any numeric value.

Using a file format (csv) where you have control over variable attributes is also an option.

ballardw
Super User

Since . would be a CHARACTER in EXCEL I doubt that would help.

 

Importing Excel directly means that you are at the mercy of the engines used to read from Excel. Excel has no concept of "variable" or column type per se. If the cells contain numbers, such as 0 you might be okay.

Or do some manipulation of the data set after import to create a numeric variable. If many of the character values are supposed to be numeric you might try a data step similar to:

data want;
   set have;
   newvar = input(problemvar, 32.);
run;

and see if using Newvar instead of the existing variable "works".

 

If you search or even just scan this forum you will see that problems with data starting in Excel, or going to Excel, is an extremely common problem.

 

 

 

Keigo
Fluorite | Level 6

Thank you for the code and I believe it will work. But I think there should be a solution without using SAS code in SAS Enterprise Miner. 

SAS enterprise miner has a score node that is used to connect model and score data for prediction purpose. It is a common procedure to score new data in SAS enterprise miner so it is very hard to believe no setting can be used to recognize the numerical target variable. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 993 views
  • 0 likes
  • 3 in conversation