Classification:  UNCLASSIFIED 
Caveats: NONE

R users, 
This is a summary for the responses I got from Sandra Dorai-Raj and Simon
Blomberg followed by my question.

Sandra suggested using lm instead of lme for a model without a random
effect, and Simon suggested anova.lme instead of anova.lm for comparing two
models with and without a random effect. For the anova test, both anova.lme
and anova work.

Thanks again for their quick helpful responses.

Kyong


-----Original Message-----
From: Park, Kyong H Mr ECBC 
Sent: Friday, March 14, 2008 3:26 PM
To: '[email protected]'
Subject: Lme does not work without a random effect (UNCLASSIFIED)

Classification:  UNCLASSIFIED
Caveats: NONE

Dear R users,

I'm interested in finding a random effect of the Block in the data shown
below, but 'lme' does not work without the random effect. I'm not sure how
to group the data without continuous value which is shown in the error
message at the bottom line. If I use 'aov' with Error(Block), is there a
test method comparing between with and without the Block random effect. I'm
using R 2.4.1.

Appreciate your help.

Kyong  

     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

A result with the random effect:

Anal1<-lme(LCU~ST1*SURF,random=~1|Block,data=data1)
> summary(Anal1)
Linear mixed-effects model fit by REML
 Data: data1 
       AIC      BIC    logLik
  25.38958 26.18399 -2.694789

Random effects:
 Formula: ~1 | Block
        (Intercept) Residual
StdDev:   0.1421141 0.218483

Fixed effects: LCU ~ ST1 * SURF 
             Value Std.Error DF  t-value p-value
(Intercept)  6.470 0.1842977  7 35.10625  0.0000
ST1B         0.220 0.2184830  7  1.00694  0.3475
ST1C         0.100 0.2184830  7  0.45770  0.6610
ST1D        -0.125 0.2184830  7 -0.57213  0.5851
SURFY        0.430 0.2184830  7  1.96812  0.0897
ST1B:SURFY  -0.240 0.3089816  7 -0.77675  0.4627 ST1C:SURFY  -0.080
0.3089816  7 -0.25892  0.8031
ST1D:SURFY   0.175 0.3089816  7  0.56638  0.5888

Without the random effect:

Anal2<-lme(LCU~ST1*SURF,data=data1)
Error in getGroups.data.frame(dataMix, groups) : 
        Invalid formula for groups
Classification:  UNCLASSIFIED
Caveats: NONE

Classification:  UNCLASSIFIED 
Caveats: NONE


        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to