From: liudapaul on 25 Sep 2009 16:30 I've been reading a SUGI paper regarding to variable reduction but couldn't figure out one part of the code on page 6. I attach the code below and for anyone who is interested in the paper I also attached the link. *--------------------------------------------------------------* | Loop through all Numeric Variables in Data Set | *--------------------------------------------------------------*; %do range=1 %to &numobs %by 200; %let upper=%eval(&range+199); data varlist; set &inputds._keeplist; if &range<=_n_<=&upper ; run; data _null_; set varlist NOBS=numobs end=last; call symput(cats("var",_n_),variable); if last then call symput("numobs",numobs); run; proc corr data=&inputds. OUTP=%cmpres(corr_&range._&upper) NOPRINT; var %do j=1 %to &numobs; &&var&j %end; &dumlist; %if %bquote(&weight) ne %then %str(weight &weight;); RUN; %put Output Correlation Data Set Will be Called: %cmpres (corr_&range._&upper); ods listing close; data _null_; set varlist end=last; call execute("ods output Test ANOVA=reg_temp(KEEP=MODEL SOURCE DF MS FVALUE PROBF WHERE=(Source='Numerator'));"); call execute("proc REG data=%cmpres(corr_&range._&upper) ;"); call execute(variable||": model "||variable||"=&dumlist ;"); call execute("test &dumlist_comma;"); call execute("RUN;"); call execute("quit;"); call execute("ods output close;"); IF EXIST("WORK.REG_TEMP") THEN DO; call execute("Proc APPEND base=%cmpres(work.reg_total_&out_suffix) data=reg_temp(drop=source) force;"); call execute("run;"); END; RUN; %end; my question is what's the idea behind using a correlation matrix as input of a regression? Link to the paper: http://www2.sas.com/proceedings/forum2007/081-2007.pdf
|
Pages: 1 Prev: SAS DSD Option on a delimited file Next: Move File with Sas pgm |