Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Recursive regression with ARCH model and saving results


From   Aaron <[email protected]>
To   [email protected]
Subject   st: Recursive regression with ARCH model and saving results
Date   Sun, 28 May 2006 13:47:30 -0500

Hello,

For the dataset attached below, I would like to recursively run ARCH
on "industry1" and "industry2" with "iv" as my explanatory variable.
i.e., holding the
starting period fixed, run ARCH on industry1 for the first three obs,
then for the first four obs, and so on…; then run ARCH on industry2
recursively.

What I am interested in from each ARCH regression is the predicted
conditional variance. I would like to obtain the conditional variance,
and get the average of the last three months conditional variance.
Please see below a demonstration of the results that I would like to
have.

Although I can use the 'rolling' command in STATA9 to recursively run
ARCH on industry1 and then industry2, I have difficulties figuring out
how to automatically predict and get average conditional variance, and
then save the results in another file.

I would greatly appreciate your help.

Dataset:

id         date     industry1         industry2         iv

1          1950m7           13.51   -0.12    1.51

2          1950m8           -1.4      2.98     4.97

3          1950m9           -0.97    -0.22    4.78

4          1950m10         1.44     1.64     -0.23

5          1950m11         3.19     3.68     2.74

6          1950m12         7.13     4.81     5.66

7          1951m1           4.04     2.4       5.69

8          1951m2           -2.94    -1.67    1.34

9          1951m3           -4.16    -2.91    -2.2

10        1951m4           3.2       5.98     4.83


Results file that I would like to have:

id         date             cvar1       cvar2   cvar1_avg       cvar2_avg

1          1950m7              .        .

2          1950m8              .        .

3          1950m9              0.3    2.4       .           .

4          1950m10            5.98  1.64     .           .

5          1950m11            0.3    3.68     2.19     2.57

6          1950m12            0.4    4          2.20     3.11

7          1951m1              5       2.4       1.87     3.36

8          1951m2              4       4.3       3.10     3.57

9          1951m3              0.3    5.6       3.10     4.10

10        1951m4              3.2    5.98     2.50     5.29

Note:
cvar1 means the conditional variance from ARCH for industry1.
cvar1_avg means the three-month average of the conditional variance,
e.g., for Industry1 in 1950m11, cvar1_avg=(0.3+5.98+0.3)=2.19.

*
*   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