On Fri, 30 Dec 2016, Mohamed Abdelrahim wrote:
Hello,
I would like to run ADF test on a stationary ARMA process with 100
repetitions. How can I report the p-value for every repetition instead
of just the last p-value or a mean of p-values? I want to write a code
to calculate the proportion that the p-value is above/below certain
significance levels.
Something like this, you mean?
<hansl>
set echo off
set messages off
nulldata 100
setobs 1 1 --special-time-series
k = 0
n = 128
loop for i=1..n --quiet
series y = 0
series e = normal()
series y = 0.9 * y(-1) + e + 0.5 * e(-1) # arma(1,1)
adf 4 y --quiet
printf "$i: %g\n", $pvalue
if $pvalue < 0.05
k++
endif
endloop
printf "\n\nProportion of rejections = %g\n", k/n
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------