豆瓣
扫码直接下载
读过 高级计量经济学及Stata应用
*-chp11_二值选择模型 /* * 二值模型的stata命令为 probit y x1 x2 x3, r //probit模型 logit y x1 x2 x3, or vce(cluster culstvar) //logit模型 // r表示稳健标准误,or 表示显示几率比,选择项vce(cluster culstvar) 表示使用clustvar 为聚类变量的聚类稳健标准误 * 估计后,可以用以下命令进行预测,并计算准确预测的百分比 predict yhat //计算发生概率的预测值yhat estat clas //计算预测准确的百分比,clas表示classification * 在stata 12中,计算边际效应的命令为, margins, dydx(*) //计算所有解释变量的平均边际效应 margins, dydx(*) atmeans //计算所有解释变量在样本均值处的边际效应 margins, dydx(*) at (x1=0) //计算所有解释变量在x1=0处的边际效应 margins, dydx(x1) //计算解释变量x1的平均边际效应 margins, eyex(*) //计算平均弹性,其中两个“e”均指elasticity margins, eydx(*) //计算平均半弹性,x变化1单位引起y变化百分之几 margins, dyex(*) //计算平均半弹性,x变化1%引起y变化几个单位 // 其中,“*”代表所有解释变量 */ *- e.g. cd "…/data" use womenwk.dta, clear reg work age married children education, r * 其次,用logit估计 logit work age married children education, nolog * 然后用文件标准误进行logit估计 logit work age married children education,r nolog * 汇报几率比而非系数 logit work age married children education,or nolog * 计算平均边际效应 margins, dydx(*) * 计算在样本均值处的边际效应 margins, dydx(*) atmeans * 只关心变量age在“age = 30”处的边际效应 margins, dydx(age) at (age = 30) estat clas * 假设年龄相同的个体存在组内相关,故使用age为聚类变量来计算聚类稳健的标准误 logit work age married children education, nolog vce(cluster age) * 类似地,对模型进行probit估计 probit work age married children education, nolog * 考察probit模型的边际效应及预测准确度 margins, dydx(*) estat clas * 二值选择模型中的异方差问题 * 异方差下进行probit估计的stata命令 * hetprob y x1 x2 x3, het(varlist) hetprob work age married children education, het(age married children education) nolog * 稀有事件偏差 * 方法一,继续使用logit模型,但使用“偏差修正估计” relogit, norobust * 方法二,补对数-对数模型 cloglog y x1 x2 x3, r * e.g. 中原王朝受征服 cd "…/data" use nomadic_conquest.dta, clear sum conquered diff age wall drought1 //受征服仅为3.29% logit conquered diff age wall drought1, r nolog margins, dydx(*) * relogit 方法进行修正 relogit conquered diff age wall drought1 * relogit 不提供边际效应计算,故提供补对数-对数模型 cloglog conquered diff age wall drought1, r nolog margins, dydx(*) * 11.6 含内生变量的Probit模型(选读) * 含内生变量Probit模型的stata命令为: * ivprobit y1 x1 x2 (y2 = z1 z2), r * ivprobit y1 x2 (y2 = z1 z2), first twostep * e.g. mus14data.dta为例 use mus14data.dta, clear probit ins linc female age age2 educyear married hisp white chronic adl hstatusg, r nolog * IV probit ivprobit ins female age age2 educyear married hisp white chronic adl hstatusg (linc = retire), nolog * 两步法估计 ivprobit ins female age age2 educyear married hisp white chronic adl hstatusg (linc = retire), first twostep * 11.7 双变量 Probit 模型(选读) * biprobit y1 y2 x1 x2 x3, r (解释变量完全相同的情形) * biprobit (y1 = x1 x2) (y2 = x1 x3), r (解释变量不完全相同的情形) use school.dta, clear biprobit (private = loginc logptax school) (vote = loginc logptax years school), r nolog probit vote loginc logptax years school, r nolog * 11.8 部分可观测的双变量Probit模型 * biprobit(y1 = x1 x2)(y2 = x1 x3), r partial diffcult * gen z2 = z1 * biprobit (z1 = x1 x2)(z2 = x1 x3), r partial diffcult biprobit (private = loginc logptax school) (vote = loginc logptax years school), r partial diffcult nolog h biprobit引自 第11章二值选择模型
> 一碗刀削面的所有笔记(54篇)
*-chp9 模型设定与数据问题 * 9.4 解释变量个数的选择 clear all cd "……" * reg y x1 x2 x3...
cd "……" /* * 10.3 二阶段最小二乘法 ivregress 2sls y x1 (x2 = z1 z2) //使用普通标准误 ...
* 12.3 混合Logit模型 clear all cd "…data" * mlogit y x1 x2 x3, rrr base(#) * 可以通过...
* chp13 计数与排序模型 * 13.1 排序模型 * 排序模型的stata命令为: * oprobit y x1 x2 x3 /...
表示其中内容是对原文的摘抄