I think p should be a scalar not a series.
Logan
T-Mobile, America's First Nationwide 4G Network
Marcin Pietrzak <marcin18109(a)gmail.com> wrote:
Hi everyone,
I am writing to you in order to find some help concerning construction of the loop. My aim
is to build a loop which automatically create a first differences of each time serie if it
does not pass the ADF test. You can find below my script but there is something wrong with
it because it shows a problem with commaf 'if'.
loop foreach i xlist
adf 30 xlist.$i --test-down
genr p$i = $pvalue
if p$i < 0,05
genr d_i = diff(xlist.$i)
endloop
Do you have any ideas what should be changed?