Bookmark and Share

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]

Re: st: rclass program in rolling


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: rclass program in rolling
Date   Wed, 19 Mar 2014 17:10:12 -0400

In future responses, please write with your full, real name, as
specified in the FAQ. I believe your name is "Jonah Abbot", but you'll
have to make that clear in your signature of email handle.

Regards,

Steve Samuels
[email protected]

On Mar 19, 2014, at 6:55 AM, John Doe <[email protected]> wrote:

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/

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index