/* Lesson 10-1 */ /* File Name = les1001.sas 06/12/08 */ data gakusei; infile 'all08ae.prn' firstobs=2; input sex $ shintyou taijyuu kyoui jitaku $ kodukai carryer $ tsuuwa; if sex^='M' & sex^='F' then delete; : 性別不明は除外する proc print data=gakusei(obs=5); run; proc sort data=gakusei; by sex; run; proc univariate data=gakusei plot; var shintyou taijyuu kyoui kodukai; by sex; run;
SAS システム 8 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=SHINTYOU Normal Probability Plot 172.5+ +*++* | *****+*+*** | **********++ | **********+ | +********+ 147.5+*++*+*+** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 15 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=TAIJYUU Normal Probability Plot 62.5+ * +* | *****+*++++ | ************ | ************+ | *+****+**++ 37.5+*+++*++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 22 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=KYOUI Normal Probability Plot 92.5+ +++*+++ | ***********+**+++* 82.5+ ********+***+*++++ | ++*+*+**+++++ 72.5++++*+ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 29 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=F --------------------------------- Univariate Procedure Variable=KODUKAI Normal Probability Plot 325000+ * | | * 175000+ *** ++ | *****+++++++ | +********** 25000+* * ********************** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 36 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=SHINTYOU Normal Probability Plot 187.5+ **+* | ********+++ | ********++ 172.5+ ************ | *********+ | *********+ 157.5+*++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 43 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=TAIJYUU Normal Probability Plot 105+ * | * * | ***+++ 75+ **********+++ | *************** | *****************+ 45+*++*++++++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 50 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=KYOUI Normal Probability Plot 115+ * +*+ | +***+*++++ | ***********+** | *************+++ | *+***+++++ |+++++++ | * 45+ * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 SAS システム 57 12:08 Wednesday, June 11, 2008 -------------------------------- SEX=M --------------------------------- Univariate Procedure Variable=KODUKAI Normal Probability Plot 375000+ * | * | | * | *****+**+++ | ******+++++ | ++*******+ 25000+* *************************** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2
/* Lesson 10-2 */ /* File Name = les1002.sas 06/12/08 */ data gakusei; infile 'all08ae.prn' firstobs=2; input sex $ shintyou taijyuu kyoui jitaku $ kodukai carryer $ tsuuwa; if sex^='M' & sex^='F' then delete; proc print data=gakusei(obs=10); run; proc ttest data=gakusei; : t検定 class sex; : 分類したい特性変数の指定 var shintyou taijyuu kyoui kodukai; : 比較したい変量名 run; :
SAS システム 2 12:08 Wednesday, June 11, 2008 TTEST PROCEDURE Variable: SHINTYOU SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 127 158.98188976 5.25173316 0.46601596 M 252 172.22380952 5.44545468 0.34303140 Variances T DF Prob>|T| --------------------------------------- Unequal -22.8840 261.1 0.0001 Equal -22.6116 377.0 0.0000 For H0: Variances are equal, F' = 1.08 DF = (251,126) Prob>F' = 0.6530 SAS システム 3 12:08 Wednesday, June 11, 2008 TTEST PROCEDURE Variable: TAIJYUU SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 88 48.84090909 4.74820320 0.50616016 M 252 62.21349206 7.90706329 0.49809817 Variances T DF Prob>|T| --------------------------------------- Unequal -18.8309 254.4 0.0001 Equal -14.9434 338.0 0.0000 For H0: Variances are equal, F' = 2.77 DF = (251,87) Prob>F' = 0.0000 SAS システム 4 12:08 Wednesday, June 11, 2008 TTEST PROCEDURE Variable: KYOUI SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 45 82.97777778 3.85232450 0.57427063 M 72 87.98611111 9.66406594 1.13892109 Variances T DF Prob>|T| --------------------------------------- Unequal -3.9265 101.1 0.0002 Equal -3.3116 115.0 0.0012 For H0: Variances are equal, F' = 6.29 DF = (71,44) Prob>F' = 0.0000 SAS システム 5 12:08 Wednesday, June 11, 2008 TTEST PROCEDURE Variable: KODUKAI SEX N Mean Std Dev Std Error ----------------------------------------------------------------------- F 123 48089.43089431 44134.99376077 3979.51837003 M 241 47692.94605809 51860.03912810 3340.59878498 Variances T DF Prob>|T| --------------------------------------- Unequal 0.0763 283.1 0.9392 Equal 0.0724 362.0 0.9423 For H0: Variances are equal, F' = 1.38 DF = (240,122) Prob>F' = 0.0463
/* Lesson 10-3 */ /* File Name = les1003.sas 06/12/08 */ data gakusei; infile 'all08ae.prn' firstobs=2; input sex $ shintyou taijyuu kyoui jitaku $ kodukai carryer $ tsuuwa; if sex^='M' & sex^='F' then delete; proc print data=gakusei(obs=10); run; proc npar1way data=gakusei wilcoxon; : wilcoxon 検定 class sex; : 分類したい特性変数の指定 var shintyou taijyuu kyoui kodukai; : 比較したい変量名 run; :
SAS システム 2 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable SHINTYOU Classified by Variable SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 127 9309.5000 24130.0 1006.03685 73.303150 M 252 62700.5000 47880.0 1006.03685 248.811508 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 3 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E S = 9309.50 Z = -14.7311 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 217.02 DF = 1 Prob > CHISQ = 0.0001 SAS システム 4 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable TAIJYUU Classified by Variable SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 88 5008.5000 15004.0 793.040519 56.914773 M 252 52961.5000 42966.0 793.040519 210.164683 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 5 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E S = 5008.50 Z = -12.6034 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 158.86 DF = 1 Prob > CHISQ = 0.0001 SAS システム 6 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E Wilcoxon Scores (Rank Sums) for Variable KYOUI Classified by Variable SEX Sum of Expected Std Dev Mean SEX N Scores Under H0 Under H0 Score F 45 1803.0 2655.0 177.518371 40.0666667 M 72 5100.0 4248.0 177.518371 70.8333333 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 7 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E S = 1803.00 Z = -4.79669 Prob > |Z| = 0.0001 T-Test Approx. Significance = 0.0001 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 23.035 DF = 1 Prob > CHISQ = 0.0001 SAS システム 8 12:08 Wednesday, June 11, 2008 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 123 23691.5000 22447.5000 944.942897 192.613821 M 241 42738.5000 43982.5000 944.942897 177.338174 Average Scores Were Used for Ties Wilcoxon 2-Sample Test (Normal Approximation) (with Continuity Correction of .5) SAS システム 9 12:08 Wednesday, June 11, 2008 N P A R 1 W A Y P R O C E D U R E S = 23691.5 Z = 1.31595 Prob > |Z| = 0.1882 T-Test Approx. Significance = 0.1890 Kruskal-Wallis Test (Chi-Square Approximation) CHISQ = 1.7331 DF = 1 Prob > CHISQ = 0.1880