/* Lesson 11-1 */ /* File Name = les1101.sas 06/27/02 */ data gakusei; infile 'all02.prn' firstobs=2; input sex $ height weight chest jitaku $ kodukai carrier $ tsuuwa; proc print data=gakusei(obs=10); run; proc ttest data=gakusei; : t検定 class sex; : 分類したい特性変数の指定 var height weight chest kodukai; : 比較したい変量名 run; :
SAS システム 2 15:02 Monday, June 17, 2002 TTEST PROCEDURE Variable: HEIGHT SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 72 159.27638889 5.68674003 0.67018874 M 161 172.09751553 5.38639432 0.42450734 Variances T DF Prob>|T| --------------------------------------- Unequal -16.1613 130.1 0.0001 Equal -16.5010 231.0 0.0000 For H0: Variances are equal, F' = 1.11 DF = (71,160) Prob>F' = 0.5711 SAS システム 3 15:02 Monday, June 17, 2002 TTEST PROCEDURE Variable: WEIGHT SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 49 48.36734694 4.94424698 0.70632100 M 161 62.10062112 7.75751649 0.61137795 Variances T DF Prob>|T| --------------------------------------- Unequal -14.7011 125.7 0.0001 Equal -11.6803 208.0 0.0000 For H0: Variances are equal, F' = 2.46 DF = (160,48) Prob>F' = 0.0005 SAS システム 4 15:02 Monday, June 17, 2002 TTEST PROCEDURE Variable: CHEST SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 26 83.30769231 4.51459173 0.88538428 M 55 88.65454545 8.42662927 1.13624646 Variances T DF Prob>|T| --------------------------------------- Unequal -3.7119 77.6 0.0004 Equal -3.0297 79.0 0.0033 For H0: Variances are equal, F' = 3.48 DF = (54,25) Prob>F' = 0.0011 SAS システム 5 15:02 Monday, June 17, 2002 TTEST PROCEDURE Variable: KODUKAI SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 67 51619.40298507 52047.69735193 6358.63826551 M 152 51223.68421053 53478.74460087 4337.69897472 Variances T DF Prob>|T| --------------------------------------- Unequal 0.0514 129.5 0.9591 Equal 0.0509 217.0 0.9595 For H0: Variances are equal, F' = 1.06 DF = (151,66) Prob>F' = 0.8172
/* Lesson 11-2 */ /* File Name = les1102.sas 06/27/02 */ data gakusei; infile 'all02.prn' firstobs=2; input sex $ height weight chest jitaku $ kodukai carrier $ tsuuwa; proc print data=gakusei(obs=10); run; proc npar1way data=gakusei wilcoxon; : wilcoxon 検定 class sex; : 分類したい特性変数の指定 var height weight chest kodukai; : 比較したい変量名 run; :
SAS システム 2 15:02 Monday, June 17, 2002 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 SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 72 3141.5000 8424.0 475.103687 43.631944 M 161 24119.5000 18837.0 475.103687 149.810559 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 3 15:02 Monday, June 17, 2002 N P A R 1 W A Y P R O C E D U R E S = 3141.50 Z = -11.1176 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 123.62 DF = 1 Prob > CHISQ = 0.0001 SAS システム 4 15:02 Monday, June 17, 2002 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 SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 49 1536.5000 5169.5000 372.029119 31.357143 M 161 20618.5000 16985.5000 372.029119 128.065217 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 5 15:02 Monday, June 17, 2002 N P A R 1 W A Y P R O C E D U R E S = 1536.50 Z = -9.76402 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 95.362 DF = 1 Prob > CHISQ = 0.0001 SAS システム 6 15:02 Monday, June 17, 2002 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 SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 26 697.0 1066.0 98.3711595 26.8076923 M 55 2624.0 2255.0 98.3711595 47.7090909 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 7 15:02 Monday, June 17, 2002 N P A R 1 W A Y P R O C E D U R E S = 697.000 Z = -3.74602 Prob > |Z| = 0.0002 T-Test Approx. Significance = 0.0003 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 14.071 DF = 1 Prob > CHISQ = 0.0002 SAS システム 8 15:02 Monday, June 17, 2002 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 SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 67 7671.0 7370.0 429.740361 114.492537 M 152 16419.0 16720.0 429.740361 108.019737 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 9 15:02 Monday, June 17, 2002 N P A R 1 W A Y P R O C E D U R E S = 7671.00 Z = 0.699259 Prob > |Z| = 0.4844 T-Test Approx. Significance = 0.4851 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 0.49059 DF = 1 Prob > CHISQ = 0.4837
/* Lesson 11-3 */ /* File Name = les1103.sas 06/27/02 */ 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; : run; : proc univariate data=pair plot; : var dif; : 差について run; :
SAS システム 1 15:02 Monday, June 17, 2002 OBS X Y DIF 1 3.51 3.39 0.12 2 3.07 3.39 -0.32 3 3.29 3.20 0.09 4 3.03 3.11 -0.08 5 3.38 3.17 0.21 6 3.30 3.09 0.21 7 3.15 3.17 -0.02 8 3.25 3.09 0.16 SAS システム 2 15:02 Monday, June 17, 2002 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 15:02 Monday, June 17, 2002 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 15:02 Monday, June 17, 2002 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 15:02 Monday, June 17, 2002 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 15:02 Monday, June 17, 2002 Univariate Procedure Variable=DIF Normal Probability Plot 0.25+ *++++* | *++*+++ | *++++ -0.05+ *+++*++ | +++++ | ++++++ -0.35+ +++++ * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2
data gakusei; infile 'all02.prn' firstobs=2; input sex $ height weight chest jitaku $ kodukai carrier $ tsuuwa; dekasa=height+weight+chest; : 変量間の加減乗除 ch_2=chest**2; : 二乗 ch_sr=sqrt(chest); : ルート taiseki=ch_2*height :
[算術演算子]
[数値関数]