Hi,
I'm running a cross- sectional regression based on modified Jones model to calculate discretionary accruals. The problem is the component drev has negative sign but it should be positive. Here is all my commands. I appreciate if you help me.
destring company_fkey, replace
drop if at==. | at<=0
destring sic, replace
replace sic=sich if sich!=.
drop if sic==.
drop if sic>5999 & sic<7000
duplicates drop company_fkey fyear, force
tsset company_fkey fyear
gen lagta=l.at
gen tacc=(ibc-oancf)/lagta
gen drev=(d.sale-d.rect)/lagta
gen inverse_a=1/lagta
gen ppe=ppegt/lagta
drop if tacc==.
drop if drev==.
drop if ppe==.
tostring sic, replace
gen l=length(sic)
tabstat l, by(l) stats(N)
gen zero="0"
egen help=concat(zero sic) if l==3
replace sic=help if l==3
drop l help zero
gen sic2=substr(sic,1,2)
egen sic2id=group(sic2 fyear)
sort sic2id
egen count=count(sic2id), by(sic2id)
drop if count<20
drop count sic2id
egen sic2id=group(sic2 fyear)
sum tacc,d
replace tacc=r(p1) if tacc<r(p1)
replace tacc=r(p99) if tacc>r(p99) & tacc!=.
sum drev,d
replace drev=r(p1) if drev<r(p1)
replace drev=r(p99) if drev>r(p99) & drev!=.
*inverse lagged total assets (this is never negative thereofre just 99%)
sum inverse_a,d
replace inverse_a=r(p99) if inverse_a>r(p99) & inverse_a!=.
*ppe (this is the sam above just 99%)
sum ppe,d
replace ppe=r(p99) if ppe>r(p99) & ppe!=.
gen dac=.
gen r2a=.
gen b1=.
gen b2=.
gen b3=.
sum sic2id
local k=r(max)
forvalues i=1(1)`k'{
qui reg tacc inverse_a drev ppe if sic2id==`i'
qui predict res if sic2id==`i', res
qui replace dac=res if sic2id==`i'
qui replace r2a=e(r2_a) if sic2id==`i'
qui replace b1=_b[inverse_a] if sic2id==`i'
qui replace b2=_b[drev] if sic2id==`i'
qui replace b3=_b[ppe] if sic2id==`i'
qui drop res
di `i' " / " `k'
}
tabstat r2a dac b1 b2 b3, stats(N mean p25 median p75) columns(statistics)
Related Posts with cross-sectional regression modified Jones model 1995
Bootstrapping for logistic regression on imbalanced dataHi there, I've googled quite a bit but haven't quite figured out how to implement this in STATA. I …
error message when using XtgraphHello, I am currently having some issues using xtgraph that I haven't experienced before. When I us…
ARDL with daily frequency and with a business calendarI have a doubt, in the ARDL models with stata can they be run with a daily frequency, specifically w…
Counting number of days between dates among different observations excluding overlap by groupHello, I am working on Windows 10, Stata 14.2 for a project that asks to count the number of days a…
Counterfactual decomposition issueHi all, I want to use counterfactual decomposition method with a binary dependent variable. I used …
Subscribe to:
Post Comments (Atom)
0 Response to cross-sectional regression modified Jones model 1995
Post a Comment