Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: matrix of significance stars


From   "Ben Jann" <[email protected]>
To   <[email protected]>
Subject   RE: st: matrix of significance stars
Date   Mon, 31 Jul 2006 13:28:48 +0200

Adam wrote:
> I am trying to figure out the easiest way to build a matrix
> of significance stars (or other symbols) after either an 
> estimation command or, better yet, after building a table of 
> estimates.  I figured there would be something like e(stars), 
> especially since the estimates table can display them so 
> readily.  But, short of -parmest-, which makes me build a 
> whole new dataset, I'm not sure how to proceed.

It may not be immediately apparent, but -estout- can easily 
produce an output table containing only the significance stars. 
Here is an example:

. sysuse auto
(1978 Automobile Data)

. reg price mpg foreign

(output suppressed)

. est sto model1

. reg price mpg foreign if uniform()<.4

(output suppressed)

. est sto model2

. estout model1 model2, cells(sham(star)) collabel(,none)

        model1  model2
mpg     ***     *
foreign *       
_cons   ***     ***

In the above example, -cells(sham)- instructs -estout- to report 
the parameter statistics stored in e(sham), just as -cells(b)- 
would report the contents of e(b). However, since e(sham) does 
not exists for the models, empty string is printed. 
-collabel(,none)- suppresses printing "sham" above each column.

Note that, you are free to use another name than "sham" in 
-cells(...(star))-. For example -cells(sig(star))- or even 
-cells(_(star))- would work equally well. The only point is 
that e(sham) or whatever does not exist for the models. (There 
is one complication tough: the name must not contain "star".)

Possibly, you may also want to mark non-significant coefficients.
This can be done, e.g., as follows:
 
. estout model1 model2, cells(sham(star)) collabel(,none) ///
>  starlevel(n.s. 1 * .05 ** .01 *** .001)

        model1  model2
mpg     ***     *
foreign *       n.s.
_cons   ***     ***


ben


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index