[R-sig-ME] homogeneous glmmTMB models

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Mon Nov 27 16:31:31 CET 2023


   They're not available because no-one has gotten around to writing 
them yet. Pull requests welcome ...

   There are a few notes here (search for "Adding a covariance 
structure") about what needs to be done to add them:

http://glmmtmb.github.io/glmmTMB/articles/hacking.html

   which outlines the code added in this pull request: 
https://github.com/glmmTMB/glmmTMB/pull/891

   Alternatively, you can do this with the map= argument:

data("cbpp", package = "lme4")
library(glmmTMB)

## fit a binomial model with compound-specific variation among periods
m1 <- glmmTMB(cbind(incidence, size-incidence) ~ period + 
cs(period+0|herd), cbpp, family = binomial)

## fix all of the log-standard-deviation parameters (first 4 elements of
##   the random-effects parameter vector to be equal;
##  estimate the correlation (element 5) separately

m2 <- update(m1, map = list(theta = factor(c(rep(1,4), 2))))

   The good news is that you can do this without waiting for anyone to 
update the code.  The bad news is that it's scarier-looking for your 
students (you have to know that the random-effects variance parameter 
vector is called 'theta', how the compound symmetric model is 
parameterized (see the table at the beginning of 
http://glmmtmb.github.io/glmmTMB/articles/covstruct.html; and how the 
map= argument works).

   cheers
    Ben Bolker



On 2023-11-27 6:23 a.m., ben pelzer wrote:
> Dear all,
> 
> In glmmTMB we have these nice heterogeneous variances models like compound
> symmetry, ar1, toeplitz and unstructured, for the covariance matrix over
> time, say. For a course I'm teaching, I would also like to discuss the more
> "simple" homogeneous variances models with compound symmetry, ar1, etc.
> These can be estimated with e.g. package nlme. But why are these not
> available in glmmTMB? Or are they, and should I use a particular syntax?
> Best regards,
> 
> Ben.
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list