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

Hi everyone!

 

I am using SAS miner workstation.

I need to extract the residuals of a regression model and feed them into a new model. Is it possible?

 

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
The dataset should exist in your work library, you now have the name. You should be able to use it as any other table.

View solution in original post

18 REPLIES 18
Reeza
Super User
Yes it's possible. There's usually an option to create an output data set and that should have the predicted values and residuals or you could score the data in another node again to get the predicted vs residuals and then pipe that into your next step.
FeliciaFung
Calcite | Level 5

Thanks for answering. But I could not find the option which can create the output data set of residuals?

Reeza
Super User
Try the scoring option then? I'm very surprised it wouldn't be in the default output data set. What variables are in that data set?
FeliciaFung
Calcite | Level 5
Those are financial data such as CAR and turnovers
FeliciaFung
Calcite | Level 5
And I would like to ask how to obtain output data set?
Reeza
Super User

Residuals are listed as included in the output data set from the documentation:

https://documentation.sas.com/?docsetId=emref&docsetTarget=n1jqzz8cssr9m2n1ktx2iyv87q56.htm&docsetVe...

 

The Regression node must run before you can view the Regression node output data sets. After a successful run, ensure that the Regression node is selected in the Diagram Workspace, then select the Ellipses Selector Buttonbutton to the right of the Exported Data property. This opens the Exported Data — Regression window, which lists the data sets that the Regression node outputs.
Two types of data sets are output from the Regression node:
  • Scored Data Sets — are the scored training, validation, and test data set that contains original inputs and scores (prediction, residuals, classification results, and so on).
    Here is a list of the name prefixes of the scores in the scored data sets:
    • BL_ or BP_ — best possible profit or loss for any of the decisions
    • CL_ or CP_ — profit or loss that is computed from the target value
    • D_ — level of the decision that is chosen by the model
    • E_ — error function
    • EL_ or EP_ — expected profit or loss that is chosen by the model
    • F_ — normalized category that the case comes from
    • I_ — normalized category that the case is classified into
    • IC_ — investment cost
    • P_ — posterior probabilities for categorical targets or predicted values for interval targets
    • R_ — residuals
    • ROI_ — return on investment
    • U_ — un-normalized category that the case is classified into.
    When the model selection methods of forward, backward, or stepwise are applied, the Regression node automatically changes the model roles from input to rejected for variables that are not included in the regression model.
FeliciaFung
Calcite | Level 5
Thanks, I opened the exported data property after running the basic regression but the scored data are not in the default output data set. I will try to add the scored node between the regression and next model as you mentioned then.
Reeza
Super User
Are you saying you don't see a data set that has a variable named R_ in it?
FeliciaFung
Calcite | Level 5
Oh sorry I saw the variable residual but I am not able to extract it
FeliciaFung
Calcite | Level 5
which means to produce those residuals into a new dataset or to have it in the original dataset
Reeza
Super User
You can use a task on the output data set to filter/extract only columns of interest? Use the output dataset name as your input or add it to the process flow or a new process?
FeliciaFung
Calcite | Level 5
But I am not sure why I cannot save the output. I can only 'plot' after opening the exported data property

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
  • 18 replies
  • 1830 views
  • 3 likes
  • 3 in conversation