如何通过WLS驱除 影响?
reg DISTANCE AGE KIDS INCOME
通过生成图片 发现 残差和 income 可能存在 异方差。(下图 左上的图)
twoway (scatter res INCOME) ,saving (1)
(file 1.gph saved)
. twoway (scatter res AGE),saving (2)
(file 2.gph saved)
. twoway (scatter resKIDS),saving (3)
(file 3.gph saved)
graph combine 1.gph 2.gph 3.gph
进一步 测定:
Golddeld-Quandt Test
sort INCOME
g index = _n
reg DISTANCE AGE KIDS INCOME if index <81
scalar RSS1 = e(rss)
scalar list RSS1
RSS1 = 7434484.1
reg DISTANCE AGE KIDS INCOME if index >112
scalar RSS2 = e(rss)
scalar list RSS2
RSS2 = 24239434
scalar GQ = RSS2/RSS1
scalar DOF = 81-3-1
scalar PV = Ftail(DOF,DOF,GQ)
scalar list GQ PV
GQ = 3.2604056
PV = 2.460e-07
对比确定存在异方差 GQ 大于 PV
为了修正影响 已经 使用了. reg DISTANCE AGE KIDS INCOME,robust
但我想 知道 如果我想要用 WLS 进行修正 应该如何做
比如:
用ressidual 的标准差 作为 权重参数 调整
用ressidual 的方差 作为 权重参数 调整
我最糊涂的是 我只知道当 一元回归的时候可以用
g yi = y / sqrt (res)
g ic = 1/sqrt(res)
g ix = x/sqrt(res)
reg iy ic ix, noco
来做
那么 如果是 多元 那么是否应该是:
g yi = y / sqrt (res)
g ic = 1/sqrt(res)
g ix1 = x1/sqrt(res)
g ix2 = x2/sqrt(res)
g ix3 = x3/sqrt(res)
reg iy ic ix1 ix2 ix3, noco
这样对吗?