Erlend Birkeland Nilsen
2006-Feb-21 08:50 UTC
[R] Extracting error terms from an lme object
Hi all, I have a problem with extracting the right error terms from an lme-object. The fixed part of the model is quite simple (y~x1*x2, where x1 and x2 are factor variables with two levels), with random intercepts (random=~1|group). As I work with factor variables here, I would like to display this with a barplot (or something like that), with error bars representing the sem or sd of the mean values for each group (i.e. four bars). However, I have not figured out how to extract sem (sd) values for these means, or actually what would be the appropriate error terms to use here. The summary.lme function only provides me with the se for the parameter estimates (intercept and slopes) while I want to display error terms for the different levels. Could this be achieved by setting up an appropriate contrast matrix (or would any of the established contrasts methods work), or is there another way of getting error estimates that I could use in such a figure? All the best, Erlend Nilsen
Are you familiar with Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer)? This book contains detailed answers to many questions of this nature. If this is not adequate, please submit another question after first reading the posting guide! "www.R-project.org/posting-guide.html". People who try to answer questions on this list seem more likely to respond to questions that are simple and understandable, and questions more consistent with this guide seem more likely to be simple, self contained, etc. hope this helps. spencer graves Erlend Birkeland Nilsen wrote:> Hi all, > > I have a problem with extracting the right error terms from an lme-object. > The fixed part of the model is quite simple (y~x1*x2, where x1 and x2 are > factor variables with two levels), with random intercepts (random=~1|group). > As I work with factor variables here, I would like to display this with a > barplot (or something like that), with error bars representing the sem or sd > of the mean values for each group (i.e. four bars). However, I have not > figured out how to extract sem (sd) values for these means, or actually what > would be the appropriate error terms to use here. The summary.lme function > only provides me with the se for the parameter estimates (intercept and > slopes) while I want to display error terms for the different levels. Could > this be achieved by setting up an appropriate contrast matrix (or would any > of the established contrasts methods work), or is there another way of > getting error estimates that I could use in such a figure? > > All the best, > > Erlend Nilsen > > ______________________________________________ > R-help at 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