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.

# Re: st: How to get P Values for sargan and abond in ereturn

 From daniel klein To statalist@hsphsun2.harvard.edu Subject Re: st: How to get P Values for sargan and abond in ereturn Date Sun, 2 Sep 2012 12:49:38 +0200

```Shan,

Buis (2007) shows how to do this. You already have the test statistic
for -sargan- stored in e(). All you need is the degrees of freedom,
which I guess should be e(zrank) - e(rank) -- I  could be wrong here.
You can then calculate the p-value as

sca psargan = chi2tail(e(zrank) - e(rank), e(sargan))

Next you put the scalar into e(), using -estadd-, part of -estout- (Jann, SSC)

-esttab-, also part of -estout- (Jann, SSC).

esttab <whatever> ,sca(psargan)

You migth want to use a temporary name for the scalar, or a -local- instead.

Best
Daniel

Buis, Maarten, L. (2007). Stata tip 53: Where did my p-values go? The
Stata Journal, 7(4), pp. 584–586.
(http://www.stata-journal.com/sjpdf.html?articlenum=st0137)

--
I am running a panel data regression using xtdpdsys. After running the
regression, I perform estat sargan and estat abond and I can see both
the test statistic values and p-values for them in the log window.
However, I would like to get the p-values from ereturn list for these
tests so that I can put these p-values at the end of the regression
table using esttab. The ereturn list gives me  only  the test
statistics - e(sargan) and e(arm2) but not the p-values for them.
Could anybody help me with that please?