Simulate GLMM responses from conditional distribution
Source:R/predictInterval_helpers.R
simulate_glmm_response.RdInternal helper that simulates responses from the conditional distribution of Y|b (given random effects) for GLMMs. This implements the correct theoretical approach where residual variance is inherent in the distribution.
Arguments
- yhat
Matrix of linear predictors (fixed + random effects).
- family
Character string specifying the distribution family.
- link
Character string specifying the link function.
- weights
Optional weights (for binomial with n-trial parameter).
- use.probability
For binomial, return proportions (0-1) instead of counts?