教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 实用模板 >

STATA实用学习笔记(8)

来源:网络收集 时间:2026-08-10
导读: 小结:根据因变量的类型选择不同的回归模型 Dependent variable (Y) Continuous (-? Continuous but censored (kL ? Y 第四章 面板数据 主要内容: ? 4.1 The basic idea ? 4.2 Linear regression ? 4.3 Logit and

小结:根据因变量的类型选择不同的回归模型 Dependent variable (Y) Continuous (-? < Y < +?) Examples Estimation method(s) OLS Quantile regression Probit Logit Multinomial logit Multinomial probit STATA command regress qreg Log of audit fees Stock returns Cost of capital Listed / Not listed Big 6 / Non-Big 6 auditor Method of transport (train, bus, car, bicycle) Type of company (private, public unquoted, quoted) Type of peer review report (adverse, modified, unmodified) Examples Binary (Y = 0, 1) Discrete and unordered (Y = 0, 1, 2,..) probit logit mlogit mprobit Discrete and ordered (Y = 0, 1, 2,..) Dependent variable (Y) Discrete count data (Y = 0, 1, 2, …) Ordered probit Ordered logit oprobit ologit Estimation method(s) Poisson Negative binomial STATA command poisson nbreg Number of weaknesses disclosed in peer review report Non-audit fees Football attendance Duration of unemployment CEO tenure Company survival 26

Continuous but censored (kL ? Y < kH) Duration data (often censored) kL ? Y < kH Tobit tobit Cox proportional hazards stcox

第四章 面板数据 主要内容: ? 4.1 The basic idea ? 4.2 Linear regression ? 4.3 Logit and probit models ? 4.4 Other models

? 4.1 The basic idea

1、面板数据:横截面时间序列,自变量中同一个特征变量连续多年其他变量有变动。在不同年度数据间可能存在一个稳定影响的公司或个人特征因素。在以前的学习中,为消除时间序列不独立,在回归命令中加入robust cluster () 选项来消除异方差和变量相关错误。 2、面板数据的优点:一是样本量大,估计精确,二是可以在回归中加入动态影响因素(上一年或下一年数据),三是可以控制不可观测变量对不同年度的影响。 3、面板数据可能存在的计量问题:

一般的回归模型可用上式来表示,如果是面板数据,ε中应该包含两部分,一部分为随机误差,一部分为每年的固定影响。即:

,这样回归模型即变为:

u表示各年的固定影响,e为误差项,X为变量值。

如果u和X不相关,则X的系数是无偏的,但实际中常常的相关的,因此需要进行特别处理。

4、处理计量问题的一些方法:

(1)最简单的方法是在回归式中加入robust cluster ()选择项。

(2)使用固定效用模型:对特征变量取不同的哑变量,在回归中加入哑变量来控制个人特征的影响。例如:

? tab persnr, gen(dum_)(根据不同的persnr值产生哑变量dum_1、dum_2。。。) ? reg lsat age dum_1 dum_2 dum_4

? reg lsat age dum_1 dum_2 dum_3 dum_4, nocons

为消除多重共线性,回归时如保留常数项时,哑变量就需要减少一个,如想保留所有哑

27

变量,则需去掉常数项。

? 另一种命令可以将特征变量的值分开,separate lsat, by(persnr),此命令根据

不同的persnr产生不同的变量序列lsat1、lsat2、lsat3。。。,以便分别进行对比分析,比如以下命令:

twoway (lfit lsat1 age) (scatter lsat1 age) twoway (lfit lsat2 age) (scatter lsat2 age) twoway (lfit lsat3 age) (scatter lsat3 age) twoway (lfit lsat4 age) (scatter lsat4 age)

? 另一种命令可以同时画出不同分变量的直线图,两变量间的拟合图以及不同

分变量间的散点图。命令如下:

twoway (line lsat_hat1-lsat_hat4 age) (lfit lsat age) (scatter lsat1-lsat4 age)

图形结果如下:

(3)使用命令:

fixed effect model命令:xtreg lsat age , fe i(persnr) random effect model命令:xtreg lsat age , re i(persnr)

在上式中,如果θ=1,则变形为fixed effect model,如果θ=0,则变形为OLS模型,如果0<θ<1,则为random effect model。

通过上式的变换,基本消除了在每一年中保持不变的影响部分。有时Y也可以用上一期的

?Yi?1来代替。

28

? 4.2 Linear regression

通过上面的讲解,知道连续变量的线性回归可以用OLS模型、fixed effect model和random effect model。什么情况下使用哪一种模型更有效?

1、当ui和 Xit相关时,使用fixed effect model,当不相关时, it is better to use the random-effects model (because it is more efficient).只有当没有时间序列效应时才用OLS模型。

2、判断使用模型的方法:

(1)固定效应模型与随机模型:

使用Hausman方法判断,原理是如果相关固定效应模型无偏,而随机模型有偏,二者相差会较大;如果不相关,两个都无偏,随机模型会更有效,二者不会有太大差别。因此方法就是比较系数是否有显著不同。

? Null hypothesis (H0): ui and Xit are uncorrelated ? The Hausman statistic is distributed as chi2

? If the chi2 statistic is positive and statistically significant, we can reject the null hypothesis. This

would mean that the fixed-effects model is preferable because the coefficients are consistent. ? If the chi2 statistic is not positive and statistically significant, we cannot reject the null

hypothesis. This would mean that the random-effects model is preferable because the coefficients are consistent and efficient.

实现命令:

? xtreg lsat age, fe i( persnr) ? estimates store fixed_effects ? xtreg lsat age, re i( persnr) ? estimates store random_effects

? hausman fixed_effects random_effects

注意事项:小样本时结果并不一定可靠。On the other hand, this result is not very reliable because the asymptotic assumption fails to hold in this small sample.

(2)随机模型和OLS模型:

? If we cannot reject the null hypothesis that ui and Xit are uncorrelated, we need to determine

whether the ui are distributed randomly across individuals. 用the Breusch-Pagan test来检验,whether ?u2 is significantly positive.

实现命令:

xtreg, re(随机模型面板数据回归) ttest0 检验结果如下:未拒绝零假设。

29

3、使用固定效用模型时要注意,

接近于0时,结果不可靠。

4.3 Logit and probit models

1、当因变量为0和1时,数据为面板数据时,可以使用命令消除时间序列计量问题:

? xtlogit , fe i()

但结果的解释与连续变量不一样,当因变量没有变动时,回归时自动剔除这些样本。实际中也有不少这种例子,比如研究公司在某一年是否有欺诈时,大多数公司不会有,因此Y=0在样本年度中一直不变,使用固定效用模型将剔除这些样本。

? xtlogit , re i()

使用随机模型可保留样本中的所有样本。

2、使用哪一 …… 此处隐藏:2162字,全部文档内容请下载后查看。喜欢就下载吧 ……

STATA实用学习笔记(8).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/519856.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)