文章预览
前情回顾 数据来源 清洗数据 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
………………………………