Random effects model with group specific residual variance in R

Hi Posit Community

I am trying to make a random effects model with two fixed effects, two random effects, and different residual variance for each level (two levels) of one the fixed effects. In SAS proc mixed, the model looks like this :

proc mixed data=stability;  
    class ana_method Batch ana_run;  
    model assay= Time ana_method / solution;  
    random Batch ana_run;  
    repeated / group=ana_method;  
run;

I would usually use nlme for random effects models in R. However, it seems like nlme does not support group specific residual variance.

It seems like glmmTMB has a lot more flexibility, so I tried the following model:

model2 <- glmmTMB(assay ~ Time + ana_method  + (1 | Batch) + (1 | ana_run),
                 dispformula = ~ ana_method,  
                 data = stability_data)

However, I do not get the separate residual variance for the two levels of ana_method that I am looking for. Any ideas would be greatly appreciated.

Best,
Peter

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.