Hello, this gives me a headache
I need to do multiple responses PLS, and use sas code node for that.
Before 'sas code node' it is a 'transform variables' which includes all of specific data treatment.
When I edit the code editor, I can see all of data is within the .
so I type below:
%global xvars yvars;
%let xvars = BLK1 BLK2 BLK3 BLK4 BLK5....; (Long variable list)
%let yvars = y1 y2 y3 y4; (BLK1.... and y1... are all included in EM_IMPORT DATA.
PROC PLS CV=ONE MISSING=AVG METHOD=PLS NOCENTER NOSCALE NOCVSTDIZE NFAC=6 DATA=&EM_IMPORT_DATA;
model yvars = xvars;
run;
in the log, it shows:
ERROR: Variable YVARS not found.
NOTE: The previous statement has been deleted.
7848 run;
ERROR: No MODEL specified
I would like to define the variables included in EM_IMPORT DATA as xvars and yvars due to the number of vairables to be used by PLS algorithm,
Appreciate your kind help.
model &yvars=&xvars;
Although no macros are needed here, unless the problem is much more complicated than you describe (which may be the case). Code with no macros:
model y1 y2 y3 y4 = BLK1 BLK2 BLK3 BLK4 BLK5....;
You may also need a CLASS statement if any of your X-variables are categorical.
model &yvars=&xvars;
Although no macros are needed here, unless the problem is much more complicated than you describe (which may be the case). Code with no macros:
model y1 y2 y3 y4 = BLK1 BLK2 BLK3 BLK4 BLK5....;
You may also need a CLASS statement if any of your X-variables are categorical.
Thanks for your kind reply. That works.
can I ask how to use the OUTPUT statement?
The help document is a bit confusing to me, how can I output predict y1, y2, y3, y4 separately and passing this to next node?
Many thanks
@Jonison wrote:
Thanks for your kind reply. That works.
can I ask how to use the OUTPUT statement?
The help document is a bit confusing to me, how can I output predict y1, y2, y3, y4 separately and passing this to next node?
Many thanks
output out=datasetname predicted=pred_y1 pred_y2 pred_y3 pred_y4;
thanks for your kind help.
I typed 'output out=&EM_EXPORT_TRAIN predicted=pred_STD_FP_1_5 pred_STD_FP_3_4 pred_STD_SX_1_5 pred_STD_SX_3_4 pred_STD_FP_SX_FPM_Ratio;'
and when run code: shows ERROR: Unable to create EMWS2.EMCODE_TRAIN.DATA because EMWS2.EMCODE_TRAIN.VIEW already exists
and I would like to make predicted results shown in the emport table of this node. How could I do that?
Thank you very much
In a SAS library, you can't have a view and a data set with the same name. Since you already have a view by that name, you have to name the data set something else, or first delete the view.
thanks, that helps. Would you please suggest that how to append all of prediction results with the existing dataset? which function should I use?
Many thanks
PROC APPEND
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.