Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: rclass program in rolling
From 
 
John Doe <[email protected]> 
To 
 
[email protected] 
Subject 
 
st: rclass program in rolling 
Date 
 
Wed, 19 Mar 2014 11:55:11 +0100 
Dear list,
I have the following problem. I want to estimate a VAR model in a
rolling window and apply vargranger afterwards. As rolling can only be
used with one command, I write a rclass program to perform both. The
program does work but it returns a constant. Is there a possibility
that returns the results of vargranger for each estimation window?
The code so far:
program define varvar, rclass
    args var1 var2
    var `var1' `var2'
    vargranger
    mat results = r(gstats)
    return scalar ret1 = results[1,3]
    return scalar ret2 = results[3,3]
end
capture rolling  aaa = r(ret1) bbb = r(ret1)  , window(200) step(7)
clear  : var varvar1  var2
Thank you very much!
Best regards
Jonas
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/