
Dear R-sig members,

 

I'm try for a while to figure out how to analyse my data using lme4 but, since I'm new with mixed models I not sure if I'm doing it correctly.

 

I collect my data with the following design:

 

2 farms

3 forests on each farm

5 block on each forest

a treatment (trenched) and control plot on each block

3 species on each plot

 

Somethinglike this:

 

farm<-as.factor(rep(1:2,e=90))
forest<-as.factor(rep(1:6,e=30))
trt<-as.factor(rep(c("C+","C-"),t=30))
block<-as.factor(rep(1:30,e=6))
spp<-as.factor(rep(c("A","B","C"),e=2,t=30))

 

Well... for each specie I calculate and competition index (C) based on its mass in the paired control and treatment plot. And then calculated a specific site-quality index (Q) dividing the mass of the specie in the trenched plot by the higher mass achieved in a trenched plot. That is, this index varies from 0 (where no seedling survived) to 1 (where it grows better without root competition).

 

My hypothesis is that the slopes of the relation C~Q will differ between species. Since my design is hierarquical, I have to include a random intercept for the forests and random slopes for species. Am I correct?

 

I correct the design matrix, so that the spp factor was considered a dummy variable. 

 

DM <- model.matrix(lm(C ~ spp * Q-1)) 
first.slope.column <- max(as.numeric(spp)) + 1 
DM[,first.slope.column] <- DM[,first.slope.column] * DM[,1] 

 

Well, I tryed this, but I not secure if it is correct.

 

model<-lmer(C~0+DM+(1+spp:Q|forest)) ## I did not include farm since they are only 2, should I include ???

 

I don't know if this is correct and if I can trust the SE. Any help would be greatful!

 

Guilherme

 

 

 

 
 		 	   		  
	[[alternative HTML version deleted]]


