 I have a quick question about syntax for a glmer call.

I am fitting models with categorial predictors (Norm_XY and Norm_21)

e.g.

model <- glmer(Sex ~ 1 + Norm_XY + Norm_21 + (Norm_XY|Pat_ID/Proc_ID)  + 
(Norm_21|Pat_ID/Proc_ID), data =  PGD_21.df,family = binomial)

this will fit random effects for the intercept and "slope" associated with 
each predictor

Random effects:
 Groups           Name        Variance  Std.Dev. Corr 
 Proc_ID.Pat_ID   (Intercept) 0.0371635 0.19278       
                  Norm_21NN   0.0073152 0.08553  -1.00
 Proc_ID.Pat_ID.1 (Intercept) 0.0007932 0.02816       
                  Norm_XYNN   0.0390357 0.19757  -0.89
 Pat_ID           (Intercept) 0.0055269 0.07434       
                  Norm_21NN   0.0129897 0.11397  0.99 
 Pat_ID.1         (Intercept) 0.0781525 0.27956       
                  Norm_XYNN   0.0579198 0.24067  -1.00

What I can't figure (and have failed to find an example of) is the syntax 
for "common" estimates of the random effects (i.e., for both categorical 
predictors).

The following syntax will generate a common estimate of the random effects 
for the intercept

model <- glmer(Sex ~ 1 + Norm_XY + Norm_21 + ((Norm_XY + 
Norm_21)|Pat_ID/Proc_ID), data =  PGD_21.df,family = binomial))

the estimates are

Random effects:
 Groups         Name        Variance Std.Dev. Corr       
 Proc_ID:Pat_ID (Intercept) 0.010129 0.10064             
                Norm_XYNN   0.035686 0.18891   0.99      
                Norm_21NN   0.009532 0.09763  -0.99 -1.00
 Pat_ID         (Intercept) 0.101927 0.31926             
                Norm_XYNN   0.070295 0.26513  -0.98      
                Norm_21NN   0.019164 0.13843   0.11  0.08

So how does one specify a model that estimates the random effects for the 
"common" or joint categorical predictor of the "slope"  (i.e. for Norm_XY 
and Norm_21 combined)?

This model would produce estimates like this

Random effects:
 Groups         Name        Variance Std.Dev. Corr       
 Proc_ID:Pat_ID (Intercept) XXX    
                           Common "slope" ZZZ     QQQ
 Pat_ID               (Intercept) YYY            
                           Common "slope" WWW  RRR

In these applications, the random effects are nuisance parameters, so I 
don't necessarily need predictor-specific estimates. That said, I do want 
to account for the random effects and their influence on the estimates of 
the fixed effects (otherwise I would just use GLM)

The first model above penalizes AIC by 24 (just considering random effects) 
and the last model would penalize it by 12. this is a big difference.

MANY THANKS!



	[[alternative HTML version deleted]]

