[R] ANOVA test to decide whether to use multiple linear regression or linear mixed effects model

S Ellison S.Ellison at LGCGroup.com
Tue Aug 15 16:42:57 CEST 2017


> I am trying to decide between using a multiple linear regression or a linear
> mixed effects model for my data:
> ... 
> but I keep getting the following error code:
> 
> Error in anova.lmlist (object, ...):
> 
>     models were not all fitted to the same size of dataset

anova is defaulting to anova.lm, and that doesn't expect a mixed effects model.

Switch them round to put model2 first:

anova (model2, model1)


S Ellison



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list