[R] Error message in lmer

Gang Chen gangchen at mail.nih.gov
Thu Aug 2 15:55:13 CEST 2007


Thanks a lot for the response and explanation, Lorenz! It seems that  
I can run the analysis with 'lm' without treating subject as a random  
factor

lm(Resp ~ Group*Cov, TestData)

Thanks,
Gang

On Aug 2, 2007, at 5:09 AM, <lorenz.gygax at art.admin.ch>  
<lorenz.gygax at art.admin.ch> wrote:

> I do not think anyone has answered this.
>
>> I'm trying to run a simple one-way ANCOVA with the lmer
>> function in R  package lme4, but have encountered some
>> conceptual problem. The data file MyData.txt is like this:
>>
>> Group Subj Cov Resp
>> A    1   3.90   4.05
>> A	 2   4.05	4.25
>> A	 3   4.25	3.60
>> A	 4   3.60	4.20
>> A	 5   4.20	4.05
>> A	 6   4.05	3.85
>> B	 7   3.85	4.15
>> B	 8   4.15	4.60
>> B	 9   4.60	4.15
>> B	 10  4.15	4.40
>> B	 11  4.40	3.35
>> B	 12  3.35	3.80
>> B	 13  3.80   3.90
>>
>> Since I would like to treat subject (Subj) as a random
>> factor, my one- way ANCOVA (with covariate, Cov) is:
>> TestData=read.table("MyData.txt", header=T);
>> m1 <- lmer(Resp ~ Group * Cov + (1 | Subj), TestData)
>
> This is a conceptual problem, indeed. To be able to estimate a  
> subject effect, you need to have repeated measurements (several  
> lines) per observed subject ...
>
> Cheers, Lorenz



More information about the R-help mailing list