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)
Interquartile rangeHello, Please can anyone advise how I generate the interquartile range? I have a data example for a…
ImputationHey guys, I work with panel data and I have the following problem. I've dummy variables from 2 yea…
prevent pagebreak in table putdocxHi I making summary tables in putdocx looping through 100+ cities. The problem is that pagebreaks oc…
Spmatrix creating empty weighting matricesHi, I'm trying to do a very standard spatial analysis. The aim is to run ML and 2SLS estimations wi…
Testing differences in abnormal returnsusing estudyHello, I am currently performing an event study. I have a Sample of 84 european banks with daily ret…
Subscribe to:
Post Comments (Atom)
0 Response to Estimating discretionary accruals using modified jones model by company and year (r111 error)
Post a Comment