/* Lesson 5-1 */ /* File Name = les0501.sas 11/06/03 */ data naikaku; infile 'naikaku01.prn' firstobs=2; input name $15. sex $ goukei tochi yotyokin kasituke kariire; proc print data=naikaku(obs=5); run; proc univariate data=naikaku plot; var goukei; run;
SAS システム 2 22:42 Wednesday, November 5, 2003 GOUKEI Cum. Cum. Midpoint Freq Freq Percent Percent | 5000 |************************ 12 12 66.67 66.67 15000 |****** 3 15 16.67 83.33 25000 |** 1 16 5.56 88.89 35000 | 0 16 0.00 88.89 45000 | 0 16 0.00 88.89 55000 |** 1 17 5.56 94.44 65000 | 0 17 0.00 94.44 75000 |** 1 18 5.56 100.00 | ----+---+---+---+---+---+ 2 4 6 8 10 12 Frequency SAS システム 6 22:42 Wednesday, November 5, 2003 Univariate Procedure Variable=GOUKEI Stem Leaf # Boxplot 7 5 1 * 6 5 7 1 * 4 3 2 04 2 | 1 34 2 +--+--+ 0 233355556688 12 *-----* ----+----+----+----+ Multiply Stem.Leaf by 10**+4
/* Lesson 5-2 */ /* File Name = les0502.sas 11/06/03 */ data gakusei; infile 'all03b.prn' firstobs=2; input sex $ shintyou taijyuu kyoui jitaku $ kodukai carryer $ tsuuwa; proc print data=gakusei(obs=5); run; proc means data=gakusei; run; proc univariate data=gakusei plot; var shintyou taijyuu kyoui kodukai; run; proc chart data=gakusei; : ヒストグラム hbar shintyou taijyuu kyoui kodukai; : 指定した変量について計算 run; : : proc sort data=gakusei; : 並べ替え(ソート) by sex; : 性別ごとに run; : : proc means data=gakusei; : 平均の計算 var shintyou taijyuu kyoui kodukai; : 指定した変量について計算 by sex; : 性別ごとに run; : proc chart data=gakusei; : ヒストグラム hbar shintyou taijyuu kyoui kodukai; : 指定した変量について計算 by sex; : 性別ごとに run; : proc chart data=gakusei; : ヒストグラム hbar shintyou taijyuu kyoui kodukai/group=sex; : 性別ごとに併置して run; : proc univariate data=gakusei plot; : 基礎統計量の計算 var shintyou taijyuu kyoui kodukai; : 指定した変量について計算 by sex; : 性別ごとに run; :
SAS システム 21 17:59 Wednesday, November 5, 2003 Univariate Procedure Variable=KODUKAI Moments N 241 Sum Wgts 241 Mean 51566.39 Sum 12427500 Std Dev 52037.2 Variance 2.7079E9 Skewness 1.617132 Kurtosis 3.601477 USS 1.291E12 CSS 6.499E11 CV 100.913 Std Mean 3352.011 T:Mean=0 15.38372 Pr>|T| 0.0001 Num ^= 0 197 Num > 0 197 M(Sign) 98.5 Pr>=|M| 0.0001 Sgn Rank 9751.5 Pr>=|S| 0.0001 SAS システム 22 17:59 Wednesday, November 5, 2003 Univariate Procedure Variable=KODUKAI Quantiles(Def=5) 100% Max 300000 99% 200000 75% Q3 75000 95% 150000 50% Med 30000 90% 120000 25% Q1 20000 10% 0 0% Min 0 5% 0 1% 0 Range 300000 Q3-Q1 55000 Mode 0 SAS システム 30 17:59 Wednesday, November 5, 2003 KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 |*********** 56 56 23.24 23.24 30000 |***************** 83 139 34.44 57.68 60000 |******** 41 180 17.01 74.69 90000 |****** 29 209 12.03 86.72 120000 |** 12 221 4.98 91.70 150000 |*** 14 235 5.81 97.51 180000 | 2 237 0.83 98.34 210000 | 2 239 0.83 99.17 240000 | 0 239 0.00 99.17 270000 | 0 239 0.00 99.17 300000 | 2 241 0.83 100.00 | ----+---+---+---+- 20 40 60 80 SAS システム 31 17:59 Wednesday, November 5, 2003 -------------------------------- SEX=' ' ------------------------------- Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 1 168.0000000 . 168.0000000 168.0000000 TAIJYUU 1 60.0000000 . 60.0000000 60.0000000 KYOUI 0 . . . . KODUKAI 2 61500.00 54447.22 23000.00 100000.00 --------------------------------------------------------------------- SAS システム 32 17:59 Wednesday, November 5, 2003 --------------------------------- SEX=F -------------------------------- Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 81 159.1962963 5.5592815 145.0000000 171.0000000 TAIJYUU 55 48.5454545 4.6936450 35.0000000 59.0000000 KYOUI 28 83.2500000 4.3514578 70.0000000 90.0000000 KODUKAI 75 53846.67 51734.44 0 300000.00 --------------------------------------------------------------------- SAS システム 33 17:59 Wednesday, November 5, 2003 --------------------------------- SEX=M -------------------------------- Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 173 172.1618497 5.3115759 156.0000000 186.0000000 TAIJYUU 173 62.0335260 7.6385823 46.0000000 100.0000000 KYOUI 59 88.6440678 8.7311624 56.0000000 112.0000000 KODUKAI 164 50402.44 52429.18 0 300000.00 --------------------------------------------------------------------- SAS システム 37 17:59 Wednesday, November 5, 2003 -------------------------------- SEX=F --------------------------------- SHINTYOU Cum. Cum. Midpoint Freq Freq Percent Percent | 146 |* 1 1 1.23 1.23 150 |******* 7 8 8.64 9.88 154 |*********** 11 19 13.58 23.46 158 |******************* 19 38 23.46 46.91 162 |************************ 24 62 29.63 76.54 166 |**************** 16 78 19.75 96.30 170 |*** 3 81 3.70 100.00 | -----+----+----+----+---- 5 10 15 20 Frequency SAS システム 41 17:59 Wednesday, November 5, 2003 -------------------------------- SEX=M --------------------------------- SHINTYOU Cum. Cum. Midpoint Freq Freq Percent Percent | 156 |* 1 1 0.58 0.58 159 |** 3 4 1.73 2.31 162 |**** 7 11 4.05 6.36 165 |**** 7 18 4.05 10.40 168 |**************** 31 49 17.92 28.32 171 |************************ 48 97 27.75 56.07 174 |****************** 35 132 20.23 76.30 177 |********* 18 150 10.40 86.71 180 |******* 14 164 8.09 94.80 183 |**** 7 171 4.05 98.84 186 |* 2 173 1.16 100.00 | -----+----+----+----+---- 10 20 30 40 Frequency SAS システム 47 17:59 Wednesday, November 5, 2003 SEX SHINTYOU Cum. Cum. Midpoint Freq Freq Percent Percent | 145 | 0 0 0.00 0.00 150 | 0 0 0.00 0.00 155 | 0 0 0.00 0.00 160 | 0 0 0.00 0.00 165 | 0 0 0.00 0.00 170 | 1 1 0.39 0.39 175 | 0 1 0.00 0.39 180 | 0 1 0.00 0.39 185 | 0 1 0.00 0.39 | F 145 | 1 2 0.39 0.78 150 |** 8 10 3.14 3.92 155 |**** 22 32 8.63 12.55 160 |****** 28 60 10.98 23.53 165 |**** 19 79 7.45 30.98 170 |* 3 82 1.18 32.16 175 | 0 82 0.00 32.16 180 | 0 82 0.00 32.16 185 | 0 82 0.00 32.16 | M 145 | 0 82 0.00 32.16 150 | 0 82 0.00 32.16 155 | 1 83 0.39 32.55 160 |* 5 88 1.96 34.51 165 |***** 23 111 9.02 43.53 170 |************** 68 179 26.67 70.20 175 |********* 47 226 18.43 88.63 180 |***** 25 251 9.80 98.43 185 |* 4 255 1.57 100.00 | ----+---+---+-- 20 40 60 Frequency SAS システム 55 17:59 Wednesday, November 5, 2003 SEX KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | 0 | 0 0 0.00 0.00 30000 | 1 1 0.41 0.41 60000 | 0 1 0.00 0.41 90000 | 1 2 0.41 0.83 120000 | 0 2 0.00 0.83 150000 | 0 2 0.00 0.83 180000 | 0 2 0.00 0.83 210000 | 0 2 0.00 0.83 240000 | 0 2 0.00 0.83 270000 | 0 2 0.00 0.83 300000 | 0 2 0.00 0.83 | F 0 |***** 12 14 4.98 5.81 30000 |*********** 28 42 11.62 17.43 60000 |******** 20 62 8.30 25.73 90000 |** 6 68 2.49 28.22 120000 |** 4 72 1.66 29.88 150000 |* 2 74 0.83 30.71 180000 | 1 75 0.41 31.12 210000 | 1 76 0.41 31.54 240000 | 0 76 0.00 31.54 270000 | 0 76 0.00 31.54 300000 | 1 77 0.41 31.95 | M 0 |****************** 44 121 18.26 50.21 30000 |********************** 54 175 22.41 72.61 60000 |******** 21 196 8.71 81.33 90000 |********* 22 218 9.13 90.46 120000 |*** 8 226 3.32 93.78 150000 |***** 12 238 4.98 98.76 180000 | 1 239 0.41 99.17 210000 | 1 240 0.41 99.59 240000 | 0 240 0.00 99.59 270000 | 0 240 0.00 99.59 300000 | 1 241 0.41 100.00 | ----+---+---+---+---+-- 10 20 30 40 50 Frequency SAS システム 76 17:59 Wednesday, November 5, 2003 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=SHINTYOU Moments N 81 Sum Wgts 81 Mean 159.1963 Sum 12894.9 Std Dev 5.559282 Variance 30.90561 Skewness -0.24902 Kurtosis -0.3351 USS 2055293 CSS 2472.449 CV 3.492092 Std Mean 0.617698 T:Mean=0 257.7252 Pr>|T| 0.0001 Num ^= 0 81 Num > 0 81 M(Sign) 40.5 Pr>=|M| 0.0001 Sgn Rank 1660.5 Pr>=|S| 0.0001 SAS システム 104 17:59 Wednesday, November 5, 2003 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=SHINTYOU Moments N 173 Sum Wgts 173 Mean 172.1618 Sum 29784 Std Dev 5.311576 Variance 28.21284 Skewness 0.020281 Kurtosis 0.1618 USS 5132521 CSS 4852.608 CV 3.085222 Std Mean 0.403832 T:Mean=0 426.3209 Pr>|T| 0.0001 Num ^= 0 173 Num > 0 173 M(Sign) 86.5 Pr>=|M| 0.0001 SAS システム 132 17:59 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=SHINTYOU 200 + | | 0 180 + | | | *--+--* | *--+--* | +-----+ 160 + *--+--* | | +-----+ 0 | 0 140 + ------------+-----------+-----------+----------- SEX F M SAS システム 133 17:59 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=TAIJYUU | 100 + * | 0 | *--+--* | *--+--* 50 + *--+--* +-----+ | 0 | 0 + ------------+-----------+-----------+----------- SEX F M SAS システム 134 17:59 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=KYOUI | 150 + | | 0 100 + +-----+ | *--0--* *--+--* | * 0 50 + * ------------+-----------+-----------+----------- SEX F M SAS システム 135 17:59 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=KODUKAI 300000 + * * | | 200000 + 0 0 | 0 | | | | 100000 + +-----+ | | | *--+--* +--+--+ +--+--+ | +-----+ *-----* *-----* 0 + | +-----+ ------------+-----------+-----------+----------- SEX F M
/* Lesson 5-3 */ /* File Name = les0503.sas 11/06/03 */ data gakusei; infile 'all03b.prn' firstobs=2; input sex $ shintyou taijyuu kyoui jitaku $ kodukai carryer $ tsuuwa; if kodukai>200000 then delete; : 20万円を越える場合、除外 if sex^='M' & sex^='F' then delete; : 男でも女でもない場合、除外 (以下略)
SAS システム 21 21:49 Wednesday, November 5, 2003 Univariate Procedure Variable=KODUKAI Moments N 237 Sum Wgts 237 Mean 49386.08 Sum 11704500 Std Dev 47037.76 Variance 2.2126E9 Skewness 1.104386 Kurtosis 0.504481 USS 1.1E12 CSS 5.222E11 CV 95.24498 Std Mean 3055.431 T:Mean=0 16.16338 Pr>|T| 0.0001 Num ^= 0 193 Num > 0 193 M(Sign) 96.5 Pr>=|M| 0.0001 Sgn Rank 9360.5 Pr>=|S| 0.0001 SAS システム 22 21:49 Wednesday, November 5, 2003 Univariate Procedure Variable=KODUKAI Quantiles(Def=5) 100% Max 200000 99% 180000 75% Q3 70000 95% 150000 50% Med 30000 90% 120000 25% Q1 20000 10% 0 0% Min 0 5% 0 1% 0 Range 200000 Q3-Q1 50000 Mode 0 SAS システム 30 21:49 Wednesday, November 5, 2003 --------------------------------- SEX=F -------------------------------- Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 80 159.1112500 5.5410778 145.0000000 171.0000000 TAIJYUU 54 48.5555556 4.7371143 35.0000000 59.0000000 KYOUI 27 83.2962963 4.4273174 70.0000000 90.0000000 KODUKAI 74 50520.27 43265.23 0 200000.00 --------------------------------------------------------------------- SAS システム 31 21:49 Wednesday, November 5, 2003 --------------------------------- SEX=M -------------------------------- Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 172 172.1220930 5.3012059 156.0000000 186.0000000 TAIJYUU 172 62.0453488 7.6592971 46.0000000 100.0000000 KYOUI 58 88.7068966 8.7939545 56.0000000 112.0000000 KODUKAI 163 48871.17 48773.62 0 200000.00 --------------------------------------------------------------------- SAS システム 48 21:49 Wednesday, November 5, 2003 SEX KODUKAI Cum. Cum. Midpoint Freq Freq Percent Percent | F 0 |****** 12 12 5.06 5.06 25000 |************ 24 36 10.13 15.19 50000 |********* 18 54 7.59 22.78 75000 |**** 8 62 3.38 26.16 100000 |** 4 66 1.69 27.85 125000 |** 4 70 1.69 29.54 150000 |* 2 72 0.84 30.38 175000 |* 1 73 0.42 30.80 200000 |* 1 74 0.42 31.22 | M 0 |********************** 44 118 18.57 49.79 25000 |************************ 48 166 20.25 70.04 50000 |************ 23 189 9.70 79.75 75000 |****** 12 201 5.06 84.81 100000 |******* 14 215 5.91 90.72 125000 |**** 8 223 3.38 94.09 150000 |****** 11 234 4.64 98.73 175000 |* 2 236 0.84 99.58 200000 |* 1 237 0.42 100.00 | -----+----+----+----+---- 10 20 30 40 Frequency Variable=SHINTYOU 200 + | | 0 180 + | | | *--+--* | | +-----+ 160 + *--+--* | | +-----+ 0 | 0 140 + ------------+-----------+----------- SEX F M SAS システム 107 21:49 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=TAIJYUU | 100 + * | 0 | | *--+--* 50 + *--+--* +-----+ | 0 | 0 + ------------+-----------+----------- SEX F M SAS システム 108 21:49 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=KYOUI | 150 + | | 0 100 + +-----+ | *--0--* *--+--* | 0 0 50 + * ------------+-----------+----------- SEX F M SAS システム 109 21:49 Wednesday, November 5, 2003 Univariate Procedure Schematic Plots Variable=KODUKAI | 200000 + 0 0 | 0 | | | | 100000 + | | | +--+--+ +-----+ | *-----* *--+--* 0 + | +-----+ ------------+-----------+----------- SEX F M
[論理演算子]