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: RE: matrix results saved


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: RE: matrix results saved
Date   Thu, 11 Nov 2010 16:02:03 +0000

Use -display-. If you have a matrix, you can display any element of it using -display-. 
For your problem, you may want to specify extra text (which could be spaces), a format, etc. using -display-. 

. matrix a = 1

. mat li a

symmetric a[1,1]
    c1
r1   1

. di a[1,1]
1

. di "interesting number is "  %4.3f a[1,1]
interesting number is 1.000

Nick 
[email protected] 

Rodrigo Briceño

Sorry Nick for not being so explicit.

What I want is that these two values r1  22.942303 (chi2 statistic
saved as a matrix) and r1  .02821978 (p-value) appears below the
estout results already saved. An example of this with my first
regression:

estout, cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N hettest hetp,
fmt(%9.3f %9.0g %9.3f %9.3f)):

                     Reg1
----------------------------
sap                -0.238
                  (0.183)
liqmk               1.183**
                  (0.350)
----------------------------
r2_a                0.370
N                      54
hettest            32.227
hetp                0.152
bg                  22.942303
pbg                  0.02821978


2010/11/11 Nick Cox <[email protected]>:
> Extract in what way?

Rodrigo Briceño

> Yesterday I posted a request about how to include
> Chi2 statistics and p-values from Breusch Godfrey Test into estout
> results. After doing an all-day research, since I'm not a Stata
> Programming expert, I discovered that Breusch Godfrey produces matrix
> results instead of scalar results (as estat hettest, for testing
> heteroskedasticity does).
>
> I also discovered that by especifying  matrix bg=r (chi2) and matrix
> pbg= r(p) I was able to save chi2 values and p-values for the test.
> When I list the results I can see something like this:
>
> matrix list bg
>
> symmetric bg[1,1]
>         lags:
>           12
> r1  22.942303
>
> matrix list pbg
>
> symmetric pbg[1,1]
>         lags:
>           12
> r1  .02821978
>
> My new question to the list is: it is possible to just extract the r1
> values expressed in both matrix?

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index