Re: [R] Plotting confidence intervals for lme

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Thu 07 Jul 2005 - 02:44:29 EST

          Consider the following extension of an example in "?lme":

fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) int <- intervals(fm2)
class(int$fixed)
kf <- dim(int$fixed)[1]
plot(int$fixed[,2], kf:1,

      xlab="x", ylab="", xlim=range(int$fixed),
      axes=FALSE)

axis(1)
axis(2, kf:1, dimnames(int$fixed)[[1]])
segments(int$fixed[,1], kf:1,

          int$fixed[,3], kf:1)
abline(v=0)

          However, we are mixing units, i.e., the units for the intercept are "distance", while for "age" are "distance/time", and the interpretation of the coefficient of a factor like Sex depends on contrasts used. Thus, I don't know how much sense it makes to prepare plots like this.

          For similar plots that make more sense, see Pinheiro and Bates (2000 Mixed-Effects Models in S and S-PLUS (Springer).

          spencer graves

Ghislain Vieilledent wrote:

> Hello and sorry to disturb.
>
> I'm trying to plot the confidence intervals for the fixed effects of a lme.
> I want to obtain graphically, if it is possible, a bar with Estimate, upper
> and lower CI for each level of the factors.
>
> I know how to do for a lm model but for a lme one, I tried with
> plot(intervals(...)) and plot(ci(...)) from the gmodels package but it
> doesn't work well.
>
> Thanks for you help and have a good day.
>

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves@pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jul 07 02:48:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:16 EST