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
merging datasetsDear All, I want to merge a dimension repeated cross section data with another two-repeated cross se…
Using xtivreg2 for Simultaneous Equation model with fixed effectsHi, I am using a simultaneous equations model with fixed effects estimation procedure. I was using x…
Shrinkage of estimates towards group mean using Mixed Effects Models for a binary outcomeHello Statalist, I have survey data that collected individual level use of a bed net against mosqu…
Variable splittingI admit that the split syntax has been explained severally but I don't seem to get an answer that ca…
Logistic regression "outcome does not vary" I got values on an independent variables for only one of the options of my dependent variableLogistic regression "outcome does not vary" Hello, I know which variable is giving me problems, bu…
Subscribe to:
Post Comments (Atom)
0 Response to cross-sectional regression modified Jones model 1995
Post a Comment