Hi I am running some linear and non-linear mixed effect models and would like to do some planned contrasts (a priori contrasts)

I have looked in the help and in many forums and it seems possible to do so but don't understand how to write the function and I couldn't find an example in Pinheiro and Bates. 

 lme {nlme} has a  contrasts argument but I can't understand how to code it. 

Here is a simple example of my working lme model:
dependent variable: APHIDS: log (number of aphids)
Fixed effects: DAY (time)   and  TREATMENT ( 6 different aphid treatments)
Random effects: POPULATION (each population is counted through time)

lme.fit<-lme(log(APHIDS)~ DAY*TREATMENT, random = ~ DAY| 			POPULATION,data= aphid.data)

My hypothesis testing focuses on comparing Treatments ~ 1 and 4 , and eventually 2 vs 5, and 3 vs 6. 

Q1:  How can I do planned contrasts on these pairs for the main effect of TREATMENT? 

Q2: Can I also do this for the interaction term (DAY*TREATMENT)?

Q3: Would this code work for a non-linear mixed effect model    nlme( )


P.S. Even just posting a personal example or a link to one would be greatly appreciated. 


thanks for the help

these forums are incredibly helpful

Martin Turcotte
mart.turcotte@gmail.com




	[[alternative HTML version deleted]]

