Hi there,
I am trying to estimate the discretionary accruals of the modified Jones model in Stata. However, I keep getting the error r(111) which says: variable term not found. I think something might be wrong with my variable fyear. These are the properties of the variable fyear: Type-double and Format-%ty.
This is the code I am running for to estimate the discretionary accruals:
gen Jones_2005_TAC2=.
forval y = 2014(1)2019{
forval i = 1(1) 22426{
display `i'
display `y'
reg TACC_2 term1 term 2 term3 if `i'==Industry_code & `y'==fyear, noconstant
predict r if `i'==Industry_code & `y'==fyear, resid
replace Jones_2005_TAC2=r if `i'==Industry_code & `y'==fyear
drop r
}
}
This is what Stata says when I run it:
. gen Jones_2005_TAC2=.
(22,458 missing values generated)
. forval y = 2014(1)2019{
2. forval i = 1(1) 22426{
3. display `i'
4. display `y'
5. reg TACC_2 term1 term 2 term3 if `i'==Industry
> _code & `y'==fyear, noconstant
6. predict r if `i'==Industry_code & `y'==fyear,
> resid
7. replace Jones_2005_TAC2=r if `i'==Industry_cod
> e & `y'==fyear
8. drop r
9. }
10. }
1
2014
variable term not found
r(111);
Hope someone can help me out. It is for my thesis!
Kind regards,
Sarah
Related Posts with Estimating discretionary accruals using modified jones model by company and year (r111 error)
Complex recursive mixed-process models with cmpDear All, I would like to use the cmp command to do an instrumental variable regression. I read the…
Help with heteroskedasticityHello everyone. I'm doing my final thesis for university and I have a problem I don't know how to s…
Tests to be performed before using the ppml estimatorHello, I hope you're well. I would like to know what tests to perform before using the PPML. I use t…
Inverse hyperbolic sinc transformationHi, I have been suggested to use hyperbolic sine transformation instead of log(0+1) I have tried '…
What is the T-Test in ARDL ECM used for?Hi, I am new to using STATA. For my Bachelors thesis I am analyzing the effect of income, own price…
Subscribe to:
Post Comments (Atom)
0 Response to Estimating discretionary accruals using modified jones model by company and year (r111 error)
Post a Comment