"*-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 *"
"*-chp14 受限被解释变量 *- 14.1 断尾回归 * 断尾回归的stata命令: * truncreg y x1 x2 x3, ll(#)ul(#) * 选择项“ll(#)”表示lower limit,即左边断尾; * 选择性“ul(#)”表示upper limit,即右边断尾; * 如果同时使用两个选择项,则表示双边断尾。 cd "…data" use laborsub.dta, clear tab lfp * 先进性ols回归 reg whrs kl6 k618 wa we if whrs > 0 * 然后进行断尾回归,假设在“whrs=0”处存在左边断尾 truncreg whr"
"clear all cd …… global Out …… use $Out/nerlove.dta, clear reg lntc lnq lnpl lnpk lnpf * 画残差图 rvfplot rvpplot lnq * white检验 estat imtest, white * BP检验 estat hettest, iid estat hettest, rhs iid estat hettest lnq, iid * WLS cap drop e1 e2 lne2 reg lntc lnq lnpl lnpk lnpf //回归 predict e1, res //计算残差 g e"
"*-chp9 模型设定与数据问题 * 9.4 解释变量个数的选择 clear all cd "……" * reg y x1 x2 x3 * estat ic use icecream.dta, clear qui reg consumption temp price income estat ic qui reg consumption temp L.temp price income estat ic qui reg consumption temp L.temp L2.temp price income estat ic * 9.5 对函数形式的检验 * reg y x1 x2 x3 * "
"* chp13 计数与排序模型 * 13.1 排序模型 * 排序模型的stata命令为: * oprobit y x1 x2 x3 //ordered probit 模型 * ologit y x1 x2 x3 //ordered logit 模型 cd "…data" use panel84extract.dta, clear oprobit rating83c ia83 dia, nolog // cut1, cut2, cut3为切点的估计值 * 可以预测每个公司的评价概率 predict p2 p3 p4 p5 list p2 p3 p4 p5 in 1/1 * 进行ordered l"
"*-chp28 处理效应 *-28.1 处理效应与选择难题 *-28.2 通过随机分组解决选择难题 *-28.3 依可测变量选择 *-28.4 匹配估计量的思想 *-28.5 倾向得分匹配 *-28.6 倾向得分匹配的stata实例 * psmatch2 D X1 X2 X3, outcome(y) logit ties ate common odds pscore(varname) quietly * D 处理变量 * x1 x2 x3 协变量 * outcome(y) 指定结果变量 * logit 使用logit估计倾向得分 * ties 包括所有ps相同的并列个体,默认按照数据排序选择其"