Ok, now I understand - Thanks. Have you tried the pls macro? I copied the code from: https://support.sas.com/rnd/app/stat/papers/plsex.pdf It seems to be working fine until I submit %get_wts(est1,dsxwts=xwts), which produces an error message: NOTE: There were 15 observations read from the data set WORK.DSOUT. NOTE: There were 15 observations read from the data set WORK.PLTANNO. NOTE: PROCEDURE GPLOT used (Total process time): real time 14.57 seconds cpu time 1.04 seconds ERROR: The variable age in the DROP, KEEP, or RENAME list has never been referenced. ERROR: The variable dbp in the DROP, KEEP, or RENAME list has never been referenced. ERROR: The variable female in the DROP, KEEP, or RENAME list has never been referenced. ERROR: The variable htn in the DROP, KEEP, or RENAME list has never been referenced. ERROR: The variable bmi in the DROP, KEEP, or RENAME list has never been referenced. ERROR: The variable chol in the DROP, KEEP, or RENAME list has never been referenced. ERROR: The variable hscrp in the DROP, KEEP, or RENAME list has never been referenced. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.XWTS may be incomplete. When this step was stopped there were 0 observations and 1 variables. WARNING: Data set WORK.XWTS was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds The macros %get_bpls and %get_vip also produce error messages: 2041 %get_bpls(dsoutmod,dsout=bpls); NOTE: There were 16 observations read from the data set WORK.DSOUTMOD. NOTE: The data set WORK.EST_WB has 4 observations and 24 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.00 seconds NOTE: There were 16 observations read from the data set WORK.DSOUTMOD. NOTE: The data set WORK.EST_PQ has 4 observations and 24 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.03 seconds NOTE: IML Ready ERROR: AGE is not in the scope of variables for the data set. */-----------------------------------------------------------------------*/ As far as I can see in the macro, there is no renaming of x-variables so I don't understand the problem. Could it be related to the number of characters in the names of the x variables? Here is the code I submitted: data data_a; set data; if _N_ <= 15; n=_N_; run; %global xvars yvars predname resname xscrname yscrname num_x num_y lv; %global xvars yvars; %let xvars= age dbp female htn bmi chol hscrp; %let yvars= sbp; %let ypred=yhat1; %let yres=yres1; %let predname=yhat; %let resname=res; %let xscrname=xscr; %let yscrname=yscr; %let num_y=1; %let num_x=15; proc pls data=data_a method=pls outmodel=dsoutmod lv=4; class female htn; model &yvars = &xvars; output out=outpls p=yhat1 yresidual=yres1 xresidual=xres1-xres15 xscore=xscr yscore=yscr stdy=stdy stdx=stdx h=h press=press t2=t2 xqres=xqres yqres=yqres; run; %let lv=4; %plot_scr(outpls); %plotxscr(outpls,max_lv=4); %get_wts(est1,dsxwts=xwts); %plot_wt(xwts,max_lv=4); %getxload(est1,dsxload=xloads); %pltxload(xloads,max_lv=4); %get_bpls(dsoutmod,dsout=bpls); %get_vip(dsoutmod,dsvip=vip_data); data eval; merge bpls vip_data; run; proc print data=eval; run;
... View more