案例通过构建虚拟变量,建立了分段线性回归模型,结果如下:Variable Coefficient Std. Error t-Statistic Prob.C -697.0977 944.8734 -0.737768 0.4673GNI 0.132616 0.030143 4.399560 0.0002 (GNI-70142.5)*D1 -0.185777 0.111182 -1.670927 0.1067(GNI-98000)*D2 0.230666 0.110988 2.078301 0.0477(GNI-184088.6)*D3 -0.273652 0.075943 -3.603403 0.0013(GNI-251483.2)*D4 0.458678 0.082565 5.555380 0.0000R-squared 0.965855 Mean dependent var 10428.57Adjusted R-squared 0.957976 S.D. dependent var 13612.43S.E. of regression 2790.516 Akaike info criterion 18.89167Sum squared resid 2.02E+08 Schwarz criterion 19.20911Log likelihood -304.7126 F-statistic 122.5782Durbin-Watson stat 2.989812 Prob(F-statistic) 0.000000可决系数很大,拟合优度很高;F统计量的P值很小,模型显著性很强;T的P值很小,显著性很强,但第二个解释变量的p值较大,只能在0.10水平勉强通过。
8_3(1)利用excel做方差分析,结果如下:方差分析差异源SS df MS F P-value F crit组间 3.05E+08 1 3.05E+08 17.11138 9.91E-05 3.981896组内 1.21E+09 68 17828696总计 1.52E+09 69F值较大,P值很小,城镇和农村这一因素对消费水平有显著影响。
(2)C -378.5949 50.52334 -7.493464 0.0000X1 1.996761 0.259904 7.682677 0.0000R-squared 0.997087 Mean dependent var 3441.571Adjusted R-squared 0.996905 S.D. dependent var 3709.172S.E. of regression 206.3361 Akaike info criterion 13.57871Sum squared resid 1362387. Schwarz criterion 13.71202Log likelihood -234.6274 F-statistic 5477.540Durbin-Watson stat 0.270419 Prob(F-statistic) 0.000000(1) 由能源消费的时间序列图,可以发现:在2000年后我国的能源消耗增长速度加快,故设定虚拟变量d ,有d ={0 t ≤20001 t >2000简单线性模型:Variable Coefficient Std. Error t-Statistic Prob. C -16460359 1114924. -14.76366 0.0000 T8327.553558.852014.901180.0000 R-squared0.870611 Mean dependent var 153108.8 Adjusted R-squared 0.866690 S.D. dependent var 91453.42 S.E. of regression 33391.11 Akaike info criterion 23.72541 Sum squared resid 3.68E+10 Schwarz criterion 23.81429 Log likelihood -413.1947 F-statistic 222.0451 Durbin-Watson stat0.061020 Prob(F-statistic)0.000000(2)指数模型:拟合参数及检验:Variable Coefficient Std. Error t-Statistic Prob. C -822.2541 21.60236 -38.06316 0.0000 LT109.76432.84301938.608380.0000 R-squared0.978341 Mean dependent var 11.77784 Adjusted R-squared 0.977685 S.D. dependent var 0.570001 S.E. of regression0.085149 Akaike info criterion-2.0333871000002000003000004000008085909500051010.511.011.512.012.513.07.5857.5907.5957.6007.6057.610LTL YSum squared resid 0.239261 Schwarz criterion -1.944510Log likelihood 37.58427 F-statistic 1490.607Durbin-Watson stat 0.160793 Prob(F-statistic) 0.000000有虚拟变量的线性模型:C -12549532 1799724. -6.973031 0.0000T 6358.489 904.8343 7.027241 0.0000DD*T 25.37381 9.594945 2.644497 0.0126 R-squared 0.893817 Mean dependent var 153108.8Adjusted R-squared 0.887180 S.D. dependent var 91453.42S.E. of regression 30717.97 Akaike info criterion 23.58490Sum squared resid 3.02E+10 Schwarz criterion 23.71822Log likelihood -409.7357 F-statistic 134.6828Durbin-Watson stat 0.171680 Prob(F-statistic) 0.000000指数模型的拟合效果最好。
8_5(1)首先,通过excel做有重复的双因素方差分析,结果如下:方差分析差异源SS df MS F P-value F crit样本 1.35E+08 2 67374615 33.4505 1.15E-07 3.402826列 4.48E+08 1 4.48E+08 222.2067 1.24E-13 4.259677交互89518873 2 44759437 22.2224 3.46E-06 3.402826内部48339805 24 2014159总计7.2E+08 29由F统计量可知,无论是学历还是是否管理层,都对各自和交互对工资有显著影响。
设学历的虚拟变量和管理层的虚拟变量,其中e1代表本科学历,e2代表研究生学历,m代表管理层,做多元线性回归,结果如下:C 8035.598 386.6893 20.78050 0.0000X546.1840 30.51919 17.89641 0.0000E1 3144.035 361.9683 8.685941 0.0000E2 2996.210 411.7527 7.276723 0.0000R-squared 0.956767 Mean dependent var 17270.20Adjusted R-squared 0.952549 S.D. dependent var 4716.632S.E. of regression 1027.437 Akaike info criterion 16.80984Sum squared resid 43280719 Schwarz criterion 17.00861Log likelihood -381.6264 F-statistic 226.8359Durbin-Watson stat 2.236925 Prob(F-statistic) 0.000000T统计值很大,各个变量的显著性都很强;DW统计值接近2,无自相关;若考虑交互作用,分别设本科生和管理层的乘积变量M1和研究生和管理层的乘积变量M2;做多元线性回归,结果如下:Variable Coefficient Std. Error t-Statistic Prob. C 9472.685 80.34365 117.9021 0.0000 X 496.9870 5.566415 89.28314 0.0000 E1 1381.671 77.31882 17.86978 0.0000 E2 1730.748 105.3339 16.43107 0.0000 M 3981.377 101.1747 39.35150 0.0000 M1 4902.523 131.3589 37.32158 0.0000 M23066.035149.330420.531880.0000 R-squared0.998823 Mean dependent var 17270.20 Adjusted R-squared 0.998642 S.D. dependent var 4716.632 S.E. of regression 173.8086 Akaike info criterion 13.29305 Sum squared resid 1178168. Schwarz criterion 13.57133 Log likelihood -298.7403 F-statistic 5516.596 Durbin-Watson stat2.244104 Prob(F-statistic)0.000000无自相关。
由残差图可见,误差较小,围绕0水平上下波动。
模型拟合效果很好。
格兰杰因果检验S does not Granger Cause M2440.11809 0.88893 M2 does not Granger Cause S 0.85619 0.43261 X does not Granger Cause S44 5.73103 0.00658 S does not Granger Cause X 0.25219 0.77835 S does not Granger Cause M144 1.85559 0.16990 M1 does not Granger Cause S 4.26486 0.02113 S does not Granger Cause M44 0.75865 0.47508 M does not Granger Cause S 1.96170 0.15425 S does not Granger Cause E244 2.60713 0.08656 E2 does not Granger Cause S 0.86068 0.43075 S does not Granger Cause E144 1.17365 0.31992 E1 does not Granger Cause S0.006430.99359但是,通过格兰杰因果检验发现,虚拟变量对S 的影响多数不通过检验。