前回は構造がシンプルな単回帰分析を例に、この分析方法の考え方や残差の取り方、および、なぜそのように取る必要があるか等を説明した。今回は、より実用場面で登場する重回帰分析まで拡張し、 分析の進め方や利用時の注意点を含めて紹介する。 いろいろな場面での応用が可能な手法なので、大いに利用していただきたい。
直線(平面)の方程式:
測定値と予測値のズレ:
ズレの2乗の和を最小に:
Sunday, November 15, 2020 05:41:28 PM 14 The REG Procedure Model: MODEL1 Dependent Variable: taijyuu Number of Observations Read 157 Number of Observations Used 157 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 2 9372.44244 4686.22122 89.82 <.0001 Error 154 8034.65655 52.17309 Corrected Total 156 17407 Root MSE 7.22309 R-Square 0.5384 Dependent Mean 60.29745 Adj R-Sq 0.5324 Coeff Var 11.97910 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr > |t| Intercept 1 -98.84919 12.07580 -8.19 <.0001 shintyou 1 0.77130 0.07213 10.69 <.0001 kyoui 1 0.33565 0.06579 5.10 <.0001 Sunday, November 15, 2020 05:41:31 PM 15 s h t k c i a j o a t r n i k i d r s p e t j y t u r u r s O s y y o a k y u e i b e o u u k a e w d d s x u u i u i r a 2 2 1 F 146.7 41.0 85 自宅生 10000 Vodafone 6000 42.8307 -1.83069 2 F 148.0 43.0 80 自宅生 50000 DoCoMo 4000 42.1551 0.84485 3 F 150.0 46.0 86 40000 . 45.7116 0.28837 4 F 151.7 41.5 80 自宅生 35000 . 45.0090 -3.50896 5 F 152.0 35.0 77 自宅生 60000 DoCoMo 2000 44.2334 -9.23341 6 F 153.0 46.5 87 下宿生 10000 . 48.3612 -1.86118 7 F 153.0 55.0 78 自宅生 30000 . 45.3404 9.65964 8 F 154.4 44.0 75 自宅生 9000 au 2000 45.4132 -1.41324 9 F 155.0 48.0 83 下宿生 180000 . 48.5612 -0.56120 10 F 156.0 42.0 85 自宅生 0 DoCoMo 15000 50.0038 -8.00379 11 F 156.0 46.0 82 自宅生 10000 Vodafone 7000 48.9969 -2.99685 12 F 156.0 48.0 70 自宅生 30000 . 44.9691 3.03092 13 F 156.0 49.0 85 自宅生 25000 . 50.0038 -1.00379 14 F 156.0 50.0 82 自宅生 40000 Vodafone 10000 48.9969 1.00315 15 M 156.0 61.0 90 自宅生 0 . 51.6820 9.31797 Sunday, November 15, 2020 05:41:31 PM 16 Plot of taijyuu*shintyou. Legend: A = 1 obs, B = 2 obs, etc. 100 + A | | | A A | A | A | A 80 + A | AA A | A A taijyuu | A CC BAA A B A | A AA AA A A A A | A BB B A ABAA AA | A A BDB B AA B B A 60 + A A A AAA AC AAA A A ABA A | A A B ABA BAA | A A AA A BACB B A A | A A C AAB A A A | AB A CA B | A A B A A BA A | A A A A 40 + A | | A | | | | 20 + --+------------+------------+------------+------------+------------+-- 140 150 160 170 180 190 shintyou Sunday, November 15, 2020 05:41:31 PM 17 Plot of taijyuu*kyoui. Legend: A = 1 obs, B = 2 obs, etc. 100 + A | | | A A | A | A | A 80 + A | B A | A A taijyuu | AABE AC AA | A A EB | AAAB BBAB B A | B B BBFB B A 60 + A BC C F D A | A A AEABA | A A A ABA G BA | A B BBCA A | A A BBC A | A DAAAAA | A B A 40 + A | | A | | | | 20 + --+------------+------------+------------+------------+------------+-- 20 40 60 80 100 120 kyoui Sunday, November 15, 2020 05:41:31 PM 18 Plot of pred2*taijyuu. Legend: A = 1 obs, B = 2 obs, etc. 80 + P | r | e | A A A A d | i | A A c | A A BA t 70 + B BAA B A e | A AA BA A A d | B A AA A A | A A BA B A A V | A ABAAABA B A C A a | AA B ACAA B AA A A l | A B A AB A u 60 + A A A A A e | B B B A B | B ACA A AA A o | B A A f | BB AAA A | BB B A A t | A BB A a 50 + A A AA AA A i | AAAA A j | y | A A A A u | A A u | A A | A 40 + -+---------+---------+---------+---------+---------+---------+---------+- 30 40 50 60 70 80 90 100 taijyuu Sunday, November 15, 2020 05:41:31 PM 19 Plot of resid2*shintyou. Legend: A = 1 obs, B = 2 obs, etc. | | 40 + | | A | 30 + | | A A A | R 20 + e | A s | A i | A A A A d 10 + A A A u | B A A BB A a | B A AC AC A A A A l | A A A A A AA C BB AA A 0 +-----------A--A------AB-----AA-----A---A-AEA--------B-A---------------- | A A A A AA B BC AB BA BD CA C BBA AA A A | A BA B B A A AA AAB C | A AA C AA A BA A A A A -10 + A A B A | A A A | | -20 + | -+-------------+-------------+-------------+-------------+-------------+ 140 150 160 170 180 190 shintyou Sunday, November 15, 2020 05:41:31 PM 20 Plot of resid2*kyoui. Legend: A = 1 obs, B = 2 obs, etc. | | 40 + | | A | 30 + | | A A A | R 20 + e | A s | A i | B A A d 10 + A A A u | A DC A a | A D AD ACA l | A AAAACA A C AB A 0 +-----------------------------------A---A--CAABCA-D---A-----A----------- | A B DCBALABGB BB | AB BACAEC A | C CBA D A AA -10 + A ABA | A A A | | -20 + | -+-------------+-------------+-------------+-------------+-------------+ 20 40 60 80 100 120 kyoui Sunday, November 15, 2020 05:41:31 PM 21 Plot of resid2*taijyuu. Legend: A = 1 obs, B = 2 obs, etc. | | 40 + | | A | 30 + | | AA A | R 20 + e | A s | A i | A A A A d 10 + A A A u | A A AAAC A a | A A A AAA D B B A l | A A A A BA BA CAB A 0 +-------------A--A-AAA--B-AA-A-B--C-AA-A--A----------------------------- | AA AAAAACDAA AEA B CADB B AA B | AA AAB B BAB B BAA | A ABB A BABA B A -10 + A A C | A A A | | -20 + | -+---------+---------+---------+---------+---------+---------+---------+ 30 40 50 60 70 80 90 100 taijyuu Sunday, November 15, 2020 05:41:31 PM 22 The UNIVARIATE Procedure Variable: resid2 (Residual) Moments N 157 Sum Weights 157 Mean 0 Sum Observations 0 Std Deviation 7.17664327 Variance 51.5042086 Skewness 1.57976591 Kurtosis 4.4230546 Uncorrected SS 8034.65655 Corrected SS 8034.65655 Coeff Variation . Std Error Mean 0.57275849 Basic Statistical Measures Location Variability Mean 0.00000 Std Deviation 7.17664 Median -1.50893 Variance 51.50421 Mode -8.70986 Range 46.86806 Interquartile Range 6.71754 Note: The mode displayed is the smallest of 6 modes with a count of 2. Tests for Location: Mu0=0 Test -Statistic- -----p Value------ Student's t t 0 Pr > |t| 1.0000 Sign M -13.5 Pr >= |M| 0.0376 Signed Rank S -838.5 Pr >= |S| 0.1422 Sunday, November 15, 2020 05:41:31 PM 23 The UNIVARIATE Procedure Variable: resid2 (Residual) Tests for Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.89525 Pr < W <0.0001 Kolmogorov-Smirnov D 0.105524 Pr > D <0.0100 Cramer-von Mises W-Sq 0.539533 Pr > W-Sq <0.0050 Anderson-Darling A-Sq 3.306683 Pr > A-Sq <0.0050 Quantiles (Definition 5) Level Quantile 100% Max 33.97434 99% 25.21708 95% 12.75632 90% 8.31280 75% Q3 2.84938 50% Median -1.50893 25% Q1 -3.86816 10% -7.72466 5% -9.13160 1% -12.72289 0% Min -12.89372 Sunday, November 15, 2020 05:41:31 PM 24 The UNIVARIATE Procedure Variable: resid2 (Residual) Extreme Observations ------Lowest------ -----Highest----- Value Obs Value Obs -12.89372 149 18.2621 69 -12.72289 138 23.9651 136 -11.51410 155 25.2059 107 -10.72891 152 25.2171 73 -9.52196 142 33.9743 106
Sunday, November 15, 2020 05:39:45 PM 2 The REG Procedure Model: MODEL1 Dependent Variable: taijyuu Number of Observations Read 149 Number of Observations Used 149 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 2 8081.64748 4040.82374 160.39 <.0001 Error 146 3678.18487 25.19305 Corrected Total 148 11760 Root MSE 5.01927 R-Square 0.6872 Dependent Mean 59.14899 Adj R-Sq 0.6829 Coeff Var 8.48580 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr > |t| Intercept 1 -97.81637 8.88361 -11.01 <.0001 shintyou 1 0.62775 0.05213 12.04 <.0001 kyoui 1 0.59200 0.06789 8.72 <.0001 Sunday, November 15, 2020 05:39:54 PM 7 Plot of resid2*shintyou. Legend: A = 1 obs, B = 2 obs, etc. | | 15 + | | | A A | A A 10 + | A A B B A | A A A B A R | B B A e | A A B A s 5 + A A A A i | B A A A A d | A B A u | A AA A A B a | A A A A C A AA B A l 0 +--------------------A-------A----------A---A----AA---------A--A-------- | A AA A A AA A AB A | A AA A A AA A AA AA A | A A AA B BA AA A AA B AA AA A | A AAA BA AA A B -5 + AA AA A A | AA A A | B B | A A A A A | A A -10 + A | -+-------------+-------------+-------------+-------------+-------------+ 140 150 160 170 180 190 shintyou Sunday, November 15, 2020 05:39:54 PM 8 Plot of resid2*kyoui. Legend: A = 1 obs, B = 2 obs, etc. | | 15 + | | | A A | A A 10 + | A B A A A A | AAC A R | B A B e | A AAA A s 5 + A A A A i | A A A AA A d | A A A A u | A A A A A B a | B A B A C AA A A l 0 +---------------------AA-----A------B------C---------------------------- | A A BBA AA A A A | A AB C AB B A | F AB CB AB A A A A | AA D C B A -5 + B A AA A | A A A A | B AA | A A A A A | A A -10 + A | -+-------------+-------------+-------------+-------------+-------------+ 60 70 80 90 100 110 kyoui Sunday, November 15, 2020 05:39:54 PM 9 Plot of resid2*taijyuu. Legend: A = 1 obs, B = 2 obs, etc. | | 15 + | | | A A | A A 10 + | A A A A A A A | A A A B A R | AA A AA e | A A A A A s 5 + A A A A i | A AA A A A d | A A A A u | A A A A A B a | A A A B B AA A AAA l 0 +--------------------A----A---------A---------AA--A---A--A-------------- | A A A A A A D A A | ABA C A BA B | A ABAA BAA A AA C B AB | A A AA B A A BAA -5 + AA A B A | A A A A | B B | A A A A A | A A -10 + A | -+-------------+-------------+-------------+-------------+-------------+ 30 40 50 60 70 80 taijyuu
[例] 関西学院大学: 中央値補正法とは...
.、
科目別平均点の中央値補正前後比較
.
[例] 関西大学: 各学部での合否判定の方法