Skip to content

Lme does not work without a random effect (UNCLASSIFIED)

3 messages · Park, Kyong H Mr ECBC, Sundar Dorai-Raj, Simon Blomberg

#
Park, Kyong H Mr ECBC said the following on 3/14/2008 12:25 PM:
Use "lm" to fit the model without random effect and use anova to compare:

z <- read.table(con <- textConnection("     LCU ST1 SURF Block
1  6.71   A    N     1
2  6.97   A    Y     1
3  6.77   B    N     1
4  6.90   B    Y     1
5  6.63   C    N     1
6  6.94   C    Y     1
7  6.79   D    N     1
8  6.93   D    Y     1
9  6.23   A    N     2
10 6.83   A    Y     2
11 6.61   B    N     2
12 6.86   B    Y     2
13 6.51   C    N     2
14 6.90   C    Y     2
15 5.90   D    N     2
16 6.97   D    Y     2"), header = TRUE)
close(con)

library(nlme)
fit <- lme(LCU~ST1*SURF,random=~1|Block,data=z)
fit0 <- lm(LCU~ST1*SURF,data=z)
anova(fit, fit0)

HTH,

--sundar