data metrmnth; do month=1 to 75; do metronum=1 to 25; output; end; end; run; data name; retain metronum 0; input metro $ 1-30; metronum=metronum+1; cards; ANAHEIM-SANTA ANA ATLANTA BOSTON CHICAGO DALLAS DENVER DETROIT HOUSTON LOS ANGELES-LONG BEACH MIAMI-HIALEAH MINNEAPOLIS-ST PAUL NASHVILLE NEW ORLEANS NEW YORK NORFOLK-VIRGINIA BEACH OAHU ORLANDO PHILADELPHIA PHOENIX SAN DIEGO SAN FRANCISCO SEATTLE ST LOUIS TAMPA-ST PETERSBURG WASHINGTON ; run; * proc print; proc sort data=name; by metronum; run; data metrdata; infile 'C:\SAS\hotel\metro1.dat'; input pct_occ ave_rr; revpar=pct_occ*ave_rr/100; run; data metrdata; merge metrmnth metrdata; run; proc sort data=metrdata; by metronum; run; data metrall; merge metrdata name; by metronum; if metro='NORFOLK-VIRGINIA BEACH'; x1=cos(2*3.14159*1*month/12); x2=sin(2*3.14159*1*month/12); x3=cos(2*3.14159*2*month/12); x4=sin(2*3.14159*2*month/12); x5=cos(2*3.14159*3*month/12); x6=sin(2*3.14159*3*month/12); x7=cos(2*3.14159*4*month/12); x8=sin(2*3.14159*4*month/12); x9=cos(2*3.14159*5*month/12); x10=sin(2*3.14159*5*month/12); x11=cos(3.14159*month); x12=month; run; proc reg; model revpar=x1-x12; output out=norfolk p=yhat r=e; symbol1 c=black v=dot; symbol2 c=black i=smooth l=1; proc gplot; * where metronum=25; plot revpar*month=1 yhat*month=2 / vaxis=0 to 100 by 10 haxis=0 to 74 by 1 overlay legend=legend1 href=3 to 63 by 12; * plot2 pct_occ*month=3 / vaxis=0 to 100 by 10 overlay legend=legend1; title 'Norfolk - Trigonometric Regression Model'; title2 '5 Sin and 6 Cos Parameters'; run; proc gplot; * where metronum=25; plot e*month=1 / vref=0 haxis=0 to 74 by 1 overlay legend=legend1 href=3 to 63 by 12; * plot2 pct_occ*month=3 / vaxis=0 to 100 by 10 overlay legend=legend1; title 'Norfolk - Trigonometric Regression Model - Residuals'; title2 '5 Sin and 6 Cos Parameters'; run; quit; run; quit;