Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: xtmixed, outreg2 and esttab


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: xtmixed, outreg2 and esttab
Date   Wed, 21 Jul 2010 22:43:45 +0200

<>

If you call -esttab- (from ssc, by Ben Jann) twice, you will get two tables,
if you -eststo- in between, you will get one:


***********
webuse productivity, clear
xtmixed gsp private emp hwy water other unemp || region: , cov(un) ||
state:, cov(un) mle

eststo first

xtmixed unemp private emp hwy water other gsp || region: , cov(un) ||
state:, cov(un) mle
eststo second

esttab first second using teacher.rtf, cells(b(fmt(3)) se(par fmt(2))) ///
eqlabels("" "var(idcoleg1)" "var(idclase1)" "var(Residual)", none) ///
stats(rho1 rho2 ll df_m, fmt(3 3 3 1) label(ICC-L1 ICC-L2 -2LL df)) ///
starlevels(~ 0.10 * 0.05 ** 0.01 *** 0.001) replace

!start teacher.rtf
***********

Does this solve the problem?


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Clara Barata
Sent: Mittwoch, 21. Juli 2010 20:56
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: xtmixed, outreg2 and esttab

Martin and Elan,
Thanks for the links and recommendations. The link has some useful
code on how to rename things, so I have updated mine. I have also
reinstalled -esttab- (by uninstalling and reinstalling estout). Now I
get tables in my teacher.rtf file (not just listed output), but I
still get the two models separated (i.e. two tables).
Any other ideas?
thanks a lot, Clara

Here's the code:
xtmixed teacher_age interv1 ||idcoleg1: , cov(un)  ||idclase1:, cov(un) mle
var
xtmrho
esttab using teacher.rtf, cells(b(fmt(3)) se(par fmt(2))) ///
eqlabels("" "var(idcoleg1)" "var(idclase1)" "var(Residual)", none) ///
stats(rho1 rho2 ll df_m, fmt(3 3 3 1) label(ICC-L1 ICC-L2 -2LL df)) ///
starlevels(~ 0.10 * 0.05 ** 0.01 *** 0.001)   replace

xtmixed ce1p8 interv1 ||idcoleg1: , cov(un)  ||idclase1:, cov(un) mle var
xtmrho
esttab using teacher.rtf, cells(b(fmt(3)) se(par fmt(2))) ///
eqlabels("" "var(idcoleg1)" "var(idclase1)" "var(Residual)", none) ///
stats(rho1 rho2 ll df_m, fmt(3 3 3 1) label(ICC-L1 ICC-L2 -2LL df)) ///
starlevels(~ 0.10 * 0.05 ** 0.01 *** 0.001)  append



On Wed, Jul 21, 2010 at 2:11 PM, Cohen, Elan <cohened@upmc.edu> wrote:
> Clara,
>
> I was having problems using -esttab- after -xtmixed- as well (on Stata
11.1), but they were fixed when I manually reinstalled -esttab-.
>
> - Elan
>
>
>> -----Original Message-----
>> From: owner-statalist@hsphsun2.harvard.edu
>> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
>> Clara Barata
>> Sent: Wednesday, July 21, 2010 12:47
>> To: statalist@hsphsun2.harvard.edu
>> Subject: st: xtmixed, outreg2 and esttab
>>
>> Hi!
>> I have been having some trouble finding a way to produce some simple
>> standard tables of xtmixed results.
>> I have used outreg2, estout and esttab but they all seem to create bad
>> tables. I am currently using Stata/MP 11.1 for Windows (32-bit).
>>
>> Here's my syntax for outreg2:
>>
>> xtmixed teacher_age interv1 ||idcoleg1: , cov(un)
>> ||idclase1:, cov(un) mle var
>> xtmrho
>> outreg2  using teacher.doc, addstat ("ICC L1", e(rho1), "ICC L2",
>> e(rho2),"-2LL",e(ll),"df",e(df_m)) ///
>> bdec(3) alpha(.001, .01, .05, .10) symbol(***, **, *, ~) replace long
>>
>> xtmixed ce1p8 interv1 ||idcoleg1: , cov(un)  ||idclase1:,
>> cov(un) mle var
>> xtmrho
>> *estat ic
>> outreg2  using teacher.doc, addstat ("ICC L1", e(rho1), "ICC L2",
>> e(rho2),"-2LL",e(ll),"df",e(df_m)) ///
>> bdec(3) alpha(.001, .01, .05, .10) symbol(***, **, *, ~) append  long
>>
>> This produces a table with two columns, but the estimates for interv1
>> are not aligned. Instead the estimates for interv1 from model 2 are
>> added to the bottom of the table in the second column. All other
>> estimates and fit statistics are aligned.
>>
>> Here's my syntax for esttab (for the same models):
>>
>> xtmixed teacher_age interv1 ||idcoleg1: , cov(un)
>> ||idclase1:, cov(un) mle var
>> xtmrho
>> esttab using teacher.rtf, cells(b(fmt(3)) se(par fmt(2))) ///
>> stats(rho1 rho2 ll df_m, fmt(3 3 3 1) label(ICC-L1 ICC-L2
>> -2LL df)) ///
>> starlevels(~ 0.10 * 0.05 ** 0.01 *** 0.001) wide  replace
>>
>> xtmixed ce1p8 interv1 ||idcoleg1: , cov(un)  ||idclase1:,
>> cov(un) mle var
>> xtmrho
>> esttab using teacher.rtf, cells(b(fmt(3)) se(par fmt(2))) ///
>> stats(rho1 rho2 ll df_m, fmt(3 3 3 1) label(ICC-L1 ICC-L2
>> -2LL df)) ///
>> starlevels(~ 0.10 * 0.05 ** 0.01 *** 0.001) wide append
>>
>> This produces a set of text that can be converted to a table, but the
>> output for the two models is listed sequentially in the rtf/word
>> document (instead of side by side in columns).
>>
>> Can you please help?
>>
>> Thanks a lot!
>> Clara
>>
>> --
>> M. Clara Barata, Ed.M
>> Doctoral student, Human Development and Education
>> Harvard Graduate School of Education
>> Larsen 705, 14 Appian Way
>> Cambridge, MA 02138
>> *
>> *   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/
>>
>>
> *
> *   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/
>



-- 
M. Clara Barata, Ed.M
Doctoral student, Human Development and Education
Harvard Graduate School of Education
Larsen 705, 14 Appian Way
Cambridge, MA 02138

Lab phone: 617-496-0535
Fax: 617-495-3626
Cell: 857-253-1138

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


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