
   Anyway, when I use lmer I get this error message, I don't know why:



   Error: length(f1) == length(f2) is not TRUE

In addition: Warning messages:

1: In pair:site :

  numerical expression has 77 elements: only the first used

2: In pair:site :

  numerical expression has 77 elements: only the first used

--- El mar, 15/3/11, Ben Bolker <bbolker@gmail.com> escribió:

De: Ben Bolker <bbolker@gmail.com>
Asunto: Re: [R-sig-ME] nested and non-nested random effects
Para: "Iker Vaquero Alba" <karraspito@yahoo.es>
CC: r-sig-mixed-models@r-project.org
Fecha: martes, 15 de marzo, 2011 22:38

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11-03-15 04:37 PM, Iker Vaquero Alba wrote:
> 
> Hello:
> 
> I have a doubt about the syntax for random effects, and I hope you
> can help me with that.
> 
> I am fitting a mixed effects model with 3 random factors, let's call
> them A, B and C for simplicity. A and B are nested factors, B is
> nested into A, and C is not nested, it's just another random effect
> independent from the other 2. I guess the correct way to specify this
> in "lmer" would be something like:
> 
> model1<-lmer(y~fixed1*fixed2+(1|A/B)+(1|C))
> 
> but I am not sure how I could do this with "lme". Maybe:
> 
> model1<-lme(y~fixed1*fixed2,random=~1|A/B,random=~1/C) ???
> 
> or perhaps:
> 
> model1<-lme(y~fixed1*fixed2,random=~C|A/B)    ???

  Fitting non-nested (i.e. crossed) random effects can be done in lme,
but not easily: the best advice is to go read section 4.2.2 of Pinheiro
and Bates 2000, esp. pp. 163-166.

   Why do you need to use nlme::lme rather than lme4::lmer ?  (R-side
random effects, p-values, .... ?)

  Ben Bolker

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1/3EIACgkQc5UpGjwzenMbIwCfT6oSy43whFrpWNBat+8IUH1N
JjEAn1y2HueNyt9ZZBspOAT6QtXya5RG
=0cH4
-----END PGP SIGNATURE-----



      
	[[alternative HTML version deleted]]


