Skip to content

Mixed model

3 messages · Stephen, Spencer Graves, Douglas Bates

#
(comments in line)
Stephen wrote:
I'm not familiar with this syntax.  I would replace your "random" 
formula with "~1|id/grp".  Did you get sensible results from your 
attempt to compute "model.mix"?  How do the results compare with the 
results from replacing your "random" with "~1|id/grp"?  Also, I'd try 
the same thing with lmer;  please see "Fitting Linear Mixed Models in R" 
by Doug Bates in the latest R News, downloadable from 
"www.r-project.org" -> Newsletter.
I haven't used "by" enough to comment on this.  If I had problems 
with something like this, I might do something like the following:

	  with(Dataset, table(runnb, id, grp))

	  Do you have enough observations in all cells to be able to estimate 
all these individual models?  If yes, I might proceed as follows:

	  b.lvls <- table(Dataset$runnb)
	  nb <- length(b.lvls)
	  fit <- vector(mode="list", nb)
	  for(i in 1:nb)
		    fit[[i]] <- lme(...)	
	
	  If I still had problems with this, I might manually step through this 
until I found the "i" that created the problem, etc.
#
On 6/20/05, Spencer Graves <spencer.graves at pdf.com> wrote:
The syntax in lmer would be

model.mix <- lmer(trans1 ~ Index1 + grp + (1|id:grp) + (1|id),
Dataset, na.action = na.exclude)