Earnings management, Modified-Jones Model, Regression, unkno

Fragen zu Stata Syntax und Do-Files.

Earnings management, Modified-Jones Model, Regression, unkno

Beitragvon Rob88 » Sa 15. Jun 2013, 15:26

Hi!

I need to calculate the non-discretionary accruals (NDA) of the so-called Modified- Jones model. They have to be regressed before they can be subtracted from TA. I have some code that can do this within STATA, but many errors occur. Does someone know what goes wrong and how to solve this?

Thanks in advance!

Bild

Code abbreviations in the 'do-file'.
Bild

Excel data (Only sample data to just understand the process. Final data includes more countries)
http://home.hccnet.nl/van.gelderen/Sample%20data%20NL.xls

'Do-file'
http://home.hccnet.nl/van.gelderen/do-file.do

DTA-file
http://home.hccnet.nl/van.gelderen/NL-sample.dta
Rob88
 
Beiträge: 2
Registriert: Sa 15. Jun 2013, 13:14
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: Earnings management, Modified-Jones Model, Regression, u

Beitragvon daniel » Sa 15. Jun 2013, 17:05

Your posting is very clear and (probably) provides all information necessary. That is nice. However, do you really expect us to go through your code line by line explaining and/or correcting the

many errors [that] occur


I gave it a shot, and your script already stops in the third line of the second block, when you type

Code: Alles auswählen
drop if sich==.


From a simple -describe- it is obvious that sich is a string variable and therefore cannot contain numeric missing values (i.e. .). Hence the very informative and clear error message "type missmatch". I am willing to help, but I am not willing to do all your work. I think it might not be asked too much of you to correct thoese kinds of errors yourself and seek help with problems that you are not able to solve yourself within, say about 10-15 minutes (per problem, that is!).
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: Earnings management, Modified-Jones Model, Regression, u

Beitragvon Rob88 » So 16. Jun 2013, 15:55

Thanks for your fast reply. My apologizes, ofcourse I didn't expect you to go through all lines.
Although I am not very familiar with Stata, I think I corrected most errors.
Only Stata says know that there are not enough observations. Can this be solved with a certain code?

Thanks in advance!



. *********************************
. * (7) Create a loop that runs the Modified-Jones model regression for the “k” combinations of industry
. * and year (as stored in variable “sic2id”). The output of each regression is stored in the variables
. * generated above.
. *********************************
. sum sic2id

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
sic2id | 443 61.36569 38.6601 1 150

. scalar max2=r(max)

. local k=max2

. set more off

. forvalues i=1(1)`k'{
2. qui reg acc inverse_assets dsal ppeg if sic2id==`i'
3. qui predict res if sic2id==`i', res
4. qui replace aac=res if sic2id==`i'
5. qui replace adjr2=e(r2_a) if sic2id==`i'
6. qui replace b0=_b[_cons]
7. qui replace b1=_b[inverse_assets]
8. qui replace b2=_b[dsal]
9. qui replace b3=_b[ppeg]
10. qui drop res
11. di `i' " / " `k'
12. }
1 / 150
2 / 150
3 / 150
4 / 150
5 / 150
6 / 150
7 / 150
8 / 150
9 / 150
10 / 150
11 / 150
12 / 150
13 / 150
14 / 150
15 / 150
16 / 150
17 / 150
18 / 150
19 / 150
20 / 150
21 / 150
22 / 150
23 / 150
24 / 150
insufficient observations
r(2001);

end of do-file

r(2001);
.
Rob88
 
Beiträge: 2
Registriert: Sa 15. Jun 2013, 13:14
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: Earnings management, Modified-Jones Model, Regression, u

Beitragvon daniel » So 16. Jun 2013, 22:45

Without running the code (which is probably not necessary) I do not think there is a "code" or any kind of work around for the problem here. Stata is telling you that it has insufficient observations to run the regression model you specified. This might be the case because not every level of sic2id has enough cases (rows that is) to estimate 4 coefficients and their standard errors. You can check this with -tabulate sic2id- and look at the frequencies reported for each level.

Note that things will not work if sic2id has non-integer values.
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: Earnings management, Modified-Jones Model, Regression, u

Beitragvon Taskito » Do 22. Aug 2013, 18:38

Hi,

I'm doing something very similar (Jones Model) and have found an useful example in a power point presentation on the Internet some months ago. Maybe I can find it again.

For the estimation of DA, I create a loop and include the industries (GICS codes, in my case) with sufficient observations. I have to drop all others for the same reason as you, I guess.

Could you solve the problem already?

Best!
Taskito
 
Beiträge: 1
Registriert: Do 22. Aug 2013, 18:34
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post


Zurück zu Stata Syntax

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste