The ability to simulate correlated binary data is important for sample size calculation and comparison of methods for analysis of clustered and longitudinal data with dichotomous outcomes. One available approach for simulating length n vectors of dichotomous random variables is to sample from the multinomial distribution of all possible length n permutations of zeros and ones. However, the multinomial sampling method has only been implemented in general form (without ﬁrst making restrictive assumptions) for vectors of length 2 and 3, because specifying the multinomial distribution is very challenging for longer vectors. I overcome this diﬃculty by presenting an algorithm for simulating correlated binary data via multinomial sampling that can be easily applied to directly compute the multinomial distribution for any n. I demonstrate the approach to simulate vectors of length 4 and 8 in an assessment of power during the planning phases of a study and to assess the choice of working correlation structure in an analysis with generalized estimating equations.
Shults, Justine, "Simulating Longer Vectors of Correlated Binary Random Variables via Multinomial Sampling" (March 2016). UPenn Biostatistics Working Papers. Working Paper 46.