
4第四章习题参考答案.pdf
20页第四章习题参考答案P 135 7. 1 )用 OLS法建立居民人均消费支出与可支配收入的线性模型create u 20 ; data consump income;ls consump c incomeDependent Variable: CONSUMPMethod: Least SquaresSample: 1 20Included observations: 20VariableCoefficientStd. Errort-StatisticProb. CINCOMER-squared Mean dependent var Adjusted R-squared . dependent var . of regression Akaike info criterion Sum squared resid Schwarz criterion Log likelihood F-statistic Durbin-Watson stat Prob(F-statistic) 线性模型如下:CONSUMP = 5389 + *INCOME 2)检验模型是否存在异方差性 i) XY图:是否有明显的散点扩大 / 缩小 / 复杂型趋势scat income consump ii)解释变量残差图:是否形成一条斜率为0的直线scat income resid2 或者genr ei2=resid2;scat income ei2 由两个图形,均可判定存在递增型异方差。
还可以用帕克检验,戈里瑟检验,戈德菲尔德- 匡特检验,怀特检验等方法iii) 戈德菲尔德 -匡特检验: 共有 20个样本,去掉中间 1/4 个样本(4个),剩余大样本、小样本各8个Sort income;smpl 1 8;ls consump C income Smpl 13 20;ls consump C income 210.050.05615472.0126528.34.86(,)(81, 81)4.28118 1 18 1 11111RSSRSSFFFnknknknk,存在异方差iV) 怀特检验:因为只有一个变量,故是否含有交叉项是一样的22201122314251222012345220112122012:0,( ),:0,( ),iiiiiiiiiiiieaa Xa Xa Xa Xa X XvHaaaaanReaa Xa XvHaanR变量个数变量个数Viewresidual testwhite heteroskedastcity (cross terms / no cross terms ) White Heteroskedasticity Test: F-statistic Probability Obs*R-squared Probability Dependent Variable: RESID2 Method: Least Squares Sample: 1 20 Included observations: 20 Variable Coefficient Std. Error t-Statistic Prob. C INCOME INCOME2 R-squared Mean dependent var Adjusted R-squared . dependent var . of regression Akaike info criterion Sum squared resid +10 Schwarz criterion Log likelihood F-statistic Durbin-Watson stat Prob(F-statistic) 22220.05( ),212.65213(2)5.99nRnR,存在异方差。
还可以通过概率220.0017890.05Pn R判定存在异方差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 Std. Error t-Statistic Prob. C INCOME Weighted Statistics R-squared Mean dependent var Adjusted R-squared . dependent var . of regression Akaike info criterion Sum squared resid Schwarz criterion Log likelihood F-statistic Durbin-Watson stat Prob(F-statistic) Unweighted Statistics R-squared Mean dependent var Adjusted R-squared . dependent var . of regression Sum squared resid Durbin-Watson stat White Heteroskedasticity Test: F-statistic Probability Obs*R-squared Probability Test Equation: Dependent Variable: STD_RESID2 Method: Least Squares Sample: 1 20 Included observations: 20 Variable Coefficient Std. Error t-Statistic Prob. C INCOME 220.050.076420(2)5.99nRq或220.9625110.05Pn R,均可判定加权处理后的模型不存在异方差。
模型经 取对数 或加权 处理都可以一定程度地消除 异方差性 ls log(consump) C log(income);genr eijdz=abs(resid);ls(w=1/eijdz) log(Consump) C log(Income) 普通最小二乘模型CONSUMP = 5389 + *INCOME 加权最小二乘模型CONSUMP = + *INCOME 对数模型:LOG(CONSUMP)=+*LOG(INCOME) 加权对数模型 :LOG(CONSUMP)=+ *LOG(INCOME) 对各种模型的White 检验结果,综合如下模型不取对数F-statistic Probability Obs*R-squared Probability 模型取对数F-statistic Probability Obs*R-squared Probability 模型不取对数,但加权F-statistic Probability Obs*R-squared Probability 模型取对数,且加权F-statistic Probability Obs*R-squared Probability 可见,各种方法都可以起到抑制异方差的效果。
8. 1 )若采用对数模型,是否存在序列相关性ls log(industry) C log(invest)Dependent Variable: LOG(INDUSTRY) Method: Least Squares Sample: 1901 1921 Included observations: 21 Variable Coefficient Std. Error t-Statistic Prob. C LOG(INVEST) R-squared Mean dependent var Adjusted R-squared . dependent var . of regression Akaike info criterion Sum squared resid Schwarz criterion Log likelihood F-statistic Durbin-Watson stat Prob(F-statistic) LOG(INDUSTRY) = 1. + *LOG(INVEST) i) 1,ttee散点图ii) te随 t 变化的散点图由两个图形,均可判定存在正序列相关还可以利用 回归检验法, D - W 检验,拉格朗日乘数检验等方法。
iii) D - W 检验 (DL(21, =, DU(21, =.= )3.84LMnp Rpnp Rp220.0017110.05Pnp RRESID(-1) 的 t 统计量显著( P= ,不存在序列相关性所以*11*000?0.903502?0.415361?11.1283?0.631866矫正后的模型:LOG(INDUSTRY) = + *LOG(INVEST) 原模型:LOG(INDUSTRY) = 1. + *LOG(INVEST) 广义差分法ls y c x ar(1) 1.20,1.41,.1.348513(,)LULUddDWdd(不能判定是否存在一阶自相关)Dependent Variable: Y Method: Least Squares Sample(adjusted): 1981 2000 Included observations: 20 after adjusting endpoints Convergence achieved after 15 iterations Variable Coefficient Std. Error t-Statistic Prob. C X AR(1) R-squared Mean dependent var Adjusted R-squared . dependent var . of regression Akaike info criterion Sum squared resid Schwarz criterion Log likelihood F-statistic Durbin-Watson stat Prob(F-statistic) 但由 LM 检验:概率为 ,故此时不存在序列相关性。
因此模型只存在一阶自相关性Breusch-Godfrey Serial Correlation LM Test: F-statistic Probability Obs*R-squared Probability Dependent Variable: RESID Variable Coefficient Std. Error t-Statistic Prob. C X AR(1) RESID(-1) Durbin-Watson stat Prob(F-statistic) 模型为Y = + *X + * AR(1) 与杜宾两步法矫正的模型:LOG(INDUSTRY) = + *LOG(INVEST)非常接近广义最小二乘法21121312221112122322123?()()nnnnnnEXXXY若仅存在一阶自相关210.688217,1.473643tttvls21221212310011011,100011nnnnnls log(industry) C log(invest) genr resid_corr = resid ls resid_corr resid_corr(-1) 注: resid 是内置变量;Dependent Variable: RESID_CORR Method: Least Squares Variable Coefficient Std. Error t-Statistic Prob. C RESI。












