/* Lesson StatM2303-Reg4 */ /* File Name = StatM2303-Reg4.sas 10/13/23 */ options nocenter linesize=78 pagesize=30; options locale='en_US'; /* options locale='ja_JP'; */ ods graphics / imagemap=on; proc printto print = '/home/sasnitech0/StatM23/StatM2303-Reg4_Results.txt' new; ods listing gpath='/home/sasnitech0/StatM23/SAS_GraphDir'; data stud2x; infile '/home/sasnitech0/StatM23/StudAll23b.csv' firstobs=8 dlm=',' dsd /* missover truncover */ encoding=utf8 termstr=crlf ; input No Xsex $ Xshintyou Xtaijyuu Xkyoui Xjitaku : $10. Xkodukai Xcarryer : $10. Xtsuushin; if Xshintyou='.' or Xtaijyuu='.' or Xkyoui='.' then delete; if Xkyoui<60 then delete; if Xtaijyuu>85 then delete; label Xsex='性別' Xshintyou='身長' Xtaijyuu='体重' Xkyoui='胸囲' Xjitaku='自宅生/下宿生の別' Xkodukai='仕送り月額' Xcarryer='キャリアー' Xtsuushin='月額通信料' ; proc print data=stud2x(obs=10); run; proc means data=stud2x; run; proc reg data=stud2x; model Xtaijyuu=Xshintyou Xkyoui; output out=outreg4 predicted=pred4 residual=resid4; run; proc print data=outreg4(obs=15); run; proc plot data=outreg4; plot Xtaijyuu*Xshintyou/vaxis=20 to 100 by 20; plot Xtaijyuu*Xkyoui/vaxis=20 to 100 by 20; plot pred4*Xtaijyuu; plot resid4*Xshintyou/vref=0; plot resid4*Xkyoui /vref=0; plot resid4*Xtaijyuu /vref=0; run; proc univariate data=outreg4 plot normal; var resid4; run; ods printer close; ods results; quit;