Skip to content
Prev 177414 / 398506 Next

Generate bivariate binomial data

Hi Thierry,

I think it should be possible to generate such correlated data using a mixed model approach:


1) Generate pairs of correlated linear predictor values using an ordinary linear mixed
model setup (for example using rnorm() repeatedly)

2) Back-transform these values using the inverse logit (or similar link function) to
obtain probabilities

3) Draw binomial responses using the probabilities from 2) (using rbinom())


You may need to use trial-and-error to get the right amount of correlation.


Christian