/* Lesson 4-01 */ /* File Name = les0401.sas 05/12/05 */ data naikaku; infile 'naikaku0310.prn' firstobs=2; input name $10. posit $ sex $ tochi yotyokin total honnin kasituke kariire ; proc print data=naikaku(obs=5); run; proc means data=naikaku; var tochi yotyokin total; run; proc univariate data=naikaku plot; : 基礎統計量の算出、plot オプション var tochi yotyokin total; : 指定した変量について計算 run; :
SAS システム 1 08:22 Thursday, May 12, 2005 OBS NAME POSIT SEX TOCHI YOTYOKIN TOTAL HONNIN KASITUKE KARIIRE 1 Koizumi Kakuryou M 10743 2360 13103 13103 0 0 2 Aso Kakuryou M 37772 7750 45522 40273 20100 2000 3 Nozawa Kakuryou M 2315 2114 4429 2912 0 0 4 Kawaguchi Kakuryou F 2266 14330 16596 11344 0 0 5 Kawamura Kakuryou M 6268 2228 8496 5872 0 1000 SAS システム 2 08:22 Thursday, May 12, 2005 Variable N Mean Std Dev Minimum Maximum -------------------------------------------------------------------- TOCHI 60 4077.17 6398.74 0 37772.00 YOTYOKIN 60 1684.12 2530.42 0 14330.00 TOTAL 60 5761.28 7444.75 0 45522.00 -------------------------------------------------------------------- <<< 中略 >>> SAS システム 8 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=YOTYOKIN Moments N 60 Sum Wgts 60 Mean 1684.117 Sum 101047 Std Dev 2530.423 Variance 6403038 Skewness 2.913734 Kurtosis 10.58346 USS 5.4795E8 CSS 3.7778E8 CV 150.2522 Std Mean 326.6761 T:Mean=0 5.15531 Pr>|T| 0.0001 Num ^= 0 53 Num > 0 53 M(Sign) 26.5 Pr>=|M| 0.0001 Sgn Rank 715.5 Pr>=|S| 0.0001 SAS システム 9 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=YOTYOKIN Quantiles(Def=5) 100% Max 14330 99% 14330 75% Q3 1957 95% 6794 50% Med 690.5 90% 4805 25% Q1 275 10% 0 0% Min 0 5% 0 1% 0 Range 14330 Q3-Q1 1682 Mode 0 SAS システム 10 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=YOTYOKIN Extremes Lowest Obs Highest Obs 0( 57) 5254( 11) 0( 42) 5838( 31) 0( 39) 7750( 2) 0( 37) 8548( 17) 0( 35) 14330( 4) SAS システム 11 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=YOTYOKIN Stem Leaf # Boxplot 14 3 1 * 12 10 8 5 1 * 6 8 1 * 4 138838 6 0 2 122494 6 +-----+ 0 000000001112222334444555666667778899903556668 45 *--+--* ----+----+----+----+----+----+----+----+----+ Multiply Stem.Leaf by 10**+3 SAS システム 12 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=YOTYOKIN Normal Probability Plot 15000+ * | | | * + | *+++++++ | +****+*+ | +++++**** 1000+ * * ** **** **************** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 13 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=TOTAL Moments N 60 Sum Wgts 60 Mean 5761.283 Sum 345677 Std Dev 7444.749 Variance 55424294 Skewness 3.595012 Kurtosis 15.27878 USS 5.2616E9 CSS 3.27E9 CV 129.2203 Std Mean 961.113 T:Mean=0 5.994387 Pr>|T| 0.0001 Num ^= 0 59 Num > 0 59 M(Sign) 29.5 Pr>=|M| 0.0001 Sgn Rank 885 Pr>=|S| 0.0001 SAS システム 14 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=TOTAL Quantiles(Def=5) 100% Max 45522 99% 45522 75% Q3 6751.5 95% 21295.5 50% Med 3911 90% 9603.5 25% Q1 1794 10% 1095.5 0% Min 0 5% 646.5 1% 0 Range 45522 Q3-Q1 4957.5 Mode 0 SAS システム 15 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=TOTAL Extremes Lowest Obs Highest Obs 0( 33) 13103( 1) 183( 27) 16596( 4) 526( 24) 25995( 48) 767( 58) 29640( 38) 930( 54) 45522( 2) SAS システム 16 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=TOTAL Histogram # Boxplot 45000+* 1 * . 25000+* 2 * .** 3 0 5000+*************************** 54 +--+--+ ----+----+----+----+----+-- * may represent up to 2 counts SAS システム 17 08:22 Thursday, May 12, 2005 Univariate Procedure Variable=TOTAL Normal Probability Plot 45000+ * | 25000+ * *++++++ | +++++++**+*+++ 5000+ * * ** *************************** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2
[参考] 例えば 1000万円の単位に四捨五入して最頻値を調べる方法もある。 そのためには「round」と言う関数を用いればよい。 このようにして求めた最頻値は 2000万円であった。
tot1000=round(total,1000);
分布形状と統計量