[R] linear mixed model question

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Sep 7 10:14:53 CEST 2009


Dear Wen,

Since each worker only works on one machine, your model fm2 does not
make sense. Your random effects tries to model how the effect of each
worker differs between machines. But you don't have that kind of
information if a work only works one machine.

HTH,

Thierry 


------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
Namens Wen Huang
Verzonden: zondag 6 september 2009 17:49
Aan: r-help at r-project.org
Onderwerp: [R] linear mixed model question

Hello,

I wanted to fit a linear mixed model to a data that is similar in terms
of design to the 'Machines' data in 'nlme' package except that each
worker (with triplicates) only operates one machine. I created a subset
of observations from 'Machines' data such that it looks the same as the
data I wanted to fit the model with (see code below).

I fitted a model in which 'Machine' was a fixed effect and 'Worker'  
was random (intercept), which ran perfectly. Then I decided to
complicate the model a little bit by fitting 'Worker' within 'Machine',
which was saying variation among workers was nested within each machine.
The model could be fitted by 'lme', but when I tried to get confidence
intervals by 'intervals(fm2)' it gave me an error:

Error in intervals.lme(fm2) :
   Cannot get confidence intervals on var-cov components: Non-positive
definite approximate variance-covariance

I am wondering if this is because it is impossible to fit a model like
'fm2' or there is some other reasons?

Thanks a lot!

Wen

#################

library(nlme)
data(Machines)
new.data = Machines[c(1:6, 25:30, 49:54), ]
fm1 = lme(score ~ Machine, random = ~1|Worker, data = new.data)
fm1
fm2 = lme(score ~ Machine, random = ~Machine-1|Worker, data = new.data)
fm2
intervals(fm2)

______________________________________________
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.

Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.




More information about the R-help mailing list