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: How to add Q stats from -wntestq- to -esttab- table (hopefully with -estadd-)


From   Richard Herron <richard.c.herron@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to add Q stats from -wntestq- to -esttab- table (hopefully with -estadd-)
Date   Wed, 14 Sep 2011 20:32:15 -0400

I have an -esttab- table with multiple -arima- models to which I would
like to add Q stats made with -wntestq-. I can't use -estadd scalar-
because Q stats are not part of -arima- objects. Is there a way that I
can chain together -predict, residuals- and -wntestq- to add Q stats
to my -esttab- table? Thanks!

Here is some code (including how I would find Q stats "manually"):

* ----- begin code -----
* I know how to combine regressions with -eststo-
webuse friedman2, clear
generate ln_m1 = ln(m1)
eststo clear
eststo: quietly arima DS4.ln_m1, ar(1) ma(2)
eststo: quietly arima DS4.ln_m1, ar(1) ma(1/2)
eststo: quietly arima DS4.ln_m1, ar(1/2) ma(2)
eststo: quietly arima DS4.ln_m1, ar(1/2) ma(1/2)

* and create tables with -esttab-
esttab, aic bic noobslast nomtitles

* I would like to add Q stats to each model with -estadd-, but I can't
figure out how

* here's how I find Q stats "manually"
quietly arima DS4.ln_m1, ar(1/2) ma(1/2)
predict res, residuals
wntestq res, lags(8)
* ----- end code -----
*
*   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