Statalist


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

Re: st: Re: labeling estout models with titles from eststo


From   "Ben Jann" <[email protected]>
To   [email protected]
Subject   Re: st: Re: labeling estout models with titles from eststo
Date   Tue, 30 Sep 2008 23:25:13 +0200

Howie, if you specify -label- then -estout- should use the titles
instead of the names of the stored estimates. Example:

. sysuse auto
(1978 Automobile Data)

. qui reg price mpg

. eststo model1, title("title1")

. qui reg price mpg rep78

. eststo model2, title("title2")

. estout model*, label

----------------------------------------------
                           title1       title2
                                b            b
----------------------------------------------
Mileage (mpg)           -238.8943    -271.6425
Repair Record 1978                    666.9568
_cons                    11253.06     9657.754
----------------------------------------------

If this does not work on your system then you probably have an old
-estout- version and need to update (-ssc install estout, replace-).

If you want to use the titles but not the variable labels, then type

. estout model*, mlabels(,titles)

--------------------------------------
                   title1       title2
                        b            b
--------------------------------------
mpg             -238.8943    -271.6425
rep78                         666.9568
_cons            11253.06     9657.754
--------------------------------------

Furthermore, if you want labels but no titles, type

. estout model*, label mlabels(,notitles)

----------------------------------------------
                           model1       model2
                                b            b
----------------------------------------------
Mileage (mpg)           -238.8943    -271.6425
Repair Record 1978                    666.9568
_cons                    11253.06     9657.754
----------------------------------------------

To get model titles in -esttab- type

. esttab model*, mtitle

--------------------------------------------
                      (1)             (2)
                   title1          title2
--------------------------------------------
mpg                -238.9***       -271.6***
                  (-4.50)         (-4.70)

rep78                               667.0
                                   (1.95)

_cons             11253.1***       9657.8***
                   (9.61)          (7.17)
--------------------------------------------
N                      74              69
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

Best,
ben


On Tue, Sep 30, 2008 at 11:03 PM, Martin Weiss <[email protected]> wrote:
> The -estout- is one of the most brilliant packages on record, but titling is
> somewhat difficult. You can, as a crude solution, accumulate your titles in
> a -local- and pass it to the mtitles option.
>
> ********
> sysuse auto, clear
> eststo clear
> levelsof rep78, loc(levrep)
>
> loc i 0
> loc titl ""
>
> foreach lev of loc levrep{
> loc ++i
> reg price we mpg if rep78==`lev'
> eststo
> loc titl `"`titl' "Regr. `i'""'
> }
>
> esttab *, mtitles(`titl')
> ***********
>
> HTH
> Martin
> _______________________
> ----- Original Message ----- From: "Howard Lempel" <[email protected]>
> To: <[email protected]>
> Sent: Tuesday, September 30, 2008 9:50 PM
> Subject: st: labeling estout models with titles from eststo
>
>
>> Hello all,
>>
>> I have a question on the use of the -estout- command, which is available
>> from both SSC and SJ.  I have a do file that runs many regressions and
>> stores each of them using -eststo, title("MyTitle")-.  I would then like to
>> use -estout- to make tables of my results.  I would like each model to be
>> labeled using that model's title.
>>
>> An example using the auto dataset:
>>
>> sysuse auto
>> reg price mpg
>> eststo model1, title("title1")
>>
>> reg price mpg rep78
>> eststo model2, title("title2")
>>
>> estout model*
>>
>>
>> Here is my output:
>>
>>       model1  model2
>>       b       b
>> mpg     -238.8943       -271.6425
>> rep78           666.9568
>> _cons   11253.06        9657.754
>>
>>
>> I would like to find a way to replace "model1" and "model2" with "title1"
>> and "title2." Because I have many models, I would like to be able to do this
>> without specifying a string for each model in -estout-'s -mlabel()- option
>> if at all possible.
>>
>> Thanks for your consideration.
>> Howie
>>
>>
>> Howie Lempel
>> Research Assistant
>> The Brookings Institution | Economic Studies
>>
>> 1775 Massachusetts Ave NW | Washington DC 20036
>> [email protected] | p: (202) 238-3576
>>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index