[R] lme: error message with random=~1
Douglas Bates
bates at wisc.edu
Wed Jan 5 18:02:45 CET 2005
Thomas Petzoldt wrote:
> Douglas Bates wrote:
>
>>
>> I'm not sure what model you want to fit here. To specify a random
>> effect in lme you need both a grouping factor and a model matrix. The
>> error message indicates that lme is unable to determine a grouping
>> factor. It would be correct syntax if you added a single level factor
>> to the data frame and used that but then the model fit would fail
>> because you would be trying to estimate a variance in a model where
>> there is no variation in the term.
>
>
> O.k. I see and think I understand it.
>
>> It seems to me that you are trying to estimate parameters in a
>> mixed-effects model without any random effects and lme can't do that.
>>
>
> Yes, what I want is a model without any random effects to be tested
> against a model with random effects. I want to show, that the random
> effects are negligible but that we account for pseudo replicates and
> have tested this explicitely.
>
> I'm not sure what is better: to leave the random effects in the model or
> simply an LR test against a linear model fitted by lm. I've never seen
> such an example in the books. Or have I missed a global alternative here?
>
> Thomas P.
I would recommend the likelihood ratio test against a linear model fit
by lm. The p-value returned from this test will be conservative because
you are testing on the boundary of the parameter space.
More information about the R-help
mailing list