/* Lesson 6-1 */ /* File Name = les0601.sas 05/24/00 */ data gakusei; : infile 'waseda01.prn'; : ファイル名の変更 input sex $ shintyou taijyuu kyoui jitaku $ kodukai; : : proc print data=gakusei(obs=5); : run; : proc means data=gakusei; : 平均、標準偏差、最大最小値の算出 run; : proc chart data=gakusei; : ヒストグラムを描く hbar shintyou taijyuu; : 水平棒グラフで。変量を指定 vbar shintyou taijyuu; : 垂直棒グラフで。変量を指定 run; : proc plot data=gakusei; : 散布図を描く plot shintyou*taijyuu; : 散布図の変量を指定(縦軸、横軸の順) plot taijyuu*shintyou; : run; : : proc chart data=gakusei; : hbar shintyou / midpoints=140 to 190 by 5; : 区切りの指定 hbar taijyuu / midpoints=40 to 100 by 5; : hbar kodukai / midpoints=0 to 200000 by 10000; : : vbar shintyou / midpoints=140 to 190 by 5; : 垂直棒グラフ vbar taijyuu / midpoints=40 to 100 by 5; : vbar kodukai / midpoints=0 to 200000 by 10000; : : hbar shintyou / midpoints=140 to 190 by 10 axis=0 5 10 15; : 頻度側の指定 hbar taijyuu / midpoints=40 to 100 by 10 axis=0 3 6 9 12 15; : hbar kodukai / midpoints=0 to 200000 by 20000 axis=0 to 12 by 2; : run; : proc plot data=gakusei; plot shintyou*taijyuu / vaxis=140 to 190 by 10 haxis=40 to 100 by 20; run;
SAS システム 2 16:51 Wednesday, May 23, 2001 Variable N Mean Std Dev Minimum Maximum -------------------------------------------------------------------- SHINTYOU 39 166.5051282 9.4235692 149.0000000 184.0000000 TAIJYUU 38 58.1842105 11.9052686 41.5000000 100.0000000 KYOUI 20 84.0500000 10.8553892 56.0000000 112.0000000 KODUKAI 38 52973.68 48161.60 0 200000.00 -------------------------------------------------------------------- SAS システム 3 16:51 Wednesday, May 23, 2001 SHINTYOU Cum. Cum. Midpoint Freq Freq Percent Percent | 150 |****** 3 3 7.69 7.69 156 |************ 6 9 15.38 23.08 162 |**************** 8 17 20.51 43.59 168 |************** 7 24 17.95 61.54 174 |****************** 9 33 23.08 84.62 180 |******** 4 37 10.26 94.87 186 |**** 2 39 5.13 100.00 | ----+---+---+---+-- 2 4 6 8 Frequency SAS システム 4 16:51 Wednesday, May 23, 2001 TAIJYUU Cum. Cum. Midpoint Freq Freq Percent Percent | 40 |** 1 1 2.63 2.63 50 |****************************** 15 16 39.47 42.11 60 |************************** 13 29 34.21 76.32 70 |************ 6 35 15.79 92.11 80 |** 1 36 2.63 94.74 90 |** 1 37 2.63 97.37 100 |** 1 38 2.63 100.00 | ----+---+---+---+---+---+---+-- 2 4 6 8 10 12 14 Frequency SAS システム 5 16:51 Wednesday, May 23, 2001 Frequency | ***** 8 + ***** ***** | ***** ***** ***** 6 + ***** ***** ***** ***** | ***** ***** ***** ***** 4 + ***** ***** ***** ***** ***** | ***** ***** ***** ***** ***** ***** 2 + ***** ***** ***** ***** ***** ***** ***** | ***** ***** ***** ***** ***** ***** ***** -------------------------------------------------------------------- 150 156 162 168 174 180 186 SHINTYOU Midpoint SAS システム 6 16:51 Wednesday, May 23, 2001 Frequency 16 + ***** | ***** ***** 12 + ***** ***** | ***** ***** 8 + ***** ***** | ***** ***** ***** 4 + ***** ***** ***** | ***** ***** ***** ***** ***** ***** ***** -------------------------------------------------------------------- 40 50 60 70 80 90 100 TAIJYUU Midpoint SAS システム 7 16:51 Wednesday, May 23, 2001 プロット : SHINTYOU*TAIJYUU. 凡例: A = 1 OBS, B = 2 OBS, ... (NOTE: 1 オブザベーションが欠損値です.) SHINTYOU | 200 + | | A 180 + A A A A A | A A AAA A A A A | AB AB A A 160 + AA BA A AA | A AAB A | A 140 + -+---------+---------+---------+---------+---------+---------+- 40 50 60 70 80 90 100 TAIJYUU SAS システム 8 16:51 Wednesday, May 23, 2001 プロット : TAIJYUU*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... (NOTE: 1 オブザベーションが欠損値です.) TAIJYUU | 100 + A | A | 80 + A | A | A A A A A 60 + A A A A A AAA A | A A A AA BB A A A | AA A AA A A 40 + A --+-----------+-----------+-----------+-----------+-----------+- 140 150 160 170 180 190 SHINTYOU SAS システム 9 16:51 Wednesday, May 23, 2001 SHINTYOU Cum. Cum. Midpoint Freq Freq Percent Percent | 140 | 0 0 0.00 0.00 145 | 0 0 0.00 0.00 150 |****** 3 3 7.69 7.69 155 |************ 6 9 15.38 23.08 160 |****** 3 12 7.69 30.77 165 |******************** 10 22 25.64 56.41 170 |************ 6 28 15.38 71.79 175 |************ 6 34 15.38 87.18 180 |****** 3 37 7.69 94.87 185 |**** 2 39 5.13 100.00 190 | 0 39 0.00 100.00 | ----+---+---+---+---+ 2 4 6 8 10 SAS システム 10 16:51 Wednesday, May 23, 2001 TAIJYUU Cum. Cum. Midpoint Freq Freq Percent Percent | 40 |** 1 1 2.63 2.63 45 |********** 5 6 13.16 15.79 50 |**************** 8 14 21.05 36.84 55 |************** 7 21 18.42 55.26 60 |************** 7 28 18.42 73.68 65 |********** 5 33 13.16 86.84 70 |**** 2 35 5.26 92.11 75 | 0 35 0.00 92.11 80 |** 1 36 2.63 94.74 85 | 0 36 0.00 94.74 90 |** 1 37 2.63 97.37 95 | 0 37 0.00 97.37 100 |** 1 38 2.63 100.00 | ----+---+---+---+ 2 4 6 8 Frequency SAS システム 12 16:51 Wednesday, May 23, 2001 KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 |*************** 3 3 7.89 7.89 10000 |*************** 3 6 7.89 15.79 20000 |************************* 5 11 13.16 28.95 30000 |****************************** 6 17 15.79 44.74 40000 |****************************** 6 23 15.79 60.53 50000 |********** 2 25 5.26 65.79 60000 |********** 2 27 5.26 71.05 70000 |********** 2 29 5.26 76.32 80000 |********** 2 31 5.26 81.58 90000 | 0 31 0.00 81.58 100000 |*************** 3 34 7.89 89.47 110000 | 0 34 0.00 89.47 120000 |***** 1 35 2.63 92.11 130000 | 0 35 0.00 92.11 140000 | 0 35 0.00 92.11 150000 | 0 35 0.00 92.11 160000 |***** 1 36 2.63 94.74 170000 | 0 36 0.00 94.74 180000 |***** 1 37 2.63 97.37 190000 | 0 37 0.00 97.37 200000 |***** 1 38 2.63 100.00 | -----+----+----+----+----+----+ 1 2 3 4 5 6 Frequency SAS システム 14 16:51 Wednesday, May 23, 2001 Frequency 10 + **** | **** 8 + **** | **** 6 + **** **** **** **** | **** **** **** **** 4 + **** **** **** **** | **** **** **** **** **** **** **** 2 + **** **** **** **** **** **** **** **** | **** **** **** **** **** **** **** **** --------------------------------------------------------------------- 140 145 150 155 160 165 170 175 180 185 190 SHINTYOU Midpoint SAS システム 15 16:51 Wednesday, May 23, 2001 Frequency 8 + *** | *** *** *** 6 + *** *** *** | *** *** *** *** *** 4 + *** *** *** *** *** | *** *** *** *** *** 2 + *** *** *** *** *** *** | *** *** *** *** *** *** *** *** *** *** -------------------------------------------------------------------- 40 45 50 55 60 65 70 75 80 85 90 95 100 TAIJYUU Midpoint SAS システム 16 16:51 Wednesday, May 23, 2001 Frequency 6 + ** ** | ** ** ** 4 + ** ** ** | ** ** ** ** ** ** 2 + ** ** ** ** ** ** ** ** ** ** | ** ** ** ** ** ** ** ** ** ** ** ** ** ** ----------------------------------------------------------------- 1 1 1 1 1 1 1 1 1 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 KODUKAI Midpoint SAS システム 17 16:51 Wednesday, May 23, 2001 SHINTYOU Cum. Cum. Midpoint Freq Freq Percent Percent | 140 | 0 0 0.00 0.00 150 |********** 5 5 12.82 12.82 160 |************************ 12 17 30.77 43.59 170 |************************** 13 30 33.33 76.92 180 |****************** 9 39 23.08 100.00 190 | 0 39 0.00 100.00 | ----------+---------+---------+ 5 10 15 Frequency SAS システム 18 18:46 Wednesday, May 23, 2001 TAIJYUU Cum. Cum. Midpoint Freq Freq Percent Percent | 40 |** 1 1 2.63 2.63 50 |****************************** 15 16 39.47 42.11 60 |************************** 13 29 34.21 76.32 70 |************ 6 35 15.79 92.11 80 |** 1 36 2.63 94.74 90 |** 1 37 2.63 97.37 100 |** 1 38 2.63 100.00 | ------+-----+-----+-----+-----+ 3 6 9 12 15 Frequency SAS システム 19 18:46 Wednesday, May 23, 2001 KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 |****** 3 3 7.89 7.89 20000 |**************** 8 11 21.05 28.95 40000 |************************ 12 23 31.58 60.53 60000 |******** 4 27 10.53 71.05 80000 |******** 4 31 10.53 81.58 100000 |****** 3 34 7.89 89.47 120000 |** 1 35 2.63 92.11 140000 | 0 35 0.00 92.11 160000 |** 1 36 2.63 94.74 180000 |** 1 37 2.63 97.37 200000 |** 1 38 2.63 100.00 | ----+---+---+---+---+---+ 2 4 6 8 10 12 SAS システム 20 19:04 Wednesday, May 23, 2001 プロット : SHINTYOU*TAIJYUU. 凡例: A = 1 OBS, B = 2 OBS, ... SHINTYOU (NOTE: 1 オブザベーションが欠損値です.) 190 + | A A 180 + A A A | A AA A A A 170 + A A AA A A | A AC B A A 160 + A A A | A B A A A 150 + A AA | 140 + ---+------------------+------------------+------------------+-- 40 60 80 100 TAIJYUU
/* Lesson 6-2 */ /* File Name = les0602.sas 05/24/01 */ data gakusei; infile 'waseda01.prn'; input sex $ shintyou taijyuu kyoui jitaku $ kodukai; proc print data=gakusei(obs=10); run; proc means data=gakusei; : 平均、標準偏差、最大最小値の算出 run; : proc univariate data=gakusei plot; : 基礎統計量の算出、plot オプション var shintyou taijyuu; : 指定した変量について計算 run; :
SAS システム 3 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=SHINTYOU Moments N 38 Sum Wgts 38 Mean 166.2553 Sum 6317.7 Std Dev 9.418231 Variance 88.70308 Skewness 0.00136 Kurtosis -0.72237 USS 1053633 CSS 3282.014 CV 5.664922 Std Mean 1.527839 T:Mean=0 108.8173 Pr>|T| 0.0001 Num ^= 0 38 Num > 0 38 M(Sign) 19 Pr>=|M| 0.0001 Sgn Rank 370.5 Pr>=|S| 0.0001 SAS システム 4 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=SHINTYOU Quantiles(Def=5) 100% Max 184 99% 184 75% Q3 173 95% 183 50% Med 166.5 90% 179 25% Q1 160 10% 153 0% Min 149 5% 150 1% 149 Range 35 Q3-Q1 13 Mode 163 SAS システム 5 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=SHINTYOU Extremes Lowest Obs Highest Obs 149( 4) 178( 5) 150( 32) 179( 31) 151.7( 21) 182( 23) 153( 19) 183( 26) 153( 1) 184( 30) SAS システム 6 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=SHINTYOU Stem Leaf # Boxplot 18 234 3 | 17 55789 5 | 17 112234 6 +-----+ 16 6677788 7 *--+--* 16 02233344 8 +-----+ 15 5677 4 | 15 0233 4 | 14 9 1 | ----+----+----+----+ Multiply Stem.Leaf by 10**+1 SAS システム 7 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=SHINTYOU Normal Probability Plot 182.5+ *+*++ * | ***+**+ | **+**+ | **+*+ | **+*+* | +***+ | *+*+*+ 147.5+ +*+++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 8 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=TAIJYUU Moments N 37 Sum Wgts 37 Mean 57.94595 Sum 2144 Std Dev 11.97728 Variance 143.4553 Skewness 1.756951 Kurtosis 4.056088 USS 129400.5 CSS 5164.392 CV 20.66975 Std Mean 1.969053 T:Mean=0 29.42833 Pr>|T| 0.0001 Num ^= 0 37 Num > 0 37 M(Sign) 18.5 Pr>=|M| 0.0001 Sgn Rank 351.5 Pr>=|S| 0.0001 === (略) === SAS システム 12 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=TAIJYUU Stem Leaf # Boxplot 10 0 1 * 9 0 1 0 8 7 08 2 0 6 001135568 9 +-----+ 5 0122223455557899 16 *--+--* 4 25666788 8 | ----+----+----+----+ Multiply Stem.Leaf by 10**+1 SAS システム 13 16:51 Wednesday, May 23, 2001 Univariate Procedure Variable=TAIJYUU Normal Probability Plot 105+ * | * | +++++++ 75+ ++*+*+++ | ++*****+* * | **+****+*** 45+ * * *++*+**++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2