[R] Print table in lme

Douglas Bates bates at stat.wisc.edu
Sat Feb 20 17:06:53 CET 2010


On Sat, Feb 20, 2010 at 4:28 AM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
>
>
> Daniel-6 wrote:
>>
>> Hello, I'm trying to add lme results in a table with lm coef results, but
>> as
>> I know, estout or xtabel cannot  support lme objects.
>> I'm a new in R and I'll appreciate some helpful comments.
>>
>
> I don't know what estout and xtabel do, but if you want to extract the core
> results of lme, the following should give you a starter. For latex output,
> you could use latex in Hmisc.
>
> Dieter
>
> library(nlme)
> fm1 = summary(lme(distance ~ age, data = Orthodont))
> tabl = fm1$tTable
> tabl
> str(tabl)

Thanks, Dieter.  If lmemod is a fitted lme model then, as Dieter
indicates, you want

summary(lmemod)$tTable

and, for xtable you can create the xtable object as

xtable(summary(lmemod)$tTable)

For most other model fitting functions the sequence

coef(summary(mymodel))

works.  Unfortunately, in the nlme package we assigned another meaning
to the coef method.  In retrospect that wasn't the best idea.

The coef(summary(foo)) sequence does work for models fit by the lmer
function in the lme4 package.  In fact, I was just in communication
with David Dahl, the author of xtable, and I beleive he will add a
method to the xtable package.


>
>
> --
> View this message in context: http://n4.nabble.com/Print-table-in-lme-tp1562325p1562727.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list