Re: [R] Package for multiple membership model?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 04 Jan 2006 - 02:46:52 EST

"Brian Perron" <beperron@wustl.edu> writes:

> Hello all:
>
> I am interested in computing what the multilevel modeling literature
> calls a multiple membership model. More specifically, I am working
> with a data set involving clients and providers. The clients are the
> lower-level units who are nested within providers (higher-level).
> However, this is not nesting in the usual sense, as clients can
> belong to multple providers, which I understand makes this a
> "multiple membership model." Right now, I would like to keep this
> simple, using only a continuous dependent variable, but would like
> to also extend this to a repeated measures design. This doesn't seem
> to be possible with the lme package. Is there something else I could
> consider? Thanks, Brian

You could take a look at the lmer() function in the lme4/Matrix packages - see the Rnews 2005/1 article. One potential problem is that for repeated measurements, it is not (currently?) as strong on correlation structure as lme().

You can actually deal with crossed random effects in lme() too, it just gets a little more complicated, involving things like

library(nlme)
data(Assay)
as1 <- lme(logDens~sample*dilut, data=Assay,

           random=pdBlocked(list(
                     pdIdent(~1),
                     pdIdent(~sample-1),
                     pdIdent(~dilut-1))))

as2 <- lme(logDens~sample*dilut, data=Assay,
           random=list(Block=pdBlocked(list(
                     pdIdent(~1),
                     pdIdent(~sample-1))),dilut=~1))

as3 <- lme(logDens~sample*dilut, data=Assay,
           random=list(Block=~1,
                     Block=pdIdent(~sample-1),
                     dilut=~1))

which all fit the same model (but get the DF wrong in three different ways...)

This is slightly different from your example because the crossed factors are nested in "Block", but you can always fake a nesting using

one <- rep(1, length(logDens)) #or whatever lme(...., random=list(one=~....))

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
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 Wed Jan 04 03:23:31 2006

This archive was generated by hypermail 2.1.8 : Wed 04 Jan 2006 - 04:51:28 EST