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)
Using EGEN to Create Count VariableHello Statalisters, I am trying to create a variable that counts the number of times a particular c…
Clustering SEsHi all, I have a question regarding some clustering of standard errors. I read a great paper by M. …
SEM panel model with three variables: cross-lagged vs synchronousI have limited training in SEM and have a couple of questions about a somewhat complicated model dec…
Interpretation of two-way interaction plotHello Statalist I have a question regarding the attached two-way interactions plot: [ATTACH=CONFI…
No Output, Infinite Cycling Wheel (Multiple Imputation Fixed Effects Logistic Regression)Need help troubleshooting a Stata issue. I've been running into dead ends the last few days. The …
Subscribe to:
Post Comments (Atom)
0 Response to Estimating discretionary accruals using modified jones model by company and year (r111 error)
Post a Comment