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: Multi-column Excel tables with 1 line after my regressions: esttab, outreg2, or another?
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Multi-column Excel tables with 1 line after my regressions: esttab, outreg2, or another?
Date
Mon, 21 Oct 2013 09:08:38 +0100
Thanks for the clarification. (In your previous, your code showed an
attempt to follow -eststo- with -outreg2-.)
I don't use either of these packages so have no detailed advice, but
apart from living with the constraints your strategic options include
(a) emailing the author(s) with suggestions; neither is a member of
Statalist (b) cloning either program and adding code to do what you
want.
While we often find user-written programs "unsatisfactory" for our own
purposes such programs usually exist to do what the user-programmers
wanted them to do.
Nick
[email protected]
On 21 October 2013 08:42, Jen Zhen <[email protected]> wrote:
> Dear all,
>
> thanks for your replies.
>
> On Nick Cox' question:Sorry for having been unclear. I did not intend
> to combine -outreg- and -eststo- but I was considering to get either
> of -eststo & esttab- or -outreg2- to do what I wanted and had
> different misgivings about each of them:
>
> With esttab I found it unsatisfactory that the Excel output I could
> get (at least in Stata 11 the only Excel format I can generate with
> esttab seems to be csv) did not directly display output in different
> columns, so I have to manually go through the "Text to Columns"
> procedure for each Excel sheet. Adding the "tab lab nogap" options
> doesn't seem to solve this either.
>
> With outreg2 I found it unsatisfactory that I cannot generate the full
> table with one line, but need to first use "outreg2 ..., replace" for
> the first column to prevent outreg2 from also printing all other
> regressions I have estimated since the start of my Stata session, and
> then need to write a loop for each other regression and each "outreg2
> ..., append" to add the other regression results that I also do want
> to be displayed.
>
> I mentioned both issues in the same email only to increase the chances
> of getting either of them to do what I was hoping for, but it looks
> like I have to live with one of these constraints.
>
> Best regards,
> JZ
>
> On Fri, Oct 18, 2013 at 7:36 PM, Austin Nichols <[email protected]> wrote:
>> Also try
>>
>> cap erase tab.xls
>> esttab * using tab.xls, tab lab nogap
>>
>> On Fri, Oct 18, 2013 at 11:21 AM, Nick Cox <[email protected]> wrote:
>>> [Another Nick]
>>>
>>> I'm not following this closely, but you seem to be expecting -outreg2-
>>> (Roy Wada, SSC) and -eststo- (Ben Jann, SSC, SJ) to work with each
>>> other.
>>>
>>> Where is it documented that this should work? They are written by
>>> different people and (more importantly) I don't think either author
>>> wrote so that the programs are mutually compatible.
>>>
>>> Nick
>>> [email protected]
>>>
>>>
>>> On 18 October 2013 15:29, Jen Zhen <[email protected]> wrote:
>>>> Hi Nick,
>>>>
>>>> thanks so much for your answer. I also got that idea from example 2 of
>>>> the outreg2 help file , but somehow it's not working for me.
>>>> I try to reproduce all of my steps in the following, maybe that will
>>>> enable someone to see where I'm going wrong:
>>>>
>>>> log using logfile.log, replace
>>>> use dataset.dta, replace
>>>>
>>>> ...
>>>>
>>>> capture erase logfile.log
>>>> eststo: reg depvar1 x1 x2 x3
>>>> eststo: reg depvar2 x1 x2 x3
>>>> eststo: reg depvar3 x1 x2 x3
>>>> outreg2 x1 x2 [est1 est2 est3] using outputfile, excel
>>>>
>>>> log close
>>>>
>>>> Can anyone see how I could change this so as to ensure that I outreg2
>>>> only those 3 regressions and not other regressions estimated earlier?
>>>>
>>>> Thanks so much,
>>>> JZ
>>>>
>>>>
>>>>
>>>> On Fri, Oct 18, 2013 at 4:07 PM, Nick Winter <[email protected]> wrote:
>>>>> on the replace / append question, I just include the following line at the
>>>>> beginning of my do file:
>>>>>
>>>>> capture erase -logfilename-
>>>>>
>>>>> then -append- all results
>>>>>
>>>>> - Nick Winter
>>>>>
>>>>>
>>>>> On 10/18/2013 8:43 AM, Jen Zhen wrote:
>>>>>>
>>>>>> Dear listers,
>>>>>>
>>>>>> I'm looking for way to produce a readily-formatted Excel table (or at
>>>>>> least one in which the results of each regression are displayed in a
>>>>>> separate column, without requiring further adjustments in Excel) with
>>>>>> a single one-line command to be run after my set of regressions. I've
>>>>>> tried this both with Ben's -esttab- and with Roy's -outreg2-m but
>>>>>> could not get either to do exactly what I wanted:
>>>>>>
>>>>>> On -esttab ... file.csv-:
>>>>>> When open the CSV file in Excel, either by clicking on the
>>>>>> hyperlink with its name right in the Stata results window or by
>>>>>> opening the saved file in Windows Explorer, I see all data in a single
>>>>>> column and first need to tell Excel that at each comma the data are to
>>>>>> be split into separate columns. It would be convenient if I could
>>>>>> -esttab- into a format which Excel does then directly display in
>>>>>> separate columns, but I have not been able to find such an output
>>>>>> format for esttab. I am still running Stata 11 and currently have no
>>>>>> financial resources to upgrade to a later version.
>>>>>>
>>>>>> On -outreg2-:
>>>>>> I have thus been considering to switch from -esttab- to Roy's
>>>>>> -outreg2-. However, here I find it disadvantageous that I cannot just
>>>>>> compile the table with one line after all the regressions but must
>>>>>> instead use a separate -outreg2 ..., append- after each regression. I
>>>>>> can build that into a loop.
>>>>>> But it seems that to prevent -outreg2- from adding all earlier
>>>>>> regression results run in that Stata session, I need to separately
>>>>>> -outreg2- my first regression with the replace option and then all
>>>>>> others with the append option. But that looks very inelegant in my
>>>>>> dofile. Do people know any more elegant way of doing this?
>>>>>>
>>>>>> Thank you so much and kind regards,
>>>>>> JZ
>>>>>> *
>>>>>> * For searches and help try:
>>>>>> * http://www.stata.com/help.cgi?search
>>>>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>>>>> * http://www.ats.ucla.edu/stat/stata/
>>>>>>
>>>>> *
>>>>> * For searches and help try:
>>>>> * http://www.stata.com/help.cgi?search
>>>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>>>> * http://www.ats.ucla.edu/stat/stata/
>>>> *
>>>> * For searches and help try:
>>>> * http://www.stata.com/help.cgi?search
>>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>>> * http://www.ats.ucla.edu/stat/stata/
>>> *
>>> * For searches and help try:
>>> * http://www.stata.com/help.cgi?search
>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>> * http://www.ats.ucla.edu/stat/stata/
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>> * http://www.ats.ucla.edu/stat/stata/
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/