Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: looping with augmented dickey fuller test


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: looping with augmented dickey fuller test
Date   Wed, 15 Oct 2003 12:19:11 +0100

Stata users, 
 you might be able to help with the following problem.

I have a data set that looks like the following

company  year      var1 var2 var3 var4 optlagvar1 optlagvar2 optlagvar3 optlagvar4
1             1980                                        1
1             1981                                        1
1             1982                                        1   
..            ..
1             2002                                        1
2             1980                                        3
2             1981                                        3
2             1982                                        3
..            ..
2             2002
...           ...
...           ...
20           1980                                        6
20           1981                                        6
20           1982                                        6      
..            ..
20           2002


The variable optlagvar1 for instance is the optimal lag value from an Akaike Information criteriaon exercise for each company. My problem is I now want to implement the DF test for each company and each variable, writing something like:

local z "var1 var2 var3 var4"
foreach k of local z{
forvalues x=1/20{
dfuller `k', lags(optlag`k')
}
}

My problem is I cannot get stata to read the optimal lags value for the option lags, as this has to be specified as a numeric variable. Is there a way I can ask stata to do this loop and correctly specify the values in the lags option for the dfuller test?

Any help would be greatly appreciated

many thanks
Dev


Dev Vencappa
School of Economics
University of Nottingham
University Park
Nottingham
NG7 2RD
U.K.
Tel : +44 (0)115 951 5608
Fax: +44 (0) 115 951 4159

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index