libname mike 'c:\sas'; data temp1; set mike.redfish; if red2 > -.5; run; proc standard out = temp2 mean = 0 std =1; var qjf qma qmj qja qso qnd; run; * NOTE -- make sure your data set is named temp; */ Also you will have to put you dependent variable name in the IML statement and your independent variable names in the proc reg/*; data temp; set temp2; run; proc iml; use temp; show contents; read all var {red2} into x; nr = nrow(x); nc = ncol(x); nl = 17; print nr; print nc; b= shape(0,nr,nl); j1 = j(nr,1,1); a=log(x); means = t(j1)*a/nr; print means; means =exp(means); print means; lam = -4.5; do i = 1 to nl; lam = lam +.5; if abs(lam) > .05 then do; a1=x##lam -1; a2 =diag(t(lam*(means)##(lam-1))); * print a2; y=a1*inv(a2); end; if abs(lam)<.05 then do; y=means@log(x); end; do jj = 1 to nr; b[jj,i]=y[jj,1]; end; end; print b; create bout from b ; append from b; quit; data temp1; merge temp bout; run; proc reg outest=est; model col1-col17=qjf qma qmj qja qso qnd; run; proc print; run; data lam; input lam; cards; -4 -3.5 -3.0 -2.5 -2 -1.5 -1 -.5 0 .5 1 1.5 2. 2.5 3 3.5 4 ; run; data lam1; merge est lam; rmse = _rmse_; keep lam rmse ; run; proc print;run; /*------------------------------------------------------------------* | Summary: | | Creating a simple plot using the data set | | WORK.LAM1 and plotting | | RMSE against LAM. | | Generated: 30SEP98 10:39:09 | *------------------------------------------------------------------*/ /*------------------------------------------------------------------* | The GOPTIONS statement allows you to have more control over the | | | height and so on. The output device and destination is also | | specified in the goptions statement. | *------------------------------------------------------------------*/ goptions reset=(axis, legend, pattern, symbol, title, footnote) norotate hpos=0 vpos=0 htext= ftext= ctext= target= gaccess= gsfmode= ; goptions device=WIN ctext=blue graphrc interpol=join; /*------------------------------------------------------------------* | SYMBOL statements allow you to supply information such as plot | | character, plot lines, color and interpolation. | *------------------------------------------------------------------*/ symbol1 c=DEFAULT v=DIAMOND ; /*------------------------------------------------------------------* | AXIS statements allow you to supply information on how your | | vertical and horizontal axes will appear on the graph. | *------------------------------------------------------------------*/ axis1 color=blue width=2.0 ; axis2 color=blue width=2.0 ; axis3 color=blue width=2.0 ; /*------------------------------------------------------------------* | This section produces the actual plot and any options that | | directly relate to the data and the axis area. | *------------------------------------------------------------------*/ proc gplot data=WORK.LAM1 ; plot RMSE * LAM / haxis=axis1 vaxis=axis2 frame ; run; quit; data logy; set temp; red_new = log(red2); run; proc reg data=logy ; model red2 =qjf qma qmj qja qso qnd; output out = out1 r=r p=p; proc reg data = logy; model red_new=qjf qma qmj qja qso qnd ; output out=out2 p = p r = r; run; data diff1; set out1; diff1 = (red2-p)**2; run; data diff2; set out2; diff2 =(red2-exp(p))**2; run; data logy1; set logy; if year <1980; run; proc reg data=logy1 ; model red2 =qjf qma qmj qja qso qnd; output out = out3 r=r p=p; proc reg data = logy1; model red_new=qjf qma qmj qja qso qnd ; output out=out4 p = p r = r; run; data diff3; set out3; diff3 = (red2-p)**2; run; data diff4; set out4; diff4 =(red2-exp(p))**2; run; data diffs; merge diff1 diff2 diff3 diff4; keep diff1 diff2 diff3 diff4; run; proc reg data = logy; model red2 =qjf qma qmj qja qso qnd/vif collin selection = backward; run; proc reg data = logy1; model red2 =qjf qma qmj qja qso qnd/vif collin selection = backward; run;