Dear All, I would like to ask how to get the Sum of Squares from fitted lme model. I appreciate that lme maximises the likelihood (or REML) and uses likelihood ratio tests, but I just fail why I could not get the SS if I want them. I could use lm to calculate them, but it looks quite pointless to fit a second (and wrong in a way) model for something so trivial. I know that the issue has been dealt with before, but I could not find a clear cut answer searching through the archives. Regards Federico Calboli -- ================================ Federico C. F. Calboli Dipartimento di Biologia Via Selmi 3 40126 Bologna Italy tel (+39) 051 209 4187 fax (+39) 051 209 4286 f.calboli at ucl.ac.uk fcalboli at alma.unibo.it
On Friday 21 May 2004 09:41, Federico Calboli wrote:> Dear All, > > I would like to ask how to get the Sum of Squares from fitted lme > model. I appreciate that lme maximises the likelihood (or REML) and > uses likelihood ratio tests, but I just fail why I could not get the > SS if I want them. I could use lm to calculate them, but it looks > quite pointless to fit a second (and wrong in a way) model for > something so trivial.Exactly what do you wish to square and sum ? If it's the 'errors' (which in this context is ambiguous), extract them (see ?residuals.lme), square them and sum them. But what are you planning to do with this after you get it ? Deepayan
On Sat, 2004-05-22 at 13:08, Renaud Lancelot wrote:> > So you might want to use the anova method for lme objects. You probably > need to set the argument type to "marginal", which is not the default value. > > Best, > > RenaudUsing anova(my.lme.model), of any type, does not produce the desired MS and SS. That's despite the help for anova.lme stating: " When only one fitted model object is present, a data frame with the sums of squares, numerator degrees of freedom, denominator degrees of freedom, F-values, and P-values for Wald tests for the terms in the model (when 'Terms' and 'L' are 'NULL') [they are by default]..." I realise this Sum of Squares thing is silly, and fitting a parallel "lm" model would give me the required SS and MS, but I simply fail to see why I have to do this considering that the help for anova.lme states I can get them somehow. I do hope I am not ranting too much. Regards, Federico Calboli -- ================================ Federico C. F. Calboli Dipartimento di Biologia Via Selmi 3 40126 Bologna Italy tel (+39) 051 209 4187 fax (+39) 051 209 4286 f.calboli at ucl.ac.uk fcalboli at alma.unibo.it