[R] Intercepts is coming as Zero in the Mixed Models

Ben Bolker bbolker at gmail.com
Mon Nov 7 13:21:03 CET 2011

arunkumar1111 <akpbond007 <at> gmail.com> writes:
> I'm getting the intercepts of  the Random effects as 0. Please help me to
> understand why this is coming Zero
> This is my R code
> Data<- read.csv("C:/FE and RE.csv")
> Formula="Y~X2+X3+X4 + (1|State) + (0+X5|State)"
> fit=lmer(formula=Formula,data=Data)
> ranef(fit).

  This question is more suited for the r-sig-mixed-models mailing
list ...

   You are getting an estimate of zero variance because lmer
is computing that as the best estimate.  The reason is that it's
really completely impractical to try to estimate the variance among
levels of a factor with only two levels.  There is more discussion
of this issue at


  Thanks for including your data so we could see the problem.

More information about the R-help mailing list