[R] cross-nested random structure in glmmPQL

Carina Dinkel nevaeh_ at web.de
Fri Aug 9 08:14:53 CEST 2013


Dear members,
 
I'm trying to fit a GLMM using glmmPQL with a cross-nested random structure. Basically, I have perfectly crossed observations of whether there is a relation between two people (sender and receiver of relation) and I'd like to do a random structure where the relations to an from the same actor are related.
If A and B are the random effects for specific sender and receiver the covariance matrix should look like this:
 
sigma_A^2*I      sigma_AB*I
sigma_AB*I       sigma_B^2*I
 
where I is an n x n identity matrix.
The code I have so far has the random structure of:
 
> const <-  factor(rep(1, length(data$y)))
> mod <- glmmPQL(y ~ as.factor(variableS) + as.factor(variableR),
> random = list(const = pdBlocked(list(pdIdent(~1),pdIdent(~sender-1),pdIdent(~receiver-1)))),
> data=data, family=binomial)
 
I think this code only leads to a diagonal covariance matrix and doesn't consider the covariance sigma_AB I'd like to model. Do you have any suggestions how I have to change the random part of my formula in order to get the right covariance matrix?

(I've posted this in the mixed models group, too... but maybe in the general mailing list someone can help me in any way)
 
Any help is highly appreciated!
 
Thank you,
Carrie



More information about the R-help mailing list