[R-sig-ME] Mixed model with a blocking factor and a nested structure inside

Aitor Larrañaga aitor.larranagaa at ehu.es
Mon Mar 7 15:12:33 CET 2011


Dear list members,

I am trying to model in R an experiment with the BACI structure, that is, consisting in a Before-After factor and a Control-Impacted one, both fixed. I had the same sampling structure in four locations, what makes location a random blocking factor. That would be easy for me if I had not also some samplings Before (2 samplings) and After (3 samplings) the affection we generated in our systems.

In short, I have a random blocking factor, two fixed factors (BA and CI) and a random sampling factor nested within BA (BA/sampling). The number of samples within each cell is ten and I have not empty cells. The sources of variation I am interested in the model are:

-BA
-CI
-BA*CI
-BA/sampling
-CI*(BA/sampling)

I have tried many different types of syntaxes and none gives me a valid result. The packages I have used are nlme and lme4, with some preference to the first as p values are obtained more easily. One of the syntaxes I have used:

model<-lme(Response~BA*CI+BA/Sampling+CI*BA/Sampling,random=~1|Block),

gives the following error:

Error in MEEM(object, conLin, control$niterEM) : 
  Singularity in backsolve at level 0, block 1

Below I send an example of a dataset similar to what I am using (with just two cases per cell and three blocks for brevity).

Block	BA		CI		sampling	ResponseVariable
a		B		C		1			3.4
a		B		C		1			2.5
a		B		C		2			7.8
a		B		C		2			6.5
a		A		C		3			3.4
a		A		C		3			1.2
a		A		C		4			0.9
a		A		C		4			2.3
a		A		C		5			2.2
a		A		C		5			5.6
a		B		I		1			8.9
a		B		I		1			9.0
a		B		I		2			1.4
a		B		I		2			1.4
a		A		I		3			2.7
a		A		I		3			4.4
a		A		I		4			4.0
a		A		I		4			3.7
a		A		I		5			2.2
a		A		I		5			1.1
b		B		C		1			7.0
b		B		C		1			6.9
b		B		C		2			5.6
b		B		C		2			3.4
b		A		C		3			2.3
b		A		C		3			1.1
b		A		C		4			1.8
b		A		C		4			9.6
b		A		C		5			5.4
b		A		C		5			6.6
b		B		I		1			1.0
b		B		I		1			7.7
b		B		I		2			5.9
b		B		I		2			3.3
b		A		I		3			3.2
b		A		I		3			2.1
b		A		I		4			0.9
b		A		I		4			4.3
b		A		I		5			7.7
b		A		I		5			8.7
c		B		C		1			6.5
c		B		C		1			3.8
c		B		C		2			3.4
c		B		C		2			0.4
c		A		C		3			6.8
c		A		C		3			4.4
c		A		C		4			9.6
c		A		C		4			6.5
c		A		C		5			6.1
c		A		C		5			7.7	
c		B		I		1			9.9
c		B		I		1			7.6
c		B		I		2			5.6
c		B		I		2			3.4
c		A		I		3			2.6
c		A		I		3			1.7
c		A		I		4			2.8
c		A		I		4			6.7
c		A		I		5			5.6
c		A		I		5			7.8

I would be eternally grateful to the list if someone can lead me to the answer of the matter.

All the best,

Aitor Larrañaga



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