专栏名称: momo
Stata+R,从入门到提高
今天看啥  ›  专栏  ›  momo

Stata学习:如何构建美国企业实际盈余管理变量?

momo  · 知乎专栏  ·  · 2024-05-01 12:52

文章预览

前情回顾 数据来源 清洗数据 cd C : \ Download u Fundamentals_Annual , clear keep if regexm ( DATADATE , "-12-31" ) duplicates drop GVKEY FYEAR , force g year = FYEAR xtset GVKEY year g lat = L . AT drop if mi ( lat ) foreach v of var OANCF COGS INVCH XAD XRD XSGA SALEPFC SALEPFP { replace ` v ' = 0 if mi(`v' ) } g one = 1 g cfo = OANCF g prod = COGS + ( - INVCH ) g disx = XAD + XRD + XSGA g sales = SALEPFC g lsales = SALEPFP g dsales = SALEPFC - SALEPFP g ldsales = l . dsales foreach v of var one - ldsales { g ` v '_lat = `v' / lat replace ` v '_lat = 0 if mi(`v' _lat ) } keep GV y * _lat SIC tostring SIC , gen ( i ) replace i = substr ( i , 1 , 2 ) destring i , replace asreg cfo one sales dsales , by ( y i ) fit noc ren _r abcfo d ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照
总结与预览地址:访问总结与预览