[R] syntax for interactions in lme

From: Matthew Forister <forister_at_life.bio.sunysb.edu>
Date: Thu 27 Oct 2005 - 02:33:33 EST

Hello,

I am trying to make the switch from SAS, and I have a fairly elemental problem with syntax using the nlme package for analyzing mixed models. There was a previous question on this topic posted to this list, so I apologize for redundancy, but I didn't understand the advice given to that inquiry. The model I want to run has the following factors:

Host (fixed)
Sire (random)
Dam nested within Sire (random)
Host * Sire (random)
Host * Dam within Sire (random)

So without the interactions I have:

hogmodel = lme(gain ~ host, random = ~1|sire/dam)

If I understand correctly, that "sire/dam" term gives me both Sire and Dam within Sire as random factors. OK, so now I want to add the two interactions (listed above)...

In SAS, I would just enter them as random factors, but I can't seem to make that work. I think I need to make a list that includes Sire/Dam, Host:Sire, and Host:Sire/Dam. Two questions:

  1. Is it sufficient to have simply Host:Sire/Dam in order to code for both interactions (host*sire and host*dam-within-sire)?
  2. In any event, WHAT IS THE SYNTAX FOR MAKING A LIST OF RANDOM FACTORS?

I have looked in section 1.3 of Pinheiro&Bates, which was helpful, but I wasn't able to answer my question. Thanks in advance, your help will keep me from running back to SAS!

--Matt


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Oct 27 02:38:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:47 EST