[R-sig-ME] structure of a lmer code
Ista Zahn
istazahn at gmail.com
Thu Mar 29 00:46:34 CEST 2012
Hi Antoine,
I think you want
fm2<-lmer(log(y)~-1+x+(-1+x|group), na.action="na.omit", data=...)
no?
Best,
Ista
2012/3/28 Antoine TARDIF <antoine.tardif at usherbrooke.ca>:
> Dear all,
>
> I would like to fit a multilevel linear model, with varying slope but
> with intercepts fixed at zero (in my experiment, all the samples have
> the same value at time=0).
>
> I have both nested and non-nested factors, but in a first step, we
> would like to fit a lmer model "fm2" equivalent to this lme model
> "fm1" :
>
> library(nlme)
> fm1<-lme(log(y)~x, random=~-1+x|group, na.action="na.omit", data=...)
>
> I tried this code for the lmer function :
> library(lme4)
> fm2<-lmer(log(y)~-1+x+(-1+y|group), na.action="na.omit", data=...)
>
> 1. Instead of providing similar results to fm1, fm2 results do not
> make sense. Is there a mistake in the structure of the fm2 code ?
>
> 2. I also have an other question :
>
> > coef(fm1) works, but
> > coef(fm2) shows this error message : "unable to align random and
> fixed effects"
>
> What does it mean ?
>
> If someone could help me, thanks a lot in advance..
>
> Antoine Tardif
>
> --
> Antoine TARDIF
> Département de Biologie
> Université de Sherbrooke
> Sherbrooke (Qc)
> J1K 2R1 Canada
>
> Bureau D5-0204
> (+ 1) 819 821 8000 poste 61928
> antoine.tardif at usherbrooke.ca
>
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list