[R] Re: Mixed effects with nlme
Manuel Ato Garcia
matogar at um.es
Thu Oct 9 02:00:53 CEST 2003
Hi, R-users:
Last week I send a request for help to this list. I have receive until now
two kindly responses from Spencer Graves and Renauld Lancelot. They both
point interesting things to fit an adequate model to my data but
unfortunately
it persists without a satisfactory solution.
I propose again the same problem but using with a different dataset
(Assay), taken from Pinheiro and Bates' book on page 163, that is relevant
with crossed
random effects. I have fitted the same model (p. 165)
>fmAssay <- lme(logDens ~ sample * dilut, Assay, random=pdBlocked(list(,
pdIdent(~1), pdIdent(~sample-1),pdIdent(~dilut-1))) )
and the results with "anova" function (p. 166) are
numDF denDF F-value p-value
(Intercept) 1 29 537.6294 <.0001
sample 5 29 11.2103 <.0001
dilut 4 29 420.5458 <.0001
sample:dilut 20 29 1.6072 0.1192
The problem is that with this approach one obtains correct F-values, but
using a common residual term for DenDF that is a combination of (Block +
Block:sample + Block:dilut). Then probability values are different to that
obtained when we used the classical AOV funtion to fit the same model,
because in this case each term is mapped with a error term (so "sample"
uses "Block:sample", "dilut" uses "Block:dilut", and "sample:dilut" uses
"Block:sample:dilut"):
>mod<-aov(logDens ~ sample*dilut + Error(Block+Block/sample+Block/dilut),
data=Assay)
>summary(mod)
Error: Block
Df Sum Sq Mean Sq F value Pr(>F)
Residuals 1 0.0083115 0.0083115
Error: Block:sample
Df Sum Sq Mean Sq F value Pr(>F)
sample 5 0.276153 0.055231 11.213 0.009522
Residuals 5 0.024627 0.004925
Error: Block:dilut
Df Sum Sq Mean Sq F value Pr(>F)
dilut 4 3.7491 0.9373 420.79 1.684e-05
Residuals 4 0.0089 0.0022
Error: Within
Df Sum Sq Mean Sq F value Pr(>F)
sample:dilut 20 0.055525 0.002776 1.6069 0.1486
Residuals 20 0.034555 0.001728
Obviously, the interest on linear mixed effects is open with the
possibility of modeling with correlated and/or heterocedastic errors, and
this end cannot
be pursued with AOV function.
Summarizing, the problem is that I have not found a way to obtain with
NLME the same results (DF, F-ratios and probabilities) that I get with AOV and
multistratum errors. Is this an inconvenience of program?, probably due
to the impossibility to use multiple nested arguments as
random(~1|Block/sample+dilut) or random(~1|Block/sample*dilut)
SAS MIXED can also fit these data and obtain correct results by means of a
combination of "random" and "repeated" arguments:
model = sample dilut sample*dilut;
random = Block sample*Block dilut*Block;
repeated /type=cs Sub=Block;
Type 3 Tests of Fixed Effects
Num Den
Effect DF DF F Value Pr > F
sample 5 5 11.21 0.0095
dilut 4 4 420.79 <.0001
sample*dilut 20 20 1.61 0.1486
May be possible obtain the same results with NLME function?
I would appreciate any kind of help.
Best regards,
Manuel Ato
University of Murcia
Spain
e-mail: matogar at um.es
More information about the R-help
mailing list