/* Lesson 11-1 */ /* File Name = les1101.sas 06/28/01 */ data gakusei; infile 'all01.prn'; 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 13:59 Wednesday, June 20, 2001 TTEST PROCEDURE Variable: HEIGHT SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 55 159.42545455 5.52999291 0.74566409 M 141 172.13687943 5.37477456 0.45263767 Variances T DF Prob>|T| --------------------------------------- Unequal -14.5724 96.1 0.0001 Equal -14.7565 194.0 0.0000 For H0: Variances are equal, F' = 1.06 DF = (54,140) Prob>F' = 0.7755 SAS システム 3 13:59 Wednesday, June 20, 2001 TTEST PROCEDURE Variable: WEIGHT SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 34 49.52941176 4.48218895 0.76868906 M 141 62.40921986 7.76023656 0.65352981 Variances T DF Prob>|T| --------------------------------------- Unequal -12.7655 87.2 0.0001 Equal -9.2979 173.0 0.0000 For H0: Variances are equal, F' = 3.00 DF = (140,33) Prob>F' = 0.0005 SAS システム 4 13:59 Wednesday, June 20, 2001 TTEST PROCEDURE Variable: CHEST SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 19 83.63157895 4.31033031 0.98885759 M 53 88.96226415 8.38488169 1.15175208 Variances T DF Prob>|T| --------------------------------------- Unequal -3.5116 61.1 0.0008 Equal -2.6404 70.0 0.0102 For H0: Variances are equal, F' = 3.78 DF = (52,18) Prob>F' = 0.0031 SAS システム 5 13:59 Wednesday, June 20, 2001 TTEST PROCEDURE Variable: KODUKAI SEIBETSU N Mean Std Dev Std Error ---------------------------------------------------------------------- F 51 51441.17647059 56335.83646835 7888.59498237 M 133 52842.10526316 50334.31297039 4364.53845858 Variances T DF Prob>|T| --------------------------------------- Unequal -0.1554 82.4 0.8769 Equal -0.1634 182.0 0.8704 For H0: Variances are equal, F' = 1.25 DF = (50,132) Prob>F' = 0.3138
/* Lesson 11-2 */ /* File Name = les1102.sas 06/28/01 */ data gakusei; infile 'all01.prn'; 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 14:00 Wednesday, June 20, 2001 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 F 55 1854.0 5417.5000 356.511049 33.709091 M 141 17452.0 13888.5000 356.511049 123.773050 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 3 14:00 Wednesday, June 20, 2001 N P A R 1 W A Y P R O C E D U R E S = 1854.00 Z = -9.99408 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 99.910 DF = 1 Prob > CHISQ = 0.0001 SAS システム 4 14:00 Wednesday, June 20, 2001 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 F 34 797.0 2992.0 264.785469 23.441176 M 141 14603.0 12408.0 264.785469 103.567376 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 5 14:00 Wednesday, June 20, 2001 N P A R 1 W A Y P R O C E D U R E S = 797.000 Z = -8.28784 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 68.720 DF = 1 Prob > CHISQ = 0.0001 SAS システム 6 14:00 Wednesday, June 20, 2001 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 F 19 420.50000 693.50000 77.9397295 22.1315789 M 53 2207.50000 1934.50000 77.9397295 41.6509434 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 7 14:00 Wednesday, June 20, 2001 N P A R 1 W A Y P R O C E D U R E S = 420.500 Z = -3.49629 Prob > |Z| = 0.0005 T-Test Approx. Significance = 0.0008 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 12.269 DF = 1 Prob > CHISQ = 0.0005 SAS システム 8 14:00 Wednesday, June 20, 2001 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 F 51 4692.0 4717.5000 321.585105 92.0000000 M 133 12328.0 12302.5000 321.585105 92.6917293 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 9 14:00 Wednesday, June 20, 2001 N P A R 1 W A Y P R O C E D U R E S = 4692.00 Z = -.077740 Prob > |Z| = 0.9380 T-Test Approx. Significance = 0.9381 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 0.00629 DF = 1 Prob > CHISQ = 0.9368
/* Lesson 11-3 */ /* File Name = les1103.sas 06/28/01 */ data pair; : input x y @@; : @@ は 1行に複数のデータがあることを示す dif=x-y; : 差(difference)を計算する cards; : データをプログラム内に記述する 3.51 3.39 3.07 3.39 3.29 3.20 3.03 3.11 : x1,y1, x2,y2, x3,y3, x4,y4, 3.38 3.17 3.30 3.09 3.15 3.17 3.25 3.09 : x5,y5, x6,y6, x7,y7, x8,y8 ; : : proc print data=pair(obs=10); : run; : proc univariate data=pair plot; : var dif; : 差について run; :
SAS システム 2 08:22 Thursday, June 21, 2001 Univariate Procedure Variable=DIF Moments N 8 Sum Wgts 8 Mean 0.04625 Sum 0.37 Std Dev 0.180629 Variance 0.032627 Skewness -1.31523 Kurtosis 1.511099 USS 0.2455 CSS 0.228388 CV 390.5489 Std Mean 0.063862 T:Mean=0 0.724218 Pr>|T| 0.4924 Num ^= 0 8 Num > 0 5 M(Sign) 1 Pr>=|M| 0.7266 Sgn Rank 7 Pr>=|S| 0.3594 SAS システム 3 08:22 Thursday, June 21, 2001 Univariate Procedure Variable=DIF Quantiles(Def=5) 100% Max 0.21 99% 0.21 75% Q3 0.185 95% 0.21 50% Med 0.105 90% 0.21 25% Q1 -0.05 10% -0.32 0% Min -0.32 5% -0.32 1% -0.32 Range 0.53 Q3-Q1 0.235 Mode 0.21 SAS システム 4 08:22 Thursday, June 21, 2001 Univariate Procedure Variable=DIF Extremes Lowest Obs Highest Obs -0.32( 2) 0.09( 3) -0.08( 4) 0.12( 1) -0.02( 7) 0.16( 8) 0.09( 3) 0.21( 5) 0.12( 1) 0.21( 6) SAS システム 5 08:22 Thursday, June 21, 2001 Univariate Procedure Variable=DIF Stem Leaf # Boxplot 2 11 2 | 1 26 2 +-----+ 0 9 1 | + | -0 82 2 +-----+ -1 | -2 | -3 2 1 | ----+----+----+----+ Multiply Stem.Leaf by 10**-1 SAS システム 6 08:22 Thursday, June 21, 2001 Univariate Procedure Variable=DIF Normal Probability Plot 0.25+ *++++* | *++*+++ | *++++ -0.05+ *+++*++ | +++++ | ++++++ -0.35+ +++++ * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2