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

STATA实用学习笔记(6)

来源:网络收集 时间:2026-08-10
导读: ? Notice that the ologit and oprobit results are quite close to each other ? usually it doesn’t make much difference whether you use ordered logit or ordered probit. 3.6 Count data models 1、适用情

? Notice that the ologit and oprobit results are quite close to each other

? usually it doesn’t make much difference whether you use ordered logit or ordered

probit.

3.6 Count data models

1、适用情况:

计数模型适用于因变量是非负的离散数,且数据有实际的意义。

? 比如:consider the number of financial analysts that follow a given company

? if the company is not followed by any analysts, Y = 0 ? if the company is followed by one analyst, Y = 1 ? if the company is followed by two analysts, Y = 2 ? if the company is followed by two analysts, Y = 3

此种数据无法使用OLS回归,因为因变量无法满足数据是在负无穷到正无穷之间,因为只能取非负数,同时要求因变量是连续变量,而计数模型的因变量是离散的。 2、适用的回归模型

? Two distributions that fulfill the criteria of having non-negative discrete integer values

are the “Poisson” and the “negative binomial”. ? the negative binomial (nbreg) ? the Poisson (poisson) 3、实际中计数模型的例子:

? The number of R&D patents awarded ? The number of airline accidents ? The number of murders

? The number of times that mainland Chinese people have visited Singapore ? The number of weaknesses found by peer reviewers at audit firms

4、模型的选择:

(1)POISSON模型:

? The Poisson distribution is most often used to determine the probability of x

occurrences per unit of time。E.g., the number of murders per year ? The basic assumptions of the Poisson distribution are as follows:

? The time interval can be divided into small subintervals such that the probability of an

occurrence in each subinterval is very small

? The probability of an occurrence in each subinterval remains constant over time

? The probability of two or more occurrences in each subinterval must be small enough

to be ignored

? An occurrence or nonoccurrence in one subinterval must not affect the occurrence or

nonoccurrence in any other subinterval (this is the independence assumption). 满足条件下的例子:

? The probability of a murder occurring during any given minute is small

? The probability of a murder occurring during any given minute remains constant

during the year

21

? The probability of more than one person being murdered during any given minute is

very small

? The number of murders in any given time period is independent of the number of

murders in any other time period. 参数的估计:

? The only parameter needed to characterize the Poisson distribution is the mean rate at which events occur 。“incidence rate” ,?

? For example, ? can be the average number of murders per month or the average

number of analysts per company

POISSON分布的概率函数:

? 如果已知每月的犯罪数为2,求每月有3起犯罪的概率。

模型特点:

? 模型只有一个参数

λ,发生率可用右式估计。

命令:

? control for heteroscedasticity using the robust option

poisson weaknesses reviewed_firm_also_reviewer litigation_dummy , robust

? panel dataset (it isn’t) you would also need to control for time-series dependence

using the cluster() option 缺点:

? Unobserved heterogeneity in the data (e.g., omitted variables) will often cause the

variance to exceed the mean (a phenomenon known as “overdispersion”). 回归后检验:

? 回归后马上用poisgof 命令,检验是否显著,如显著则无法使用,而须使用The

negative binomial ,该模型无须assume that the mean and variance of the distribution are the same (2)the negative binomial模型:

? nbreg weaknesses reviewed_firm_also_reviewer litigation_dummy , robust

(cluster())

? 回归结果的α显著,说明POISSON模型不适用。

22

3.7 Tobit and interval regression models

1、适用的数据类型:

? censoring (or truncation) of the dependent variable. 当观众数大于座位数时,观测不到。

2、选择模型:

? The censoring problem can be solved by estimating a “tobit” model ? The tobit model is somewhat similar:

Y* = a0+ a1 X + e

Y = 0 if -? < Y* ? 0 Y = Y* if 0 < Y* < +? The Y* and Y variables are both observed when they are greater than zero (Y* is

unobserved when Y = 0)

? Both the probit and tobit models assume that the errors (e) are normally distributed. 3、例子:

? Recall that in our fee dataset, the nonauditfees variable is left-censored at zero

because many companies choose not to purchase any non-audit services。This phenomenon is like some individuals choosing not to purchase any cigarettes when the price exceeds P0

? gen lnta=ln(totalassets)

? egen miss=rmiss(lnnaf lnta) (当lnnaf lnta为miss时,miss为1) ? tobit lnnaf lnta if miss==0, ll(0) (ll(数字)表示左边截取的数据,ul(数字)表示

右边截取的数字。)

? tobit lnnaf lnta if miss==0, ll(此命令与上命令功能相同) ? 回归完成后可以用命令显示有多少数据 censoried.

count if miss==0 & lnnaf==0 count if miss==0 & lnnaf>0

4、当左右两边均截取以后,也可使用tobit模型

? gen lnnaf1=lnnaf

? replace lnnaf1=5 if lnnaf>5 & lnnaf!=. ? tobit lnnaf1 lnta if miss==0, ll(0) ul(5)

? tobit lnnaf1 lnta if miss==0, ll ul (如果截取数字是样本中的最大和最小值不用列出,

系统会自动选取)。

? tobit lnnaf lnta if miss==0, ll ul(5) robust cluster (companyid)(控制异方差和时间序

列不独立)

23

3.8 Duration models(生存模型)

1、适用数据:

因变量测试某一事件持续的时间。例如:

? Duration of life (medical, engineering)

? how long do people live for? ? how long do machines last?

? Duration of unemployment (economics)

? ho …… 此处隐藏:420字,全部文档内容请下载后查看。喜欢就下载吧 ……

STATA实用学习笔记(6).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)