さて、前期を通して、データの電子化やおおまかな SAS のプログラミングについて 計算機を使ったデータ解析の基礎を紹介してきたつもりである。
今回は、後期の講義の進め方と提出されたレポートに付記された要望について 応えた後、SAS を思い出してもらう意味を込めて、 単変量の集計としてよく利用される平均値の検定方法について紹介する。
以下の日程と講義内容は案です。決定ではありません。
冬季休業
/* Lesson 10-1 */ /* File Name = les1001.sas 09/30/99 */ data gakusei; infile 'all99.dat'; input seibetsu $ height weight chest jitaku $ kodukai; proc print data=gakusei(obs=10); run; proc ttest data=gakusei; : t検定 class seibetsu; : 分類したい特性変数の指定 var height weight chest kodukai; : 比較したい変量名 run; :
SAS システム 2 21:41 Wednesday, September 29, 1999 TTEST PROCEDURE Variable: HEIGHT SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 25 159.37200000 5.76848623 1.15369725 M 83 171.47710843 4.97389099 0.54595546 Variances T DF Prob>|T| --------------------------------------- Unequal -9.4841 35.4 0.0001 Equal -10.2739 106.0 0.0000 For H0: Variances are equal, F' = 1.35 DF = (24,82) Prob>F' = 0.3262 SAS システム 3 21:41 Wednesday, September 29, 1999 TTEST PROCEDURE Variable: WEIGHT SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 8 47.87500000 5.43631966 1.92202925 M 83 61.85180723 6.70304557 0.73575484 Variances T DF Prob>|T| --------------------------------------- Unequal -6.7913 9.2 0.0001 Equal -5.7098 89.0 0.0000 For H0: Variances are equal, F' = 1.52 DF = (82,7) Prob>F' = 0.5862 SAS システム 4 21:41 Wednesday, September 29, 1999 TTEST PROCEDURE Variable: CHEST SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 2 83.50000000 2.12132034 1.50000000 M 31 90.22580645 6.17365196 1.10882062 Variances T DF Prob>|T| --------------------------------------- Unequal -3.6057 2.4 0.0571 Equal -1.5150 31.0 0.1399 For H0: Variances are equal, F' = 8.47 DF = (30,1) Prob>F' = 0.5329 SAS システム 5 21:41 Wednesday, September 29, 1999 TTEST PROCEDURE Variable: KODUKAI SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 22 32431.81818182 31016.23824115 6612.68421167 M 76 55368.42105263 54154.55465124 6211.95344887 Variances T DF Prob>|T| --------------------------------------- Unequal -2.5281 61.1 0.0141 Equal -1.8942 96.0 0.0612 For H0: Variances are equal, F' = 3.05 DF = (75,21) Prob>F' = 0.0056
SAS システム 8 15:45 Thursday, November 21, 1996 TTEST PROCEDURE Variable: SHINTYOU SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 180 157.55277778 4.71964195 0.35178134 M 37 170.92162162 5.29460601 0.87042787 Variances T DF Prob>|T| --------------------------------------- Unequal -14.2400 48.5 0.0001 Equal -15.3635 215.0 0.0000 For H0: Variances are equal, F' = 1.26 DF = (36,179) Prob>F' = 0.3334 SAS システム 9 15:45 Thursday, November 21, 1996 TTEST PROCEDURE Variable: TAIJYUU SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 53 48.54716981 4.83169041 0.66368372 M 37 63.51081081 7.69479564 1.26501661 Variances T DF Prob>|T| --------------------------------------- Unequal -10.4747 55.6 0.0001 Equal -11.3283 88.0 0.0000 For H0: Variances are equal, F' = 2.54 DF = (36,52) Prob>F' = 0.0022 SAS システム 10 15:45 Thursday, November 21, 1996 TTEST PROCEDURE Variable: KYOUI SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 26 81.96153846 3.13024944 0.61389242 M 14 92.57142857 6.83558884 1.82688796 Variances T DF Prob>|T| --------------------------------------- Unequal -5.5051 16.0 0.0001 Equal -6.7578 38.0 0.0000 For H0: Variances are equal, F' = 4.77 DF = (13,25) Prob>F' = 0.0008 SAS システム 11 15:45 Thursday, November 21, 1996 TTEST PROCEDURE Variable: KOZUKAI SEIBETSU N Mean Std Dev Std Error --------------------------------------------------------------------- F 142 48598.59154930 44311.12756826 3718.50722204 M 27 55925.92592593 50019.93904429 9626.34175736 Variances T DF Prob>|T| --------------------------------------- Unequal -0.7100 34.2 0.4825 Equal -0.7713 167.0 0.4416 For H0: Variances are equal, F' = 1.27 DF = (26,141) Prob>F' = 0.3727
/* Lesson 10-2 */ /* File Name = les1002.sas 09/30/99 */ data gakusei; infile 'all99.dat'; input seibetsu $ height weight chest jitaku $ kodukai; proc print data=gakusei(obs=10); run; proc npar1way data=gakusei wilcoxon; : wilcoxon 検定 class seibetsu; : 分類したい特性変数の指定 var height weight chest kodukai; : 比較したい変量名 run; :
SAS システム 2 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable HEIGHT Classified by Variable SEIBETSU Sum of Expected Std Dev Mean SEIBETSU N Scores Under H0 Under H0 Score M 83 5461.0 4523.50000 137.083201 65.7951807 F 25 425.0 1362.50000 137.083201 17.0000000 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 3 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E S = 425.000 Z = -6.83526 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 46.771 DF = 1 Prob > CHISQ = 0.0001 SAS システム 4 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable WEIGHT Classified by Variable SEIBETSU Sum of Expected Std Dev Mean SEIBETSU N Scores Under H0 Under H0 Score M 83 4133.50000 3818.0 71.1620243 49.8012048 F 8 52.50000 368.0 71.1620243 6.5625000 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 5 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E S = 52.5000 Z = -4.42652 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 19.656 DF = 1 Prob > CHISQ = 0.0001 SAS システム 6 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable CHEST Classified by Variable SEIBETSU Sum of Expected Std Dev Mean SEIBETSU N Scores Under H0 Under H0 Score M 31 549.500000 527.0 13.1035720 17.7258065 F 2 11.500000 34.0 13.1035720 5.7500000 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 7 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E S = 11.5000 Z = -1.67893 Prob > |Z| = 0.0932 T-Test Approx. Significance = 0.1029 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 2.9484 DF = 1 Prob > CHISQ = 0.0860 SAS システム 8 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable KODUKAI Classified by Variable SEIBETSU Sum of Expected Std Dev Mean SEIBETSU N Scores Under H0 Under H0 Score M 76 3895.0 3762.0 116.441284 51.2500000 F 22 956.0 1089.0 116.441284 43.4545455 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 9 22:03 Wednesday, September 29, 1999 N P A R 1 W A Y P R O C E D U R E S = 956.000 Z = -1.13791 Prob > |Z| = 0.2552 T-Test Approx. Significance = 0.2580 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 1.3046 DF = 1 Prob > CHISQ = 0.2534