Hello,
i´m currently working on modified jones model to detect Earnings Management.
Modified Jones Model:
TA = Total accruals
REV = Revenues
REC = Receivables
PPE = Property Plant and Equipment
1/Ait-1 = Lagged assets
NA = normal Accruals:

At the end i want to get the discretionary part of total accruals:
DA = Discretionary Accruals
so that: TA - NA = DA!
Now i have to do the regression by industry (variable: sic_2) and year (fyear).
I know that i have to use kind of this code
foreach ….. {
reg TA x1 x2 x3 if fyear == 2000 & digit_2_sic == 10,nocon
bysort id: replace normal_Accruals= _b[x1]*x1 + _b[x2]*x2 + _b[x3]*x3 if fyear == 2000 & digit_2_sic == 10
}
while: x1 = 1/Ait-1 x2= (deltarev-deltarec)/Ait-1 X3 = PPE/Ait-1
My saple consisty of years from 2000-2014 and sic_2 from 1-99. How can i write the code, so that i don´t have to do the regression seperately for each year and industry?!
Is there something like a loop? Furthermore i get the error: invalid Syntax or no observations if i try it for a single year and sic_2 like above. How do i have to write the code in stata exactly?
I would be very very happy if someone could help me!!
Thank you in advance
Lana
i´m currently working on modified jones model to detect Earnings Management.
Modified Jones Model:
TA = Total accruals
REV = Revenues
REC = Receivables
PPE = Property Plant and Equipment
1/Ait-1 = Lagged assets
NA = normal Accruals:
At the end i want to get the discretionary part of total accruals:
DA = Discretionary Accruals
so that: TA - NA = DA!
Now i have to do the regression by industry (variable: sic_2) and year (fyear).
I know that i have to use kind of this code
foreach ….. {
reg TA x1 x2 x3 if fyear == 2000 & digit_2_sic == 10,nocon
bysort id: replace normal_Accruals= _b[x1]*x1 + _b[x2]*x2 + _b[x3]*x3 if fyear == 2000 & digit_2_sic == 10
}
while: x1 = 1/Ait-1 x2= (deltarev-deltarec)/Ait-1 X3 = PPE/Ait-1
My saple consisty of years from 2000-2014 and sic_2 from 1-99. How can i write the code, so that i don´t have to do the regression seperately for each year and industry?!
Is there something like a loop? Furthermore i get the error: invalid Syntax or no observations if i try it for a single year and sic_2 like above. How do i have to write the code in stata exactly?
I would be very very happy if someone could help me!!
Thank you in advance
Lana
Comment