第9讲二元结果模型

上传人:新** 文档编号:486951400 上传时间:2023-06-07 格式:DOCX 页数:8 大小:31.70KB
返回 下载 相关 举报
第9讲二元结果模型_第1页
第1页 / 共8页
第9讲二元结果模型_第2页
第2页 / 共8页
第9讲二元结果模型_第3页
第3页 / 共8页
第9讲二元结果模型_第4页
第4页 / 共8页
第9讲二元结果模型_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《第9讲二元结果模型》由会员分享,可在线阅读,更多相关《第9讲二元结果模型(8页珍藏版)》请在金锄头文库上搜索。

1、第9讲离散选择模型之二元结果模型参考书目:1. Long, J. S., and J. Freese. 2006Regression Models for Categorical Dependent Variables Using Stata. 2nd ed . College Station, TX: Stata Press教学视频:Logistic regression, part 1: Binary predictorsLogistic regression, part 2: Continuous predictorsLogistic regression, part 3: Factor

2、 variables一、离散被解释变量的例子二元结果模型:考研或不考研;就业或待业;买房或不买房;买保险或不买保险; 贷款申请被批准或拒绝;出国或不出国;回国或不回国;战争或和平;医药实验 中的生或死。多元结果模型:对不同交通方式的选择(走路、骑车、坐车上班);对不同职业的 选择。这类模型被称为 离散选择模型(discrete choice model)考虑到离散被解释变量 的特点,通常不宜用OLS进行回归。假设个体只有两种选择,比如y=1 (考研)或y=0 (不考研)。是否考研,取决于研究生毕业后的预期收入、个人兴趣、本科 毕业后直接就业的收入前景等。所有解释变量都包括在向量x中。二、二元结

