[R-sig-ME] Error in LME4

Ben Bolker bbolker at gmail.com
Sun Jun 8 01:54:23 CEST 2014


On 14-06-07 04:29 PM, Sunil Mundra wrote:
> Hello all,
> I am new to use LME4 for analysing mixed effect model.
> I am trying to test impact of Deep-snow treatment, sampling round, and
> sampling depth on fungal richness.
> In my experiment:
> I have two block (C and D), each Block has 3 fence group.
> I have two treatment one is where snow is deep (causing soil warming)
> and other in control sample, at each fence.
> Samples are collected 9 times in summer from two different depth (2cm
> and 5cm).
> I hope i am able to explain my experiment well...
> 
> My first question the the model I am using (see below) here, is OK for
> this question?
>  Z1 <- lmer(Richness ~ Treatment*Round*Depth +
> (1|Block/Fence/Treatment/Round), REML= FALSE, data = data)
> 
> Second when i am running this this argument i am getting following error
> as mention below.
> Error in lme4::lFormula(formula = Richness ~ Treatment * Round * Depth +  : 
>   rank of X = 28 < ncol(X) = 36
> I tried to google it, but did not manage to find the solution.
> I also get similar error (col pivoting) when i was trying CCA analysis
> for community study with similar predictor and random variables.
> 
> Help in this regards would be highly appreciated....!!!
> Regards
> Sunil

  This means that you don't have all 36 combinations of Treatment,
Round, and Depth in your experimental design (based on the arithmetic it
seems that "Round" is your 9 samples).  (You probably only have 28
combinations -- were some treatment/depth combinations missed in some
rounds?)  If you use a recent version of lme4 you should be able to ask
lme4 to drop the aliased/unidentifiable columns -- in fact this should
happen automatically.

  However, you have more problems than this (sorry)

 * you're probably not going to be able to fit block as a random effect
(because there are only two levels)
 * you shouldn't have the same factor included as both a random and a
fixed effect

 I would suggest (I think)

Richness ~ Treatment*Depth + (1|(Block:Fence)/Round)

 possibly

 Richness ~ Treatment*Depth + (Treatment*Depth|(Block:Fence)) +
(1|Block:Fence:Round)

 to allow for variation in treatment/depth effects across blocks and
block/fence combinations



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