7. 1)用OLS法建立居民人均消费支出与可支配收入的线性模型。
create u 20; data consump income; ls consump c income
Dependent Variable: CONSUMP Method: Least Squares Sample: 1 20
Included observations: 20
Variable
Coefficient
C INCOME R-squared
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
Std. Error
t-Statistic
Prob.
Mean dependent
criterion
Sum squared resid
Schwarz
criterion
1
Log likelihood Durbin-Watson stat
F-statistic
Prob(F-statistic)
线性模型如下:
CONSUMP = 53 + *INCOME 2)检验模型是否存在异方差性
i) XY图:是否有明显的散点扩大/缩小/复杂型趋势
scat income consump
ii)解释变量—残差图:是否形成一条斜率为0的直线
scat income resid^2 或者
genr ei2=resid^2; scat income ei2
由两个图形,均可判定存在递增型异方差。
还可以用帕克检验,戈里瑟检验,戈德菲尔德-匡特检验,怀特检验等方法。
2
iii) 戈德菲尔德-匡特检验:共有20个样本,去掉中间1/4个样本(4个),剩余大样本、小样本各8个。
Sort income; smpl 1 8; ls consump C income Smpl 13 20; ls consump C income
FRSS2RSS1nk1nk1615472.0126528.38118114.86,存在异方差。
F0.05(nk1,nk1)F0.05(811,811)4.28iV)怀特检验:因为只有一个变量,故是否含有交叉项是一样的。
ea0a1X1ia2X2ia3X12ia4X22ia5X1iX2iviH0:a1a2a3a4a50,nR e2i22i(q),q变量个数
2a0a1X1ia2X12ivi2H0:a1a20,nR(q),q变量个数2View\residual test\white heteroskedastcity
(cross terms / no cross terms )
White Heteroskedasticity Test: F-statistic
Obs*R-squared
Probability
Probability
3
Dependent Variable: RESID^2 Method: Least Squares Sample: 1 20
Included observations: 20
Variable
Coefficient
C INCOME INCOME^2 R-squared
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
Std. Error
Mean dependent
t-Statistic
Prob.
criterion
Sum squared resid
Log likelihood Durbin-Watson stat
+10
Schwarz
criterion
F-statistic
Prob(F-statistic)
4
nR22(q),q2nR212.652130.052(2)5.99,存在异
方差。还可以通过概率P2nR20.00170.05判定存在异方差。
3)若存在异方差,用适当的方法估计模型对数(加权最小二乘法)
ls consump C income; genr eijdz=abs(resid) ls(w=1/eijdz) consump C income
Dependent Variable: CONSUMP Method: Least Squares Sample: 1 20
Included observations: 20 Weighting series: 1/EIJDZ
Variable
Coefficient
C INCOME
Weighted Statistics R-squared
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
Mean dependent
Std. Error
t-Statistic
Prob.
criterion
5
Sum squared resid
Log likelihood Durbin-Watson stat
Unweighted Statistics R-squared
Schwarz
criterion
F-statistic
Prob(F-statistic)
var
Mean dependent
Adjusted R-squared
. of regression
. dependent var
Sum squared
resid
Durbin-Watson stat
White Heteroskedasticity Test: F-statistic
Obs*R-squared
Test Equation:
Dependent Variable: STD_RESID^2 Method: Least Squares
6
Probability
Probability
Sample: 1 20
Included observations: 20 Variable
Coefficie
nt
C INCOME
Std. Error
t-Statis
tic
Prob.
nR20.07200.052(q2)5.99或
P2nR20.9625110.05,均可判定加权处理后的模型不存在异方
差。
模型经取对数或加权处理都可以一定程度地消除异方差性。
ls log(consump) C log(income); genr eijdz=abs(resid);
ls(w=1/eijdz) log(Consump) C log(Income)
普通最小二乘模型
CONSUMP = 53 + *INCOME 加权最小二乘模型 CONSUMP = + *INCOME 对数模型:
LOG(CONSUMP)=+*LOG(INCOME) 加权对数模型:
7
LOG(CONSUMP)=+ *LOG(INCOME)
对各种模型的White检验结果,综合如下
模型不取对数 F-statisti
c Obs*R-squa
red 模型取对数 F-statisti
c Obs*R-squa
red
模型不取对数,但加权 F-statisti
c Obs*R-squa
red
模型取对数,且加权 F-statisti
Probability
Probability
Probability
Probability
Probability
Probability
Probability
8
c Obs*R-squa
red
Probability
可见,各种方法都可以起到抑制异方差的效果。
8. 1)若采用对数模型,是否存在序列相关性
ls log(industry) C log(invest)
Dependent Variable: LOG(INDUSTRY) Method: Least Squares Sample: 1901 1921 Included observations: 21
Variable
Coefficient
C LOG(INVEST) R-squared
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
Std. Error
Mean dependent
t-Statistic
Prob.
9
criterion
Sum squared resid
Log likelihood Durbin-Watson stat
Schwarz
criterion
F-statistic
Prob(F-statistic)
LOG(INDUSTRY) = 1. + *LOG(INVEST) i) et1,et散点图 ii) et随t变化的散点图
由两个图形,均可判定存在正序列相关。
还可以利用回归检验法,D -W检验,拉格朗日乘数检验等方法。 iii) D -W检验(DL(21, =, DU(21, =
.= < DL(21, 2,=,至少存在一阶正自相关;但.只适用判别一
阶自相关。
10
iv) 拉格朗日乘数检验
Breusch-Godfrey Serial Correlation LM Test: F-statistic Obs*R-squared
Variable
Coefficient
C LOG(INVEST) RESID(-1) R-squared Adjusted R-squared
Log likelihood Durbin-Watson stat
Probability Probability
Std. Error
t-Statistic
Prob.
Mean dependent var . dependent var
F-statistic Prob(F-statistic)
一阶LM Test:LM Test
20.05,LMnpR2(p1),npR2=9.836218>2(p)3.84
P2npR20.0017110.05
RESID(-1)的t统计量显著(P=<),至少存在一阶自相关。
11
2)按照一阶自相关,用杜宾两步法和广义最小二乘法估计原模型。 杜宾两步法:
YtYt10(1)1(XtXt1)t-t1Yt0(1)Yt11Xt1Xt1t-t1①
i.e.tOLS: ls y c y(-1) x x(-1)ls y c y(-1) x x(-1)
ˆ,代回差分模型①,再次进行OLS估计得y(-1)前面的系数:到
原
模
型
的
参
数
估
计
量
,
即
OLSˆ*ˆ,ˆ*,ˆˆ*(1ˆ①ˆ)。 11000
genr y = log(industry); genr x = log(invest); Step 1: ls y c y(-1) x x(-1)
Dependent Variable: Y Method: Least Squares Sample(adjusted): 1981 2000
Included observations: 20 after adjusting endpoints
Variable
Coefficient
C Y(-1)
Std. Error
t-Statistic
Prob.
12
X X(-1)
R-squared
Adjusted R-squared . of regression
Mean dependent var . dependent var Akaike info
criterion
Sum squared resid Log likelihood Durbin-Watson stat
Schwarz criterion F-statistic Prob(F-statistic)
Step 2: ls y - * y(-1) c x - * x(-1)
Dependent Variable: *Y(-1) Method: Least Squares Sample(adjusted): 1981 2000
Included observations: 20 after adjusting endpoints
Variable
Coefficient
C *X(-1)
R-squared
var
13
Std. Error
t-Statistic
Prob.
Mean dependent
Adjusted R-squared . of regression
. dependent var Akaike info
criterion
Sum squared resid
Schwarz
criterion
Log likelihood Durbin-Watson stat
F-statistic
Prob(F-statistic)
.= 介于 DL(21-1, 2,=与DU(21-1, 2,=之间,不能判别是否存
在一阶正自相关,但可由拉格朗日乘数法判断,此时不存在序列相关性。
Breusch-Godfrey Serial Correlation LM Test: F-statistic
Probability
Obs*R-squared
Probability
Test Equation:
Dependent Variable: RESID Method: Least Squares
14
Variable Coefficient
Std. Error
t-Statistic
Prob.
C *X(-1) RESID(-1) R-squared
var
Mean dependent
Adjusted R-squared
. of regression
. dependent var
Akaike info
criterion
Sum squared resid
Log likelihood Durbin-Watson stat
20.05,LMnpR2=1.553708(p1)3.84
Schwarz
criterion
F-statistic
Prob(F-statistic)
P2npR20.21250.05
拉格朗日乘数检验:D-W stat: > ,不存在序列相关性。
15
ˆ*ˆ0.90350211ˆ*0.415361所以 0
*ˆˆˆ1.1283001ˆ0.631866矫正后的模型:
LOG(INDUSTRY) = + *LOG(INVEST) 原模型:
LOG(INDUSTRY) = 1. + *LOG(INVEST)
广义差分法
..1.348513(dL,dU) ls y c x ar(1) dL1.20,dU1.41,DW(不能判定是否存在一阶自相关) Dependent Variable: Y Method: Least Squares Sample(adjusted): 1981 2000
Included observations: 20 after adjusting endpoints Convergence achieved after 15 iterations
Variable
Coefficient
C X
Std. Error
t-Statistic
Prob.
16
AR(1) R-squared
var
Mean dependent
Adjusted R-squared
. of regression
. dependent var
Akaike info
criterion
Sum squared resid
Log likelihood Durbin-Watson stat
Schwarz
criterion
F-statistic
Prob(F-statistic)
但由LM检验:概率为>,故此时不存在序列相关性。因此模型只存在一阶自相关性。
Breusch-Godfrey Serial Correlation LM Test: F-statistic
ity
Obs*R-squared
Probability
Dependent Variable: RESID
17
Probabil
Variable Coefficient
Std. Error
t-Statis
tic
Prob.
C X AR(1) RESID(-1) Durbin-Watson stat
Prob(F-statistic)
模型为 Y = + *X + * AR(1) 与杜宾两步法矫正的模型:LOG(INDUSTRY) = + *LOG(INVEST) 非常接近。
广义最小二乘法 1212132232212E()n1n2n31n2n2nˆ(X1X)1X1Y 2若仅存在一阶自相关
tt1vt
ls0.688217,21.4733
2n3n1n21121,11201018
1n1
100n200 1ls log(industry) C log(invest) genr resid_corr =
resid
ls resid_corr C resid_corr(-1) 注:resid是内置变量;
Dependent Variable: RESID_CORR Method: Least Squares Variable
Coefficient
C
RESID_CORR(-1)
R-squared
var
Durbin-Watson stat
1Std. Error
t-Statis
tic
Prob.
Mean dependent
Prob(F-statistic)
11ˆ(XX)XY1.7539,0.8386 直接计算 模型为LOG(INDUSTRY)=+*LOG(INVEST),误差偏大。
**XXX,Y3)采用差分形式ttt1tYtYt1,估计原模型
Yt*Xt*t。
ls D(industry) C D(invest) OR COMMAND ls industry–industry(-1) C invest–invest(-1)
19
Dependent Variable: D(INDUSTRY) Method: Least Squares Sample(adjusted): 1981 2000
Included observations: 20 after adjusting endpoints
Variable
Coefficient
C D(INVEST) R-squared
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
Std. Error
Mean dependent
t-Statistic
Prob.
criterion
Sum squared resid
Schwarz
criterion
Log likelihood Durbin-Watson stat
F-statistic
Prob(F-statistic)
Breusch-Godfrey Serial Correlation LM Test:
20
F-statistic
Obs*R-squared
Test Equation:
Dependent Variable: RESID Method: Least Squares
Variable
Coefficient
C D(INVEST) RESID(-1) R-squared
Probability
Probability
Std. Error
t-Statistic
Prob.
Mean dependent
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
criterion
Sum squared resid
Schwarz
criterion
21
Log likelihood Durbin-Watson stat
F-statistic
Prob(F-statistic)
原模型存在一阶正自相关,但经过一阶自相关差分处理后不存在序列相关性(.= > 或P=>)。
模型为:D(INDUSTRY) = + *D(INVEST)
说明:在有的方法不能判别自相关性时,可以用其他方法测试。
9. 说明下述回归模型是否可靠
Y01X1tincome2X2twealthtconsump
Ls CONSUMP C INCOME WEALTH
Dependent Variable: CONSUMP Method: Least Squares Sample: 1 10
Included observations: 10
Variable
Coefficient
C INCOME WEALTH
22
Std. Error
t-Statistic
Prob.
R-squared var
Mean dependent
Adjusted R-squared
. of regression
. dependent var
Akaike info
criterion
Sum squared resid
Log likelihood Durbin-Watson stat
Schwarz
criterion
F-statistic
Prob(F-statistic)
Dependent Variable: CONSUMP
Variable
Coefficient
INCOME C
Std. Error
t-Statistic
Prob.
Dependent Variable: CONSUMP
Variable
Coefficient
23
Std. Error
t-Statistic
Prob.
WEALTH C
Dependent Variable: INCOME
Variable
Coefficient
WEALTH C
R-squared
var
Adjusted R-squared
. of regression
Akaike info
. dependent var
Std. Error
Mean dependent
t-Statistic
Prob.
criterion
Sum squared resid
Log likelihood Durbin-Watson stat
Schwarz
criterion
F-statistic
Prob(F-statistic)
1) 财富变量WEALTH前的符号是负号,与现实相反,经济意义
24
不合理。
2) 拟合优度值较高,收入与财富可以解释消费支出的96%,然而在5%的显著水平下,二者的t检验都不显著。
3)分别做一元回归时,两个变量均显著,说明二者对消费支出确实有影响。但财富变量WEALTH前的符号改变了,且一元回归和二元回归的参数的方差变化很大。
4) F统计量的值很大,说明方程总体上线性显著成立。
5)做两个变量的回归,发现拟合优度很高()。
6)收入INCOME和财富WEALTH的相关系数很大,相关系数阵为:
综上,收入与财富间可能存在着较高的相关性(共线性
0.998577),正是二者的高度相关使得各自对消费的影响无法分
辨。所以这个回归结果是不可靠的,应该首先消除共线性,之后再做OLS回归。
25
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务