/* Lesson 08-01 */ /* File Name = les0801.sas 06/06/01 */ : data kakuryou; : データの定義 infile 'koizumi.prn' firstobs=2; : 第2行目からが利用対象データ input name $ sex $ real_est savings total loan_som loan_Ban; LABEL real_est='土地・建物(real_estate)' : 各変量の説明 savings='預貯金・有価証券(Savings)' : (漢字も実は使用可) total='合計(Total_Property)' : loan_som='貸付金(Loan_to_Someone)' : loan_Ban='借入金(Loan_from_Banks)' : ; : proc print data=kakuryou(obs=10); : 表示 run; : : proc means data=kakuryou; : 平均の計算 run; : : proc chart data=kakuryou; : ヒストグラム hbar real_est savings total loan_som loan_Ban; : 水平棒グラフ run; : : proc univariate data=kakuryou plot; : 基礎統計量の計算 var total; : 変量 total について run; : : proc sort data=kakuryou; : 並べ替え(ソート) by descending total; : Total の大きい順に run; : : proc print data=kakuryou; : 表示 run; :
SAS システム 1 21:25 Wednesday, June 6, 2001 OBS NAME SEX REAL_EST SAVINGS TOTAL LOAN_SOM LOAN_BAN 1 Koizumi M 3052 1960 5012 0 731 2 Kayayama M 1371 6502 7874 0 2697 3 Moriyama F 6907 5699 12606 0 0 4 Tanaka F 31739 43201 74940 0 0 5 Shiokawa M 54336 2225 56561 7500 0 6 Touyama F 10901 13245 24146 0 2200 7 Sakaguch M 451 2150 2601 0 140 8 Takebe M 2796 2288 5084 0 549 9 Hiranuma M 451 223 4723 0 12682 10 Ohogi F 18354 1200 19554 7102 36000 SAS システム 2 21:25 Wednesday, June 6, 2001 Variable Label N Mean Std Dev ------------------------------------------------------------------- REAL_EST 土地・建物(real_estate) 18 8418.89 13920.12 SAVINGS 預貯金・有価証券(Savings) 18 5814.17 10062.90 TOTAL 合計(Total_Property) 18 14458.06 19845.53 LOAN_SOM 貸付金(Loan_to_Someone) 18 1500.39 3072.27 LOAN_BAN 借入金(Loan_from_Banks) 18 4473.00 8728.67 ------------------------------------------------------------------- SAS システム 3 21:25 Wednesday, June 6, 2001 Variable Label Minimum Maximum --------------------------------------------------------------- REAL_EST 土地・建物(real_estate) 0 54336.00 SAVINGS 預貯金・有価証券(Savings) 0 43201.00 TOTAL 合計(Total_Property) 1620.00 74940.00 LOAN_SOM 貸付金(Loan_to_Someone) 0 9475.00 LOAN_BAN 借入金(Loan_from_Banks) 0 36000.00 --------------------------------------------------------------- SAS システム 4 21:25 Wednesday, June 6, 2001 土地・建物(real_estate) Cum. Cum. Midpoint Freq Freq Percent Percent | 6000 |****************************** 15 15 83.33 83.33 | 18000 |** 1 16 5.56 88.89 | 30000 |** 1 17 5.56 94.44 | 42000 | 0 17 0.00 94.44 | 54000 |** 1 18 5.56 100.00 | ----+---+---+---+---+---+---+-- 2 4 6 8 10 12 14 Frequency SAS システム 5 21:25 Wednesday, June 6, 2001 預貯金・有価証券(Savings) Cum. Cum. Midpoint Freq Freq Percent Percent | 0 |************************** 13 13 72.22 72.22 | 10000 |******** 4 17 22.22 94.44 | 20000 | 0 17 0.00 94.44 | 30000 | 0 17 0.00 94.44 | 40000 |** 1 18 5.56 100.00 | ----+---+---+---+---+---+-- 2 4 6 8 10 12 Frequency SAS システム 6 21:25 Wednesday, June 6, 2001 合計(Total_Property) 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 システム 9 21:25 Wednesday, June 6, 2001 Univariate Procedure Variable=TOTAL 合計(Total_Property) Moments N 18 Sum Wgts 18 Mean 14458.06 Sum 260245 Std Dev 19845.53 Variance 3.9385E8 Skewness 2.414256 Kurtosis 5.389768 USS 1.046E10 CSS 6.6954E9 CV 137.2628 Std Mean 4677.636 T:Mean=0 3.090889 Pr>|T| 0.0066 Num ^= 0 18 Num > 0 18 M(Sign) 9 Pr>=|M| 0.0001 Sgn Rank 85.5 Pr>=|S| 0.0001 SAS システム 10 21:25 Wednesday, June 6, 2001 Univariate Procedure Variable=TOTAL 合計(Total_Property) Quantiles(Def=5) 100% Max 74940 99% 74940 75% Q3 13550 95% 74940 50% Med 6212 90% 56561 25% Q1 4723 10% 2601 0% Min 1620 5% 1620 1% 1620 Range 73320 Q3-Q1 8827 Mode 1620 SAS システム 11 21:25 Wednesday, June 6, 2001 Univariate Procedure Variable=TOTAL 合計(Total_Property) Extremes Lowest Obs Highest Obs 1620( 14) 13550( 11) 2601( 7) 19554( 10) 2808( 17) 24146( 6) 3278( 15) 56561( 5) 4723( 9) 74940( 4) SAS システム 12 21:25 Wednesday, June 6, 2001 Univariate Procedure Variable=TOTAL 合計(Total_Property) 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 SAS システム 13 21:25 Wednesday, June 6, 2001 Univariate Procedure Variable=TOTAL 合計(Total_Property) Normal Probability Plot 75000+ * | +++ | * +++++ | +++++ | +++++ | +++++ * | +++++ * ** 5000+ * * * **+**+** ** * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 14 21:25 Wednesday, June 6, 2001 OBS NAME SEX REAL_EST SAVINGS TOTAL LOAN_SOM LOAN_BAN 1 Tanaka F 31739 43201 74940 0 0 2 Shiokawa M 54336 2225 56561 7500 0 3 Touyama F 10901 13245 24146 0 2200 4 Ohogi F 18354 1200 19554 7102 36000 5 Kawaguch F 1490 12060 13550 0 0 6 Moriyama F 6907 5699 12606 0 0 7 Fukuda M 7272 817 8089 1130 7600 8 Kayayama M 1371 6502 7874 0 2697 9 Murai M 1669 4823 6492 0 260 10 Ishihara M 2347 3585 5932 0 3230 11 Yanagisa M 2475 2900 5375 0 2205 12 Takebe M 2796 2288 5084 0 549 13 Koizumi M 3052 1960 5012 0 731 14 Hiranuma M 451 223 4723 0 12682 15 Omi M 3278 0 3278 1800 1764 16 Takenaka M 2651 157 2808 9475 10456 17 Sakaguch M 451 2150 2601 0 140 18 Nakaya M 0 1620 1620 0 0
/* Lesson 08-02 */ /* File Name = les0802.sas 06/06/01 */ (中略) : proc sort data=kakuryou; : 並べ替え(ソート) by sex; : 性別ごとに run; : : proc means data=kakuryou; : 平均の計算 by sex; : 性別ごとに run; : : proc chart data=kakuryou; : ヒストグラム hbar total; : 変量 total について by sex; : 性別ごとに run; : : proc chart data=kakuryou; : ヒストグラム hbar total/group=sex; : 性別ごとに併置して run; : : proc univariate data=kakuryou plot; : 基礎統計量の計算 var total; : 変量 total について by sex; : 性別ごとに run; :
SAS システム 16 22:01 Wednesday, June 6, 2001 --------------------------------- SEX=F -------------------------------- Variable Label N Mean Std Dev ------------------------------------------------------------------- REAL_EST 土地・建物(real_estate) 5 13878.20 11725.72 SAVINGS 預貯金・有価証券(Savings) 5 15081.00 16461.59 TOTAL 合計(Total_Property) 5 28959.20 26128.19 LOAN_SOM 貸付金(Loan_to_Someone) 5 1420.40 3176.11 LOAN_BAN 借入金(Loan_from_Banks) 5 7640.00 15882.32 ------------------------------------------------------------------- SAS システム 17 22:01 Wednesday, June 6, 2001 --------------------------------- SEX=F -------------------------------- Variable Label Minimum Maximum --------------------------------------------------------------- REAL_EST 土地・建物(real_estate) 1490.00 31739.00 SAVINGS 預貯金・有価証券(Savings) 1200.00 43201.00 TOTAL 合計(Total_Property) 12606.00 74940.00 LOAN_SOM 貸付金(Loan_to_Someone) 0 7102.00 LOAN_BAN 借入金(Loan_from_Banks) 0 36000.00 --------------------------------------------------------------- SAS システム 18 22:01 Wednesday, June 6, 2001 --------------------------------- SEX=M -------------------------------- Variable Label N Mean Std Dev ------------------------------------------------------------------- REAL_EST 土地・建物(real_estate) 13 6319.15 14542.42 SAVINGS 預貯金・有価証券(Savings) 13 2250.00 1893.04 TOTAL 合計(Total_Property) 13 8880.69 14459.23 LOAN_SOM 貸付金(Loan_to_Someone) 13 1531.15 3163.13 LOAN_BAN 借入金(Loan_from_Banks) 13 3254.92 4250.45 ------------------------------------------------------------------- SAS システム 19 22:01 Wednesday, June 6, 2001 --------------------------------- SEX=M -------------------------------- Variable Label Minimum Maximum --------------------------------------------------------------- REAL_EST 土地・建物(real_estate) 0 54336.00 SAVINGS 預貯金・有価証券(Savings) 0 6502.00 TOTAL 合計(Total_Property) 1620.00 56561.00 LOAN_SOM 貸付金(Loan_to_Someone) 0 9475.00 LOAN_BAN 借入金(Loan_from_Banks) 0 12682.00 --------------------------------------------------------------- SAS システム 20 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- 合計(Total_Property) Cum. Cum. Midpoint Freq Freq Percent Percent | 10000 |****************************** 3 3 60.00 60.00 | 30000 |********** 1 4 20.00 80.00 | 50000 | 0 4 0.00 80.00 | 70000 |********** 1 5 20.00 100.00 | ----------+---------+---------+ 1 2 3 Frequency SAS システム 21 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- 合計(Total_Property) Cum. Cum. Midpoint Freq Freq Percent Percent | 7500 |************************ 12 12 92.31 92.31 | 22500 | 0 12 0.00 92.31 | 37500 | 0 12 0.00 92.31 | 52500 |** 1 13 7.69 100.00 | ----+---+---+---+---+---+ 2 4 6 8 10 12 Frequency SAS システム 22 22:01 Wednesday, June 6, 2001 SEX 合計(Total_Property) Cum. Cum. Midpoint Freq Freq Percent Percent | F 7500 |**** 2 2 11.11 11.11 22500 |**** 2 4 11.11 22.22 37500 | 0 4 0.00 22.22 52500 | 0 4 0.00 22.22 67500 |** 1 5 5.56 27.78 | M 7500 |************************ 12 17 66.67 94.44 22500 | 0 17 0.00 94.44 37500 | 0 17 0.00 94.44 52500 |** 1 18 5.56 100.00 67500 | 0 18 0.00 100.00 | ----+---+---+---+---+---+ 2 4 6 8 10 12 SAS システム 23 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Moments N 5 Sum Wgts 5 Mean 28959.2 Sum 144796 Std Dev 26128.19 Variance 6.8268E8 Skewness 2.061196 Kurtosis 4.354341 USS 6.9239E9 CSS 2.7307E9 CV 90.22414 Std Mean 11684.88 T:Mean=0 2.478348 Pr>|T| 0.0683 Num ^= 0 5 Num > 0 5 M(Sign) 2.5 Pr>=|M| 0.0625 SAS システム 24 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Sgn Rank 7.5 Pr>=|S| 0.0625 SAS システム 25 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Quantiles(Def=5) 100% Max 74940 99% 74940 75% Q3 24146 95% 74940 50% Med 19554 90% 74940 25% Q1 13550 10% 12606 0% Min 12606 5% 12606 1% 12606 Range 62334 Q3-Q1 10596 Mode 12606 SAS システム 26 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Extremes Lowest Obs Highest Obs 12606( 5) 12606( 5) 13550( 4) 13550( 4) 19554( 3) 19554( 3) 24146( 2) 24146( 2) 74940( 1) 74940( 1) SAS システム 27 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Stem Leaf # Boxplot 7 5 1 * 6 5 4 3 2 04 2 +--+--+ 1 34 2 +-----+ ----+----+----+----+ Multiply Stem.Leaf by 10**+4 SAS システム 28 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Normal Probability Plot 75000+ * ++++ | ++++ | +++ 45000+ ++++ | ++++ | ++++ * 15000+ * ++*+ * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 29 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Moments N 13 Sum Wgts 13 Mean 8880.692 Sum 115449 Std Dev 14459.23 Variance 2.0907E8 Skewness 3.489131 Kurtosis 12.40015 USS 3.5341E9 CSS 2.5088E9 CV 162.8164 Std Mean 4010.268 T:Mean=0 2.214489 Pr>|T| 0.0469 Num ^= 0 13 Num > 0 13 M(Sign) 6.5 Pr>=|M| 0.0002 SAS システム 30 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Sgn Rank 45.5 Pr>=|S| 0.0002 SAS システム 31 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Quantiles(Def=5) 100% Max 56561 99% 56561 75% Q3 6492 95% 56561 50% Med 5084 90% 8089 25% Q1 3278 10% 2601 0% Min 1620 5% 1620 1% 1620 Range 54941 Q3-Q1 3214 Mode 1620 SAS システム 32 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Extremes Lowest Obs Highest Obs 1620( 13) 5932( 5) 2601( 12) 6492( 4) 2808( 11) 7874( 3) 3278( 10) 8089( 2) 4723( 9) 56561( 1) SAS システム 33 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Stem Leaf # Boxplot 5 7 1 * 4 3 2 1 0 233355556688 12 +--+--+ ----+----+----+----+ Multiply Stem.Leaf by 10**+4 SAS システム 34 22:01 Wednesday, June 6, 2001 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TOTAL 合計(Total_Property) Normal Probability Plot 55000+ * | ++++ | +++++++ | +++++++ | +++++++ 5000+ * * * *+*+*+* * * * * * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 35 22:01 Wednesday, June 6, 2001 Univariate Procedure Schematic Plots Variable=TOTAL 合計(Total_Property) 75000 + * | | * 50000 + | | 25000 + +--+--+ | *-----* | *--+--* 0 + +-----+ ------------+-----------+----------- SEX F M
Variable Label N Mean Std Dev ------------------------------------------------------------------- TOTAL 合計(Total_Property) 12 4907.33 2044.23 ------------------------------------------------------------------- Variable Label Minimum Maximum --------------------------------------------------------------- TOTAL 合計(Total_Property) 1620.00 8089.00 --------------------------------------------------------------- 合計(Total_Property) Cum. Cum. Midpoint Freq Freq Percent Percent | 2000 |*************** 3 3 25.00 25.00 4000 |********** 2 5 16.67 41.67 6000 |************************* 5 10 41.67 83.33 8000 |********** 2 12 16.67 100.00 | -----+----+----+----+----+ 1 2 3 4 5 Frequency Variable=TOTAL 合計(Total_Property) Stem Leaf # Boxplot 8 1 1 | 7 9 1 | 6 5 1 +-----+ 5 0149 4 *-----* 4 7 1 | + | 3 3 1 +-----+ 2 68 2 | 1 6 1 | ----+----+----+----+ Multiply Stem.Leaf by 10**+3