[R-sig-ME] error in lmer: length(f1) == length(f2) is not TRUE

joana martelo jmmartelo at fc.ul.pt
Wed Oct 17 17:18:55 CEST 2012


Thanks for your answers, but it still doesn't work. 
Trial and fish.id are factors, but I get the same error:

> Error: length(f1) == length(f2) is not TRUE In addition: Warning 
> messages:
> 1: In fish.id:trial :
>   numerical expression has 2518 elements: only the first used
> 2: In fish.id:trial :
>  numerical expression has 2518 elements: only the first used


I've tried to find the answer in other mailing lists, but they all give the same answer....

Any ideas of what the mistake might be?

Cheers
Joana



-----Mensagem original-----
De: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] Em nome de Ben Bolker
Enviada: terça-feira, 16 de Outubro de 2012 23:16
Para: r-sig-mixed-models at r-project.org
Assunto: Re: [R-sig-ME] error in lmer: length(f1) == length(f2) is not TRUE

joana martelo <jmmartelo at ...> writes:

> 
> Dear list
> 
  
 [snip]

> 
> I’m using lme4 and tried:
> model<-lmer(reactive.dist~velocity+density+(1|trial/fish.id),family=ga
> ussian
> )
> but got this error and warning:
> Error: length(f1) == length(f2) is not TRUE In addition: Warning 
> messages:
> 1: In fish.id:trial :
>   numerical expression has 2518 elements: only the first used
> 2: In fish.id:trial :
>  numerical expression has 2518 elements: only the first used Is this 
> because I don’t have the same number of reactive distances per fish?

> When I do:
> 
> model<-lmer(reactive.dist~velocity+density(1|fish.id),family=gaussian)
> 
> it works fine…….

  If you search for this error at http://glmm.wikidot.com/faq I think you'll get the hint that you're using a numeric variable as a grouping factor -- in this case I believe trial is numeric and should be converted to a factor.

  Ben Bolker

_______________________________________________
R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-----
Não foram detectados vírus nesta  mensagem.
Verificado por AVG - www.avg.com
Versão: 2012.0.2221 / Base de dados de Vírus: 2441/5336 - Data de Lançamento: 10/16/12



More information about the R-sig-mixed-models mailing list