计量经济学总体介绍:
知乎上有一位前辈总结的很不错,我就不详细介绍了。
一、一元线性回归模型
参考书目:
《计量经济学(第四版)》高等教育出版社 第二章
《高级计量经济学及Stata应用(第二版)》 第三章、第五章、第六章
1、总体回归、样本回归
①总体回归:


②样本回归:


SRF: Sample Regression Function
PRF: Population Regression Function
2、一元线性回归,对随机干扰项的基本假设(古典假设):(5点)
①

②

③

④

⑤

简单记忆如下:

3、一元线性回归,参数估计:
①最小二乘法(Least Squares):

上述推导中注意:

另一种解释方式:


②最大似然法(Maximum Likelihood):

4、一元线性回归,最小二乘估计量,统计性质:
①线性性质:

②无偏性:

③有效性:(最小方差性)

④总体而言:

5、一元线性回归,统计检验、预测:
①拟合优度检验:

②变量的显著性检验:

③参数检验的置信区间估计:

④总体条件均值置信区间、个别值预测值置信区间:


6、Stata代码实现一元线性回归
1.散点图:
scatter y x
2.相关系数:
corr y x
pwcorr y x,sig
(在Stata中,命令corr用于计算一组变量间的协方差或相关系数矩阵;命令pwcorr可用于计算一组变量中两两变量的相关系数,同时还可以对相关系数的显著性进行检验;命令pcorr 用于计算一组变量中两两变量的偏相关系数并进行显著性检验。)
3.回归:
reg y x
4.预测:
predict yy,xb(拟合值预测)
predict e,r(残差值预测)
5.预测值的预测区间:
predictnl 预测变量名=predict(xb),ci(lb1 ub1) l(95) (均值预测区间)
adjust x=22001,stdf ci(个别值预测区间)

图中左上角
图中左上角的是对于regress后得到的model 的一个“analysis-of-variance(ANOVA)”表格。
其每一列的头:SS , df , MS 分别对应:“sum of squares”, “degrees of freedom”和“mean square”。
第一列:可以知道Model的SS(15241773.7)/Total的SS(17598834.8)=R-squared(0.8661)即R2。R2的意思就是说,这个模型说明解释了这些变量中多少的variance。
第二列:自由度,一共有N个sample这个数据集就有(N-1)个df(因为要减去均值)。模型的自由度由模型有几个predictor决定。
第三列:MS一般是用于计算F-statistic的。
图中的右上角
图中的右上角是另一些统计描述:
第一行:Number of obs 一共有多少个sample
第二行:F(df of Model, df of Residual) = MS of Model(15241773.7)/MS of Residual(130947.839) = 116.40
The F statistic tests the hypothesis that all coefficients excluding the constant are zero.
这个F值的H0假设是:所有的predictor都不对y产生影响,即所有predictor的coef都会是0,所有的predictor都不significant。
第三行:Prob > F 的值是上述的H0假设的成立的可能性。当其趋近于0的时候,说明至少会有一些predictor的coef不为0.(p-value)
第四行:R-squared
第五行:Adj R-squared 由于R2存在一个问题:无论什么predictor加到模型中,R2都会变大。为了避免这个问题,Adj R-squared惩罚了模型的复杂度。
第六行:root mean squared error是MS of Residual的平方根(361.87 = 130947.839^0.5),其意义是回归模型的residual部分的standard deviation。
图中下面
图中下面的部分就是regression的结果了。
最后一行是模型的常数项
第一列是模型的系数,根据系数我们就可以写出回归的线性模型了
第二列是线性回归系数的standard error
这个系数是对前面coef的估计的可信度估计,越小越好。
这是估计的标准误差,是残差均方开根号的值,残差均方等于残差平方和除以自由度,残差平方和等于总平方和减去回归平方和
第三列是t-statisitic
正常T-statistic应该在0假设(null hypothesis)为真时,服从T分布(T-distribution).
粗略地讲这个值大于2,对应的predictor就是significant。
Coefficient除以standard error 等于 t-statistic
第四列是这个t-statistic的p-value,一般来讲小于0.05就是significant的
第五六列是95%confidence interval of coef,系数的95%置信区间。
网友评论