/* Lesson 9-1 */ /* File Name = anke05.sas 06/19/97 */ data kodukai; infile 'kodukai.dat'; input seibetsu $ jitaku $ kodukai; proc print data=kodukai(obs=10); run; : proc means data=kodukai; : 平均、分散、最大最小値の算出 var kodukai; : 小遣いについて run; : proc sort data=kodukai; : 並べ替え(ソート) by jitaku; : 自宅生/下宿生別に run; : proc means data=kodukai; : 平均、分散、最大最小値の算出 var kodukai; : 小遣いについて by jitaku; : 自宅生/下宿生別に run; :
SAS システム 1 20:12 Wednesday, June 18, 1997 OBS SEIBETSU JITAKU KODUKAI 1 M . 2 M . 3 M 30000 4 M G 0 5 M G 100000 6 M G 120000 7 M G . 8 M G 150000 9 M G 163000 10 M G 50000 SAS システム 2 20:12 Wednesday, June 18, 1997 Analysis Variable : KODUKAI N Mean Std Dev Minimum Maximum ---------------------------------------------------------- 35 56757.14 53071.31 0 163000.00 ---------------------------------------------------------- SAS システム 3 20:12 Wednesday, June 18, 1997 Analysis Variable : KODUKAI -------------------------------- JITAKU=' ' ------------------------------ N Mean Std Dev Minimum Maximum ---------------------------------------------------------- 1 30000.00 . 30000.00 30000.00 ---------------------------------------------------------- -------------------------------- JITAKU=G ------------------------------- N Mean Std Dev Minimum Maximum ---------------------------------------------------------- 14 108785.71 46647.91 0 163000.00 ---------------------------------------------------------- SAS システム 4 20:12 Wednesday, June 18, 1997 Analysis Variable : KODUKAI -------------------------------- JITAKU=J ------------------------------- N Mean Std Dev Minimum Maximum ---------------------------------------------------------- 20 21675.00 14949.28 0 60000.00 ----------------------------------------------------------
/* Lesson 9-2 */ /* File Name = chart02.sas 06/19/97 */ data kodukai; infile 'kodukai.dat'; input seibetsu $ jitaku $ kodukai; proc print data=kodukai(obs=10); run; : proc sort data=kodukai; : 並べ替え by jitaku; : 自宅生/下宿生別に run; : proc chart data=kodukai; : 図示 hbar kodukai; : 水平棒グラフで by jitaku; : 自宅生/下宿生別に run; : proc chart data=kodukai; : 図示 vbar kodukai; : 垂直棒グラフで by jitaku; : 自宅生/下宿生別に run; :
SAS システム 2 20:44 Wednesday, June 18, 1997 ------------------------------ JITAKU=' ' ------------------------------ KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 30000 |******************** 1 1 100.00 100.00 | --------------------+ 1 Frequency SAS システム 3 20:44 Wednesday, June 18, 1997 ------------------------------- JITAKU=G ------------------------------- KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 |***** 1 1 7.14 7.14 | 40000 |***** 1 2 7.14 14.29 | 80000 |***** 1 3 7.14 21.43 | 120000 |****************************** 6 9 42.86 64.29 | 160000 |************************* 5 14 35.71 100.00 | -----+----+----+----+----+----+ 1 2 3 4 5 6 Frequency SAS システム 4 20:44 Wednesday, June 18, 1997 ------------------------------- JITAKU=J ------------------------------- KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 |******** 4 4 20.00 20.00 | 15000 |**************** 8 12 40.00 60.00 | 30000 |************ 6 18 30.00 90.00 | 45000 |** 1 19 5.00 95.00 | 60000 |** 1 20 5.00 100.00 | ----+---+---+---+ 2 4 6 8 Frequency SAS システム 5 20:44 Wednesday, June 18, 1997 ------------------------------ JITAKU=' ' ------------------------------ Frequency 1 + ***** | ***** | ***** | ***** | ***** | ***** | ***** | ***** | ***** | ***** -------------------- 30000 KODUKAI Midpoint SAS システム 6 20:44 Wednesday, June 18, 1997 ------------------------------- JITAKU=G ------------------------------- Frequency 6 + ***** | ***** 5 + ***** ***** | ***** ***** 4 + ***** ***** | ***** ***** 3 + ***** ***** | ***** ***** 2 + ***** ***** | ***** ***** 1 + ***** ***** ***** ***** ***** | ***** ***** ***** ***** ***** -------------------------------------------------------------------- 0 40000 80000 120000 160000 KODUKAI Midpoint SAS システム 7 20:44 Wednesday, June 18, 1997 ------------------------------- JITAKU=J ------------------------------- Frequency 8 + ***** | ***** 6 + ***** ***** | ***** ***** 4 + ***** ***** ***** | ***** ***** ***** 2 + ***** ***** ***** | ***** ***** ***** ***** ***** -------------------------------------------------------------------- 0 15000 30000 45000 60000 KODUKAI Midpoint
/* Lesson 9-3 */ /* File Name = chart03.sas 06/19/97 */ data kodukai; infile 'kodukai.dat'; input seibetsu $ jitaku $ kodukai; proc print data=kodukai(obs=10); run; : proc chart data=kodukai; : 図示 hbar kodukai/group=jitaku; : 水平棒グラフで、グループ別に run; : proc chart data=kodukai; : 図示 vbar kodukai/group=jitaku; : 垂直棒グラフで、グループ別に run; :
SAS システム 2 20:51 Wednesday, June 18, 1997 JITAKU KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 | 0 0 0.00 0.00 30000 |* 1 1 2.86 2.86 60000 | 0 1 0.00 2.86 90000 | 0 1 0.00 2.86 120000 | 0 1 0.00 2.86 150000 | 0 1 0.00 2.86 | G 0 |* 1 2 2.86 5.71 30000 | 0 2 0.00 5.71 60000 |** 2 4 5.71 11.43 90000 |**** 4 8 11.43 22.86 120000 |** 2 10 5.71 28.57 150000 |***** 5 15 14.29 42.86 | J 0 |**** 4 19 11.43 54.29 30000 |*************** 15 34 42.86 97.14 60000 |* 1 35 2.86 100.00 90000 | 0 35 0.00 100.00 120000 | 0 35 0.00 100.00 150000 | 0 35 0.00 100.00 | -----+----+----+ 5 10 15 Frequency SAS システム 4 20:51 Wednesday, June 18, 1997 Frequency 16 + * | * 12 + * | * 8 + * | * * 4 + * * * * | * * * * * * * * * --------------------------------------------------------- 1 1 1 1 1 1 KODUKAI Midpoint 3 6 9 2 5 3 6 9 2 5 3 6 9 2 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |---- ---| |--- G ---| |--- J ---| JITAKU
/* Lesson 9-4 */ /* File Name = anke06.sas 06/19/97 */ data kodukai; infile 'kodukai.dat'; input seibetsu $ jitaku $ kodukai; proc print data=kodukai(obs=10); run; : proc freq data=kodukai; : 頻度を算出 tables seibetsu jitaku; : 一変量ごとで run; : proc freq data=kodukai; : 頻度を算出 tables seibetsu*jitaku; : 二変量の組み合わせで run; :
SAS システム 2 21:02 Wednesday, June 18, 1997 Cumulative Cumulative SEIBETSU Frequency Percent Frequency Percent ------------------------------------------------------ F 12 29.3 12 29.3 M 29 70.7 41 100.0 Cumulative Cumulative JITAKU Frequency Percent Frequency Percent ---------------------------------------------------- G 16 43.2 16 43.2 J 21 56.8 37 100.0 Frequency Missing = 4 SAS システム 3 21:02 Wednesday, June 18, 1997 TABLE OF SEIBETSU BY JITAKU SEIBETSU JITAKU Frequency| Percent | Row Pct | Col Pct |G |J | Total ---------+--------+--------+ F | 1 | 10 | 11 | 2.70 | 27.03 | 29.73 | 9.09 | 90.91 | | 6.25 | 47.62 | ---------+--------+--------+ M | 15 | 11 | 26 | 40.54 | 29.73 | 70.27 | 57.69 | 42.31 | | 93.75 | 52.38 | ---------+--------+--------+ Total 16 21 37 43.24 56.76 100.00 Frequency Missing = 4
/* Lesson 9-5 */ /* File Name = anke07.sas 06/19/97 */ data gakusei; infile 'taikaku.dat'; input seibetsu $ shintyou taijyuu kyoui; proc format; : 新しい階級(clshin)を作る value clshin low-<150=' -149' : 階級の定義 1 150-<160='150-159' : 2 160-<170='160-169' : 3 170-high='170- ' : 4 other ='missing'; : 5 run; : proc print data=gakusei(obs=10); run; proc freq data=gakusei; : 頻度を算出 tables shintyou; : 一変量ごとで format shintyou clshin.; : 連続量をグループ化 run; : : proc sort data=gakusei; : 並べ替え by seibetsu; : 性別で run; : proc freq data=gakusei; : 頻度を算出 tables shintyou; : 一変量ごとで format shintyou clshin.; : 連続量をグループ化 by seibetsu; : 性別毎に run; : : proc freq data=gakusei; : 頻度を算出 : 上記と同じ結果になる tables shintyou*seibetsu; : 二変量の組合わせで format shintyou clshin.; : 連続量をグループ化 run; :
SAS システム 2 22:38 Wednesday, June 18, 1997 Cumulative Cumulative SHINTYOU Frequency Percent Frequency Percent ------------------------------------------------------ -149 1 2.6 1 2.6 150-159 4 10.5 5 13.2 160-169 16 42.1 21 55.3 170- 17 44.7 38 100.0 Frequency Missing = 3 SAS システム 3 22:38 Wednesday, June 18, 1997 ------------------------------ SEIBETSU=F ------------------------------ Cumulative Cumulative SHINTYOU Frequency Percent Frequency Percent ------------------------------------------------------ -149 1 8.3 1 8.3 150-159 3 25.0 4 33.3 160-169 7 58.3 11 91.7 170- 1 8.3 12 100.0 Frequency Missing = 1 SAS システム 4 22:38 Wednesday, June 18, 1997 ------------------------------ SEIBETSU=M ------------------------------ Cumulative Cumulative SHINTYOU Frequency Percent Frequency Percent ------------------------------------------------------ 150-159 1 3.8 1 3.8 160-169 9 34.6 10 38.5 170- 16 61.5 26 100.0 Frequency Missing = 2 SAS システム 5 22:38 Wednesday, June 18, 1997 TABLE OF SHINTYOU BY SEIBETSU SHINTYOU SEIBETSU Frequency| Percent | Row Pct | Col Pct |F |M | Total ---------+--------+--------+ -149 | 1 | 0 | 1 | 2.63 | 0.00 | 2.63 | 100.00 | 0.00 | | 8.33 | 0.00 | ---------+--------+--------+ 150-159 | 3 | 1 | 4 | 7.89 | 2.63 | 10.53 | 75.00 | 25.00 | | 25.00 | 3.85 | ---------+--------+--------+ 160-169 | 7 | 9 | 16 | 18.42 | 23.68 | 42.11 | 43.75 | 56.25 | | 58.33 | 34.62 | ---------+--------+--------+ 170- | 1 | 16 | 17 | 2.63 | 42.11 | 44.74 | 5.88 | 94.12 | | 8.33 | 61.54 | ---------+--------+--------+ Total 12 26 38 31.58 68.42 100.00 Frequency Missing = 3