分享

Stata计算可操纵性应计利润——基于琼斯模型

 三浦春花 2021-12-15
//接上面代码,删除部分变量 drop A-PPE DAR DS_DAR xtset stkcd year replace a001123000=0 if a001123000==. sum a001000000 c001000000 a001123000 b001209000 b001210000 replace b001209000=0 if b001209000==. replace b001210000=0 if b001210000==. * 根据国泰安数据库计算需要的指标 clonevar A = a001000000 // 总资产 gen cfo = c001000000/L.A // 经营活动现金流净额, y1 gen cogs = b001209000/L.A // 销售费用/总资产 gen Dinv = D.a001123000/L.A // 存货净额增量 gen prod = cogs Dinv // 生产成本, y2 gen disexp= (b001209000 b001210000)/L.A // 酌量性费用,销售费用 管理费用, y3 gen invA = 1/L.A // 滞后一期的总资产的倒数 gen sale = b001101000/L.A // 营业收入 gen Lsale = L.b001101000/L.A // 滞后一期的营业收入 gen Dsale = D.b001101000/L.A // 营业收入增量 gen LDsale= L.D.b001101000/L.A // 滞后一期的营业收入增量 * 生成行业 年份变量,方便回归 //egen sic_year = group(sic year), label lname(sic_year) // sic 为行业分类,year为年度时间标识 * 分别计算异常经营性净现金流、异常生产成本和异常酌量性费用 *-CFO local y 'cfo' global y `y' local x 'invA sale Dsale' global x `x' cap drop AB`y' gen AB`y' = . //drop e //N为sic_year的编码最大值 forvalues i = 1/N{ //有时由于某行业内企业较少,不能进行单个回归,需要用cap即capture捕捉错误,跳过错误。 capture reg cfo invA sale Dsale if sic_year==`i' if (_rc==0){ predict e if e(sample), res replace ABcfo = e if e(sample) drop e } } sum ABcfo sum sic_year *-PROD //qui tsset id year local y 'prod' local x 'invA sale Dsale LDsale' cap drop AB`y' gen AB`y' = . //N为sic_year的编码最大值 forvalues i = 1/N{ //有时由于某行业内企业较少,不能进行单个回归,需要用cap即capture捕捉错误,跳过错误。 cap qui reg prod invA sale Dsale LDsale if (sic_year==`i') if (_rc==0){ predict e if e(sample), res replace ABprod = e if e(sample) drop e } } sum ABprod *-DISEXP local y 'disexp' local x 'invA Lsale' cap drop AB`y' gen AB`y' = . //drop e //N为sic_year的编码最大值 forvalues i = 1/N{ //有时由于某行业内企业较少,不能进行单个回归,需要用cap即capture捕捉错误,跳过错误。 cap reg disexp invA Lsale if (sic_year==`i') if (_rc==0){ predict e if e(sample), res replace ABdisexp = e if e(sample) drop e } }

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多