/* Lesson 6-1 */ /* File Name = scat01.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc print data=zenin(obs=10); : (以後は表示部を省略する) run; : proc means data=zenin; : 各変量の平均値を求める run; : proc chart data=zenin; : 各変量の横棒グラフを描く hbar seibetsu shintyou taijyuu kyoui kozukai jitaku daigaku; run;
/* Lesson 6-2 */ /* File Name = scat02.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc means data=zenin; run; proc plot data=zenin; plot shintyou*taijyuu; run;
/* Lesson 6-3 */ /* File Name = scat03.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc means data=zenin; run; proc sort data=zenin; by seibetsu; proc means data=zenin; var shintyou taijyuu; by seibetsu; run; proc plot data=zenin; plot shintyou*taijyuu; by seibetsu; run; proc plot data=zenin; plot shintyou*taijyuu; where seibetsu='F'; run; proc plot data=zenin; plot shintyou*taijyuu; where seibetsu='M'; run;
/* Lesson 6-4 */ /* File Name = scat04.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc means data=zenin; run; proc plot data=zenin; plot shintyou*taijyuu=seibetsu/ vaxis=140 to 180 by 10 haxis=30 to 90 by 10; run;
/* Lesson 6-5 */ /* File Name = corr01.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc corr data=zenin; var shintyou taijyuu kyoui; run; prov sort data=zenin; by seibetsu; run; proc corr data=zenin; var shintyou taijyuu kyoui; by seibetsu; run;
/* Lesson 6-6 */ /* File Name = reg01.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc reg data=zenin; model shintyou=taijyuu; run;
/* Lesson 6-7 */ /* File Name = freq01.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc freq data=zenin; tables seibetsu; run; proc freq data=zenin; tables seibetsu*jitaku; run;
/* Lesson 6-8 */ /* File Name = freq02.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc format; : 新しい階級(変数名:class)を作る value class low-<150=' -149' : 150-<160='150-159' : 160-<170='160-169' : 170-high='170- ' : other ='missing'; : run; : proc freq data=zenin; : tables shintyou; : (一重クロス)集計 format shintyou class.; : run; : : proc freq data=zenin; : tables shintyou*seibetsu; : 二重クロス集計 format shintyou class.; : run; : : proc freq data=zenin; : tables shintyou*seibetsu*jitaku; : 三重クロス集計 format shintyou class.; : run; :
/* Lesson 6-9 */ /* File Name = freq03.sas 11/15/96 */ data zenin; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui kozukai jitaku $ daigaku $; proc format; value class low-<150=' -149' 150-<160='150-159' 160-<170='160-169' 170-high='170- ' other ='missing'; run; proc tabulate data=zenin; class shintyou seibetsu; var taijyuu; tables taijyuu*(n mean std),shintyou*seibetsu; format shintyou class.; run;