09-11-2013 04:53 PM
I have gone through the literature and looked at some examples of mixed modeling but I am not sure if the code I have specified the random effects is correct and efficient. Any advice would be appreciated.
The goal of the study was to look for evidence of spatial correlation of organism counts (1 species) from trees (subjects) planted on a grid (rows by column). To make things simple I transformed the data to follow a normal distribution using a suggested box-cox transformation. I am aware that more appropriate modeling of the counts probably requires using poisson/negbin regression next but I need to work up to that (I will try proc glimmix next).
Each tree was divided into four quadrants (N, E, S, W) and for each quadrant 2 leaves were sampled (a total of 8 leaves per tree).
The response variable, y, refers to the transformed counts. The fixed effects are leaf length (x1) and quadrant (x2). The random effects I want explore are those due to the tree and tree*quadrant interaction. I have written the code below but I am not sure if this is appropriate. I am still confused by when to use the repeated and random statement.
proc mixed data=mydata method=REML;
class quadrant tree;
model Y = quadrant length/solution;
lsmeans quadrant/adjust=bon pdiff=all;
random tree/type=sp(exp)(column row);
Thanks in advance,