I’m running a beta-binomial mixed effects model that estimates the effect size (B) and partitions variance into a random effect (g) and error (e). I would like to calculate the residuals (e), but only have values for the fixed effects and the proportion of variance explained by the random effect and error term (a & b respectively). Because of the data, model, and software (MACAU) I am using, the only outputs are the parameters and it will not produce the residuals or vector of random effects directly.
How can I calculate the values of e?
Simplified model: Y ~ Bin(N,pi); log(pi/1-pi) ~ xB + g + e
Where Y represents a n-by-1 matrix, g(i)...g(n) is distributed MVN(0,aK), and e(1)...e(n) ~ MVN(0,bI). Within g and e, a and b are constants, K is a covariance matrix within the data, and I is the identity matrix.
An indirect solution would be to calculate the values of g and then back-calculate e from the observed values. However, I’m unsure how to calculate values of g that could be used.