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: "Best" command to output regression results


From   Eric Booth <[email protected]>
To   "<[email protected]>" <[email protected]>
Subject   Re: st: "Best" command to output regression results
Date   Thu, 4 Nov 2010 17:24:40 +0000

<>

My replies are included in-line below:


On Nov 4, 2010, at 10:28 AM, Weichle, Thomas wrote:

> Hi Eric, 
> I'm using the code you provided and it seems to work fine.  However, do
> you know how to create a 2007 Microsoft Word document (.docx)?  I simply
> tried to replace the extension .doc with .docx and it doesn't work.

If I change the extensions to .xlsx or .docx, Stata/-estout- will still output the file, but the issue seems to be that it's not in a format MS Office can understand (or possibly, some versions of MS Office can understand).  Unexpectedly, I found that my set-up will produce & open a .docx using your -estout- example, however the .xlsx file won't open -- it gives me an error that the document "seems corrupt".  ( &  I'm not sure of the mechanics behind what -estout- or similar packages can or already do to make the document compatible with the new(ish) .docx/.xlsx formats )   I am using Stata MP on a MacOSX 10.6 with MS Office 2011 Business Edition.  


> Also, is there a way to have the document created in landscape format
> instead of portrait format?  

It doesn't appear that this is part of -estout- , and I've never tried getting something into landscape from Stata before, but you could probably get this capability from other packages if you wanted to avoid changing these properties manually in Word.

One suggestion is to look at some of the RTF solutions (example:   Newson's -rtfutil- (from SSC) will let you define the papersize()).

Also, you could send the tables to smcl and then convert it to ps or pdf (Mac only) and specify some options about the page margins, font, and orientation, but that still gets you back to the issue of automation (you'd have to import/paste that into the Word document unless, again, you go to a Excel-to-Word mail merge or linked document solution or use something like latex to \include the pdf/ps).  Be sure to change the 'style()' in the -estout- to 'style(smcl)' if you pursue this option.   Take a look at "translator query smcl2ps" to see the options you can change (esp. pagesize() or margins()).

 Finally, latex is always a good solution when you need to automate any application of page formatting.  

> This code puts the 2 model results right
> next to each other.  Is there a way to put one after the other?  

Yes, just run the -estout- commands for each model separately and use the "append" option for -estout- after the first one.  So instead of :

estout * <using>,  replace  ....


   separate it out into:

estout Model1 using "test.doc", replace  ....
...
estout  Model2 using "test.doc", append ....
...
estout Model3 using "test.doc", append ....
...

or better yet, put this in a loop:

******
cap erase  "test.doc"
forval n = 1/10 {
	estout Model`n' using "test.doc", append ...
}
******
 
- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754





*
*   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