/* Lesson 4-1 */ /* File Name = les0401.sas 10/30/03 */ data naikaku; infile 'naikaku01.prn' firstobs=2; input name $15. sex $ goukei tochi : 文字列長の指定方法 yotyokin kasituke kariire; : 長い場合は 2行に。最後はセミコロン proc print data=naikaku; run; proc means data=naikaku; : 変量を指定しないと全数値変量が対象 run; : proc chart data=naikaku; : ヒストグラムを描く hbar goukei; : 水平棒グラフで。変量を指定。 vbar goukei; : 垂直棒グラフで。変量を指定。 run;
SAS システム 1 20:45 Thursday, October 30, 2003 OBS NAME SEX GOUKEI TOCHI YOTYOKIN KASITUKE KARIIRE 1 Koizumi M 5012 3052 1960 0 731 2 Katayama M 7874 1371 6502 0 2697 3 Moriyama F 12606 6907 5699 0 0 4 Tanaka F 74940 31739 43201 0 0 5 Shiokawa M 56561 54336 2225 7500 0 6 Touyama F 24146 10901 13245 0 2200 7 Sakaguchi M 2601 451 2150 0 140 8 Takebe M 5084 2796 2288 0 549 9 Hiranuma M 4723 451 223 0 12682 10 Ohogi F 19554 18354 1200 7102 36000 11 Kawaguchi F 13550 1490 12060 0 0 12 Fukuda M 8089 7272 817 1130 7600 13 Murai M 6492 1669 4823 0 260 14 Nakatani M 1620 0 1620 0 0 15 Omi M 3278 3278 0 1800 1764 SAS システム 2 20:45 Thursday, October 30, 2003 OBS NAME SEX GOUKEI TOCHI YOTYOKIN KASITUKE KARIIRE 16 Yanagisawa M 5375 2475 2900 0 2205 17 Takenaka M 2808 2651 157 9475 10456 18 Ishihara M 5932 2347 3585 0 3230 SAS システム 3 20:45 Thursday, October 30, 2003 Variable N Mean Std Dev Minimum Maximum -------------------------------------------------------------------- GOUKEI 18 14458.06 19845.53 1620.00 74940.00 TOCHI 18 8418.89 13920.12 0 54336.00 YOTYOKIN 18 5814.17 10062.90 0 43201.00 KASITUKE 18 1500.39 3072.27 0 9475.00 KARIIRE 18 4473.00 8728.67 0 36000.00 -------------------------------------------------------------------- SAS システム 4 20:45 Thursday, October 30, 2003 GOUKEI Cum. Cum. Midpoint Freq Freq Percent Percent | 7500 |**************************** 14 14 77.78 77.78 | 22500 |**** 2 16 11.11 88.89 | 37500 | 0 16 0.00 88.89 | 52500 |** 1 17 5.56 94.44 | 67500 |** 1 18 5.56 100.00 | ----+---+---+---+---+---+---+ 2 4 6 8 10 12 14 Frequency SAS システム 5 20:45 Thursday, October 30, 2003 Frequency | ***** 12 + ***** | ***** 8 + ***** | ***** 4 + ***** | ***** ***** ***** ***** -------------------------------------------------------------------- 7500 22500 37500 52500 67500 GOUKEI Midpoint
/* Lesson 4-2 */ /* File Name = les0402.sas 10/30/03 */ data naikaku; infile 'naikaku01.prn' firstobs=2; input name $15. sex $ goukei tochi yotyokin kasituke kariire; proc print data=naikaku(obs=5); : 先頭の 5ケースだけを表示。確認用 run; proc means data=naikaku; run; proc chart data=naikaku; hbar goukei; vbar goukei; run; proc chart data=naikaku; hbar goukei / midpoints=10000 to 80000 by 10000; : 軸の値を指定 vbar goukei / midpoints=20000 to 80000 by 20000; : 軸の値を指定 run;
SAS システム 1 20:58 Thursday, October 30, 2003 OBS NAME SEX GOUKEI TOCHI YOTYOKIN KASITUKE KARIIRE 1 Koizumi M 5012 3052 1960 0 731 2 Katayama M 7874 1371 6502 0 2697 3 Moriyama F 12606 6907 5699 0 0 4 Tanaka F 74940 31739 43201 0 0 5 Shiokawa M 56561 54336 2225 7500 0 SAS システム 5 20:58 Thursday, October 30, 2003 GOUKEI Cum. Cum. Midpoint Freq Freq Percent Percent | 10000 |**************************** 14 14 77.78 77.78 20000 |**** 2 16 11.11 88.89 30000 | 0 16 0.00 88.89 40000 | 0 16 0.00 88.89 50000 | 0 16 0.00 88.89 60000 |** 1 17 5.56 94.44 70000 |** 1 18 5.56 100.00 80000 | 0 18 0.00 100.00 | ----+---+---+---+---+---+---+ 2 4 6 8 10 12 14 Frequency SAS システム 6 20:58 Thursday, October 30, 2003 Frequency 16 + ***** | ***** 12 + ***** | ***** 8 + ***** | ***** 4 + ***** | ***** ***** ***** -------------------------------------------------------- 20000 40000 60000 80000 GOUKEI Midpoint
data naikaku; infile 'naikaku03.prn' firstobs=3; input name $12. tantou $16. position $10. sex $ tochi yotyokin goukei honnin kasituke kariire;
/* Lesson 4-7 */ /* File Name = les0407.sas 10/30/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; : 基礎統計量の算出、plot オプション var shintyou taijyuu kyoui kodukai; : 指定した変量について計算 run; :
SAS システム 1 18:42 Wednesday, October 29, 2003 OBS SEX SHINTYOU TAIJYUU KYOUI JITAKU KODUKAI CARRYER TSUUWA 1 F 145.0 38 . J 10000 . 2 F 148.0 42 . J 50000 . 3 F 148.0 43 80 J 50000 DoCoMo 4000 4 F 148.9 . . J 60000 . 5 F 149.0 45 . G 60000 . SAS システム 2 18:42 Wednesday, October 29, 2003 Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 255 168.0270588 8.0840378 145.0000000 186.0000000 TAIJYUU 229 58.7851528 9.0851888 35.0000000 100.0000000 KYOUI 87 86.9080460 7.9863724 56.0000000 112.0000000 KODUKAI 241 51566.39 52037.20 0 300000.00 TSUUWA 48 7961.46 5011.73 200.0000000 30000.00 --------------------------------------------------------------------- SAS システム 3 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=SHINTYOU Moments N 255 Sum Wgts 255 Mean 168.0271 Sum 42846.9 Std Dev 8.084038 Variance 65.35167 Skewness -0.38817 Kurtosis -0.25474 USS 7216038 CSS 16599.32 CV 4.811152 Std Mean 0.506242 T:Mean=0 331.9105 Pr>|T| 0.0001 Num ^= 0 255 Num > 0 255 M(Sign) 127.5 Pr>=|M| 0.0001 Sgn Rank 16320 Pr>=|S| 0.0001 SAS システム 4 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=SHINTYOU Quantiles(Def=5) 100% Max 186 99% 184 75% Q3 173.5 95% 180 50% Med 169.3 90% 178 25% Q1 162 10% 156 0% Min 145 5% 153 1% 148 Range 41 Q3-Q1 11.5 Mode 170 SAS システム 5 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=SHINTYOU Extremes Lowest Obs Highest Obs 145( 1) 182( 251) 148( 3) 183( 252) 148( 2) 184( 253) 148.9( 4) 185( 254) 149( 5) 186( 255) SAS システム 6 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=SHINTYOU Missing Value . Count 10 % Count/Nobs 3.77 SAS システム 7 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=SHINTYOU Histogram # Boxplot 187.5+* 2 | .******** 16 | .****************** 36 | .************************************ 72 +-----+ 167.5+************************* 50 *--+--* .******************** 40 +-----+ .************ 23 | .****** 11 | 147.5+*** 5 | ----+----+----+----+----+----+----+- * may represent up to 2 counts SAS システム 8 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=SHINTYOU Normal Probability Plot 187.5+ ++++* | *****+*** | ******** | ********* 167.5+ ******++ | ******+ | +****** | ++****** 147.5+*++** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 21 18:42 Wednesday, October 29, 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 18:42 Wednesday, October 29, 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 システム 23 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=KODUKAI Extremes Lowest Obs Highest Obs 0( 261) 180000( 17) 0( 255) 200000( 56) 0( 254) 200000( 184) 0( 249) 300000( 87) 0( 245) 300000( 234) SAS システム 24 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=KODUKAI Missing Value . Count 24 % Count/Nobs 9.06 SAS システム 25 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=KODUKAI Histogram # Boxplot 325000+* 2 * . .* 2 0 175000+****** 16 0 .*********** 31 | .***************** 50 +--+--+ 25000+*********************************************** 140 *-----* ----+----+----+----+----+----+----+----+----+-- * may represent up to 3 counts SAS システム 26 18:42 Wednesday, October 29, 2003 Univariate Procedure Variable=KODUKAI Normal Probability Plot 325000+ * | | ** 175000+ ********++++ | ******+++++ | ++*******+ 25000+* ************************** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2
分布形状と統計量