I am new to both R and mixed models, so I apologize in advance about the 
simplistic nature of my question.
 
My dataset is unbalanced and have been I have been advised by the statistician 
on my Ph.D. committee to run a mixed model.  The response variable is distance.  
The factors are preyswim, light, and trial.  I am interested in the effects of 
light and preyswim on distance.  Trial is a random factor and there is also a 
crossed random effect of preyswim*trial.  In SAS, the code would look like this:
 
Proc mixed data=laketrout;
Class preyswim light trial;
Model distance = light | preyswim;
Random trial trial*preyswim;
Run;
 
My understanding is that to test the full ANOVA model in R, I would need to code 
three separate models and determine the most appropriate.  This is how I 
attempted to code the same model using the lme4 package in R:
 
options(contrasts=c(unordered="contr.SAS", ordered="contr.poly"))
mixed1 <- lmer(distance~preyswim*light + (1|trial) + (1|preyswim), laketrout, 
REML=FALSE)
mixed2 <-lmer(distance~preyswim + light + (1|trial) + (1|preyswim), laketrout, 
REML=FALSE)
mixed3 <-lmer(distance~preyswim + (1|trial) + (1|preyswim), laketrout, 
REML=FALSE)
 
My questions are:

1.  Did I correctly set up the mixed model in R?
2.  When determining the most appropriate model in R (I used the anova function 
to compare the three models), does it matter whether I use the AIC/BIC or 
log-likelihood criterion?  Along those lines, I'm unsure whether I need to use 
REML=TRUE or REML=FALSE in my code.


I no longer have access to SAS although it is the preferred statistical program 
used by my committee statistician.  I understand that there are some limitations 
to SAS anyway, particularly when calculating p-values for mixed models with 
random effects.  My preference is to use R for my statistical analyses, as long 
as I know that I'm using it correctly.


Thanks so much for your help,
-Beth
 
Beth Holbrook
University of Minnesota
bvholbi@yahoo.com



      
	[[alternative HTML version deleted]]


