Re: [R] GLMMs & LMEs: dispersion parameters, fixed variances, design matrices

About this list Date view Thread view Subject view Author view Attachment view

From: Simon Wood (simon@stats.gla.ac.uk)
Date: Thu 13 May 2004 - 19:53:32 EST


Message-id: <Pine.SOL.4.58.0405131043560.26557@moon.stats.gla.ac.uk>

Hi Mark,

> (2) Is there a way to tell lme (either in nlme or lme4) to just use a
> specified design matrix Z for the random effects, rather than
> constructing one itself from factors? Sometimes I would really like to
> use my own funny-looking Z matrix (e.g. with non-integer coefficients),
> and even with contrasts() I haven't managed to do this.

Here's a simple example showing a `standard' call to lme, and a
less standard one doing the same thing with a specified Z....

library(nlme)
data(Rail)
lme(travel~1,Rail,~1|Rail) # simple r.e. model example

## now repeat fit with home-made Z...
Rail$all<-factor(rep(1,18)) # all one group
## create a simple Z ...
Rail$Z<-model.matrix(~factor(Rail$Rail,ordered=FALSE)-1)
## use pdIdent to force r.e.s to be independent ...
lme(travel~1,Rail,list(all=pdIdent(~Z)))

best,
Simon

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:09 EST