Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: MGARCH DCC in panel settings - error?


From   rraciborski@stata.com
To   statalist@hsphsun2.harvard.edu
Subject   st: MGARCH DCC in panel settings - error?
Date   Tue, 13 Mar 2012 09:34:06 -0500

Arsenio Staer <arsenio.staer@gmail.com> has a question about the -mgarch-
command:

> I'm tryinq out MGARCH DCC.
> However in my panel data setting, this command run in foreach loops:
> noisily  mgarch dcc (RET VWRETD = L.RET l.VWRETD noconstant)
> gives an error 
> sample may not include multiple panels
> r(459);

Arsenio can loop over panels as the example below illustrates.

--Rafal
rraciborski@stata.com

================================= begin example =============================
clear
set more off

//create fake data
set seed 123
set obs 300
egen time  = seq(), to(100)
egen id = seq(), block(100)
gen ret = rnormal()
gen vwretd = rnormal()
gen sticker = "AA"
replace sticker = "APPL" if id==2
replace sticker = "MY STK" if id==3

xtset id time
levelsof sticker, local(names)

foreach i in `names' {
	capture noi mgarch dcc (ret vwretd =) if sticker==`"`i'"', arch(1)
	if _rc {
		//command failed
	}
	else {
		//save any results if needed
	}
}
================================== end example ==============================
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index