3、果模型的微观基础对于二元选择行为,可通过“潜变量”(latent variably概括该行为的净收益(收益减去成本)。如果净收益大于0,则选择做;否则,选择不做。y*=x B + 其中,净收益y*为潜变量,不可观测。选择规则为y=1,若 y*0y=0,若 y*如果e为正态分布,则为Probit;如果e为逻辑分布,则为Logit。logistic - Logistic regression, reporting odds ratios(Logistic回归,报告优势比/比值比)对于 Logit 模型,t己 p= P(y =1|x ),则 1-P= P(y =0|x )。p /(1-p)称为“几率

4、比/优势比/比值比(odds ratio)。那么什么是几率比?举例说明,假设在检验药物疗效的随机实验中,“ y =1 ”表示“生”, y =0表示“死”;则几率比为2意味着存活的概率是死亡概率的两倍。命令语法:logistic depvar indepvars if in weight .options命令logistic拟合logistic回归模型,其中depvar是一个0/1变量(更准确地说,是一个0/非0变量)。logistic显示的估计结果是优势比;要想查看系数,运行 logistic 后,输入 logit o一、概述logistic替代logit命令,通常是拟合最大似然logit模型

5、的首选方法。Stata 使用logit和logistic意味着同样的事情:最大似然估计。并且两种命令会得到相 同的结果。logistic命令通常优于logit命令,原因是logistic提供优势比而不是系 数的估计结果。对于 logistic 回归的介绍,请参阅 Lemeshow & Hosmer(2005), Pagano & Gauvreau (2000, 470- 487)或 Pampel (2000); 一个完整的,非数学的讨论,请 参阅 Kleinbaum & Klein (2010); 一个更深入的讨论,请参阅 Hosmer, Lemeshow, & Sturdivant (201

6、3)。Gould (2000)讨论了关于 logistic 回归的解释。Dupont (2009) 和 Hilbe (2009)用 Stata实例讨论了 logistic 回归。Vittinghoff et al. (2012)重点讨 论了模型设定问题。Stata有一系列命令用来估计二分类或多分类因变量模型。Long和Freese(2014)专门论述了如何使用 Stata拟合此类模型。下面是一些常用估计命令的列 表。help estimation commands供了 Stata全部估计命令的完整列表。asclogitR麦克法登离散选择模型(McFadden s choice)asmprobi

7、tR多加式probit模型asroprobitR排序probit模型binregR二项式的广义线性模型biprobitR二元probit模型blogit;R分组数据的logit模型bprobitR分组数据的probit模型clogitR条件(固定效应)logistic回归cloglogR互补重对数模型exlogisticR精确logistic回归glmR广义线性模型glogitR分组数据的加权最小一乘logistic回归gprobitR分组数据的加权最小一乘probit回归heckoprobitR有序probit的样本选择模型heckprobitRprobit的样本选择模型hetprobitR

8、异方差probit模型ivprobitR具有连续内生变量的probit模型logitRLogistic回归分析,报告系数mecloglogME多层次混合效应互补双对数回归meglmME多层次混合效应广义线性模型melogitME多层次混合效应logistic回归meprobitME多层次混合效应probit回归mlogitR多分类因变量logistic回归mprobitR多分类因变量probit回归nlogitR嵌套logit回归ologitR有序logistic回归oprobitR有序probit回归probitRProbit回归rologitR有序秩logistic回归scobitRSke

9、wed logistic regressionslogitRStereotype logistic regressionsvy: cmdSVY svy estimation命令的svy版xtcloglogXT随机效应和总体平均cloglog模型xtgeeXTGEE总体平均广义线性模型xtlogitXT固定效应、随机效应和总体平均logit模型xtologitXT随机效应启序logistic模型xtoprobitXT随机效应启序probit模型xtprobitXT随机效应和总体平均probit模型例:估计决定美国妇女就业与否的二元结果模型。 数据集包括以下变量:虚拟变量0。*(1=就业),age

10、吓龄),虚拟变量married(1 = 已婚),children(子女数), education便教育年限)。考虑以下模型:worki= B 0+ B 1a+e 2married+ 0 3childrer+ 0 4educatio+ a作为对照,首先使用OLS进行线性概率模型(LPM)估计:use womenwk1,clear (原数据是 womenwk.dta)reg work age married children educationprobit work age married children education,nologmfx (计算probit模型在样本均值处的边际效应,与 O

11、LS估计的回归系数 进行比较)estat classification计算预测准确的百分比)logit work age married children education,nolog mfxestat classificationhetprob work age married children education,het(age married children education) nolog (p值为0.78,所以接受“同方差”的原假设。)generate age2=age*agegenerate agemari=age*marriedgenerate agechr=age*chil

12、drenquietly logit work age married children education age2 agemari agechrtest age2 agemari agech联受零假设)quietly logit work age married children educationestimates store blogitquietly probit work age married children educationestimates store bprobitquietly regress work age married children educationest

13、imates store bolsquietly logit work age married children education,vce(robust)estimates store blogitrquietly probit work age married children education,vce(robust)estimates store bprobitrquietly regress work age married children education,vce(robust)estimates store bolsrestimates table blogit blogit

14、r bprobit bprobitr bols bolsr, t b(%7.3f) stfmt(%8.2f)例子:航天飞机数据use shuttle,clear谎国航天飞机25次飞行数据,包括1986年挑战者号最后一次升空失败的飞行)describe(distress助推结点一处或多处受损;temp:助推结点的温度;date从1960.1.1起的消逝天数)generate date=mdy(month,day,year)tabulate distresstabulate distress,nolabelgenerate any=distressreplace any=1 if distress=2建立虚拟变量 any, 0代表无损坏,1代表有1处或更多损坏)logistic any date (logistic提供优势比,eAb。它的意义是,自变量每增加一 个单位时,事件(y=1)的发生比的变化倍数(如有其他自变量,则以其 他自变量保持不变为条件)predict phat阪得预测概率)label variable phat Predicted P(distress=1) ”graph twoway connected phat date estat classification (默认应用0.5的概率作为分割点)。几种符号的含义:D: 一个观测中所关注的

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 演讲稿/致辞

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号