Bradley Terry GLMM in R ?
See this great document page 74-77. Agresti?s book is amazing and this document is essentially for doing everything in it in R https://artowen.su.domains/courses/306a/SplusDiscrete.PDF Cheers, Simone. Simone Blomberg, BSc (Hons), PhD, MAppStat The University of Queensland St. Lucia Queensland 4072 Australia email: S.Blomberg1_at_uq.edu.au<http://s.blomberg1_at_uq.edu.au/> UQ ALLY Supporting the diversity of sexuality and gender at UQ. Policies: 1. I will NOT analyse your data for you. 2. Your deadline is your problem. If you can?t stand algebra, stay out of evolutionary biology. - J. M. Smith.
On 8 Oct 2022, at 12:59 am, florian.wickelmaier at uni-tuebingen.de wrote:
? We want to fit Bradley-Terry-style GLMM models in R. We looked into: https://cran.r-project.org/web/packages/BradleyTerry2/vignettes/BradleyTerry.pdf and http://bbolker.github.io/mixedmodels-misc/glmmFAQ.html We have voter-specific variables x that influence which political message (i vs j) wins for them: logit[pr(i beats j | person with covariate x)] = lambda_i - lambda_j + (beta_i - beta_j) x We then model parameters as random effects: lambda_i ~ N(0, sigma_lambda) beta_i ~ N(0, sigma_beta) Is there a way to do this in R ? We do this in TensorFlow in Python by directly specifying design matrices with the 0,-1,1 or 0,-x,x entries. However, I do not see how to do this in R using lme4, BradleyTerry2, mgcv, etc. Thanks so much, Shira Not directly what you asked for, but since you have voter covariates, you could have a look at a tree-based Bradley-Terry model as implemented in psychotree::bttree(). Best, Florian --- Florian Wickelmaier Department of Psychology University of Tuebingen http://www.mathpsy.uni-tuebingen.de/wickelmaier/ _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models