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, is already up and running.

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

Re: st: Query

From   John Luke Gallup <>
Subject   Re: st: Query
Date   Wed, 18 Apr 2012 16:24:19 -0700


You cannot use -outreg-, -outreg2-, or -estout- to format the statistics from -corrgram- directly, because it is not an estimation command.  In particular, it does not save results in the e(b) matrix.  Instead it saves results in r() matrices.

You can create a formatted table of -corrgram- statistics with the following commands using the program -frmttable-, which is the backend of -outreg-.  It takes a Stata matrix and creates a formatted table in Word or TeX.

webuse air2, clear
corrgram air, lags(20)
mat lags = J(r(lags),1,0)
mat probQ = lags
mat Q = r(Q)'

forvalues r=1/`r(lags)' {
	mat lags[`r',1] = `r'
	mat probQ[`r',1] = chi2tail(`r',Q[`r',1])
mat stat = lags,r(AC)',r(PAC)',Q,probQ
frmttable using corrgram.doc, statmat(stat) ctitle("Lag","AC","PAC","Q","Prob>Q") ///
	sdec(0,4) replace

The reason for the matrix commands above is to calculate the "Prob>Q" p-values which are not saved in r() values after the -corrgram- command.

The -frmttable- command is part of the -outreg- package, which you can download with the command -ssc install outreg, replace-.  Find more information in -help frmttable- after you download it.


On Apr 17, 2012, at 12:46 PM, Mark Bailie wrote:

> How can I outreg2 the statistics from a corrgram?
> KR,
> Mark
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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