/* Lesson 13-1 */ /* File Name = corr01.sas 10/02/97 */ data gakusei; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui shiokuri $ kodukai; proc print data=gakusei(obs=10); run; proc means data=gakusei; where seibetsu='F'; run; : proc corr data=gakusei; : 相関係数(相関行列)を計算 where seibetsu='F'; : 女性について run; : proc plot data=gakusei; : 散布図を描く plot taijyuu*shintyou; : 散布図の変量を指定(縦軸、横軸の順) where seibetsu='F'; : 女性について run;
SAS システム 80 22:31 Wednesday, October 1, 1997 OBS SEIBETSU SHINTYOU TAIJYUU KYOUI SHIOKURI KODUKAI 1 F 148.9 . . J 60000 2 F 156.0 . . G . 3 M 156.0 61 90 J 0 4 F 156.5 . . J 20000 5 F 157.0 43 . J 20000 6 F 160.0 . . J 43500 7 F 161.0 . . J 25000 8 F 161.0 . . . 9 F 162.0 . . J 0 10 F 162.0 . . J 30000 SAS システム 81 22:31 Wednesday, October 1, 1997 Variable N Mean Std Dev Minimum Maximum --------------------------------------------------------------------- SHINTYOU 192 157.7385417 4.8267225 147.0000000 171.0000000 TAIJYUU 54 48.4444444 4.8450584 35.0000000 62.0000000 KYOUI 26 81.9615385 3.1302494 75.0000000 88.0000000 KODUKAI 152 47233.55 43301.88 0 200000.00 --------------------------------------------------------------------- SAS システム 82 22:31 Wednesday, October 1, 1997 Correlation Analysis 4 'VAR' Variables: SHINTYOU TAIJYUU KYOUI KODUKAI Simple Statistics Variable N Mean Std Dev Sum Minimum Maximum SHINTYOU 192 157.7 4.8267 30285.8 147.0 171.0 TAIJYUU 54 48.4444 4.8451 2616.0 35.0000 62.0000 KYOUI 26 81.9615 3.1302 2131.0 75.0000 88.0000 KODUKAI 152 47233.6 43301.9 7179500 0 200000 SAS システム 83 22:31 Wednesday, October 1, 1997 Correlation Analysis Pearson Correlation Coefficients / Prob > |R| under Ho: Rho=0 / Number of Observations SHINTYOU TAIJYUU KYOUI KODUKAI SHINTYOU 1.00000 0.77241 0.14757 -0.04907 0.0 0.0001 0.4719 0.5592 192 54 26 144 TAIJYUU 0.77241 1.00000 0.41821 -0.09777 0.0001 0.0 0.0375 0.5086 54 54 25 48 KYOUI 0.14757 0.41821 1.00000 -0.47171 0.4719 0.0375 0.0 0.0231 26 25 26 23 KODUKAI -0.04907 -0.09777 -0.47171 1.00000 0.5592 0.5086 0.0231 0.0 144 48 23 152 SAS システム 85 22:31 Wednesday, October 1, 1997 プロット : TAIJYUU*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 80 + | | | 60 + A A | A A AAAA A B TAIJYUU | A C A A A B A BAC A A | C A A B BABADAB A 40 + A A A | A | | 20 + --+---------+---------+---------+---------+---------+---------+- 145 150 155 160 165 170 175 SHINTYOU NOTE: 155 オブザベーションが欠損値です.
/* Lesson 13-2 */ /* File Name = reg02.sas 10/02/97 */ data gakusei; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui shiokuri $ kodukai; proc print data=gakusei(obs=10); run; : proc reg data=gakusei; : 回帰分析 model shintyou=taijyuu; : 変量を指定 output out=o_reg1 predicted=pred1 residual=resid1; : 結果項目の保存 where seibetsu='F'; : 女性について run; : : proc print data=o_reg1(obs=30); : まず表示 run; : proc plot data=o_reg1; : 散布図の表示 plot taijyuu*shintyou; : 体重と身長 plot pred1*shintyou; : 予測値と観測値 plot resid1*shintyou; : 残差と観測値 run;
SAS システム 18 22:31 Wednesday, October 1, 1997 Model: MODEL1 Dependent Variable: SHINTYOU Analysis of Variance Sum of Mean Source DF Squares Square F Value Prob>F Model 1 820.04310 820.04310 76.912 0.0001 Error 52 554.42949 10.66211 C Total 53 1374.47259 Root MSE 3.26529 R-square 0.5966 Dep Mean 157.62963 Adj R-sq 0.5889 C.V. 2.07149 SAS システム 19 22:31 Wednesday, October 1, 1997 Parameter Estimates Parameter Standard T for H0: Variable DF Estimate Error Parameter=0 Prob > |T| INTERCEP 1 118.299501 4.50660940 26.250 0.0001 TAIJYUU 1 0.811860 0.09257304 8.770 0.0001 SAS システム 20 22:31 Wednesday, October 1, 1997 OBS SEIBETSU SHINTYOU TAIJYUU KYOUI SHIOKURI KODUKAI PRED1 RESID1 1 F 148.9 . . J 60000 . . 2 F 156.0 . . G . . . 3 F 156.5 . . J 20000 . . 4 F 157.0 43 . J 20000 153.210 3.79050 5 F 160.0 . . J 43500 . . 6 F 161.0 . . J 25000 . . 7 F 161.0 . . . . . 8 F 162.0 . . J 0 . . 9 F 162.0 . . J 30000 . . 10 F 162.4 . . . . . 11 F 169.5 . . J 30000 . . 12 F 170.0 . . J 30000 . . 13 F . . . J 20000 . . 14 F 156.0 . . J 30000 . . 15 F 156.0 . . J 50000 . . 16 F 155.0 . . J 20000 . . 17 F 167.0 54 . J 20000 162.140 4.86003 18 F 164.0 . . J 30000 . . 19 F 162.0 53 . . 161.328 0.67189 20 F 160.0 . . J . . . 21 F 155.0 . . J 5000 . . 22 F 149.0 48 86 J 20000 157.269 -8.26880 23 F 157.0 . . J 20000 . . 24 F 157.0 . . G 120000 . . 25 F 153.9 . . J 5000 . . 26 F 149.3 . . J 31000 . . 27 F 165.3 . . G 100000 . . 28 F 160.6 . . J 5000 . . 29 F 161.0 49 . G 100000 158.081 2.91934 30 F 156.0 . . G 100000 . . SAS システム 22 22:31 Wednesday, October 1, 1997 プロット : TAIJYUU*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 80 + | | | 60 + A A | A A AAAA A B TAIJYUU | A C A A A B A BAC A A | C A A B BABADAB A 40 + A A A | A | | 20 + --+---------+---------+---------+---------+---------+---------+- 145 150 155 160 165 170 175 SHINTYOU NOTE: 155 オブザベーションが欠損値です. SAS システム 23 22:31 Wednesday, October 1, 1997 プロット : PRED1*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 170 + | A | A AA | A AA A B 160 + B A A A A BAC A A | A A A A AA A B A PRED1 | A A AAB DA A | A B A A A 150 + A | A | | 140 + ---+---------+---------+---------+---------+---------+---------+-- 145 150 155 160 165 170 175 SHINTYOU NOTE: 155 オブザベーションが欠損値です. SAS システム 24 22:31 Wednesday, October 1, 1997 プロット : RESID1*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 10 + | R | A A e | A B s | A A A A B A i | A C A AAA A d 0 + A B AAA A AA A u | A A BA AA A A A A a | A A A B A A l | A A A | A | A -10 + ---+---------+---------+---------+---------+---------+---------+-- 145 150 155 160 165 170 175 SHINTYOU NOTE: 155 オブザベーションが欠損値です.
/* Lesson 13-3 */ /* File Name = reg03.sas 10/02/97 */ data gakusei; infile 'all.dat'; input seibetsu $ shintyou taijyuu kyoui shiokuri $ kodukai; proc print data=gakusei(obs=10); run; proc reg data=gakusei; : model shintyou=taijyuu kyoui; : 複数変量を指定 output out=o_reg1 predicted=pred1 residual=resid1; : run; : proc print data=o_reg1(obs=30); run; proc plot data=o_reg1; plot taijyuu*shintyou; plot pred1*shintyou; plot resid1*shintyou; run;
SAS システム 42 22:31 Wednesday, October 1, 1997 Model: MODEL1 Dependent Variable: SHINTYOU Analysis of Variance Sum of Mean Source DF Squares Square F Value Prob>F Model 2 2315.90923 1157.95461 40.674 0.0001 Error 47 1338.04297 28.46900 C Total 49 3653.95220 Root MSE 5.33563 R-square 0.6338 Dep Mean 164.23400 Adj R-sq 0.6182 C.V. 3.24880 SAS システム 43 22:31 Wednesday, October 1, 1997 Parameter Estimates Parameter Standard T for H0: Variable DF Estimate Error Parameter=0 Prob > |T| INTERCEP 1 129.115758 10.87395981 11.874 0.0001 TAIJYUU 1 0.709528 0.12083859 5.872 0.0001 KYOUI 1 -0.065438 0.17841721 -0.367 0.7154 SAS システム 44 22:31 Wednesday, October 1, 1997 OBS SEIBETSU SHINTYOU TAIJYUU KYOUI SHIOKURI KODUKAI PRED1 RESID1 1 F 148.9 . . J 60000 . . 2 F 156.0 . . G . . . 3 M 156.0 61 90 J 0 166.508 -10.5075 4 F 156.5 . . J 20000 . . 5 F 157.0 43 . J 20000 . . 6 F 160.0 . . J 43500 . . 7 F 161.0 . . J 25000 . . 8 F 161.0 . . . . . 9 F 162.0 . . J 0 . . 10 F 162.0 . . J 30000 . . 11 M 162.0 62 100 J 0 166.563 -4.5627 12 F 162.4 . . . . . 13 M 166.0 60 88 G 150000 165.929 0.0711 14 M 167.0 60 94 J . 165.536 1.4637 15 M 167.0 58 . G 0 . . 16 M 168.0 57 . G 100000 . . 17 M 168.0 62 80 G 120000 167.871 0.1286 18 M 168.0 65 85 . 169.673 -1.6728 19 M 168.0 52 . G . . . 20 M 169.0 54.0 . G 150000 . . 21 F 169.5 . . J 30000 . . 22 F 170.0 . . J 30000 . . 23 M 170.0 58.0 88 G 163000 164.510 5.49017 24 M 170.0 60.0 . J 20000 . . 25 M 170.0 65.0 . J 30000 . . 26 M 170.2 61.9 . J 20000 . . 27 M 172.0 58.0 . G 50000 . . 28 M 172.0 56.0 . G 150000 . . 29 M 173.0 65.0 . J 20000 . . 30 M 173.5 76.5 . G 100000 . . SAS システム 46 22:31 Wednesday, October 1, 1997 プロット : TAIJYUU*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 100 + | | | A 75 + A A BAA B | A B B A A TAIJYUU | A A BAB C F D CCB B A | A ABA A C AAA B A A A 50 + AA AAADB AACACAFAA A A A A | A CAA AACDB A | A A | 25 + --+-----------+-----------+-----------+-----------+-----------+- 140 150 160 170 180 190 SHINTYOU NOTE: 157 オブザベーションが欠損値です. SAS システム 47 22:31 Wednesday, October 1, 1997 プロット : PRED1*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 180 + A | A A | A AA | A A A 170 + A A | A A B A B A PRED1 | A AA AA A A A | A A A A 160 + A A B B A | AA AAAA A | A A A | A A 150 + ---+-----------+-----------+-----------+-----------+-----------+-- 140 150 160 170 180 190 SHINTYOU NOTE: 224 オブザベーションが欠損値です. SAS システム 48 22:31 Wednesday, October 1, 1997 プロット : RESID1*SHINTYOU. 凡例: A = 1 OBS, B = 2 OBS, ... 20 + | R | A e | s 10 + A i | AA d | A A A A A B u | A A B A A A A a 0 + A A A A B A A l | A AAB AAA A AA A A | A A A A A | AA -10 + A A A ---+-----------+-----------+-----------+-----------+-----------+-- 140 150 160 170 180 190 SHINTYOU NOTE: 224 オブザベーションが欠損値です.