Takes simulation parameter arguments and returns simulated data for two different probability distributions. One is logistic (0/1) outcome and the second being poisson (count) outcomes.
data_glm_nested(Xmat, Zmat, beta, rand_eff, n, p, outcome_type)
A matrix of covariates.
Design matrix for random effects.
A vector of regression parameters.
A vector of random effects, must be stacked.
Number of clusters.
Number of units within each cluster.
A vector specifying the type of outcome, must be either logistic or poisson. Logitstic outcome will be 0/1 and poisson outcome will be counts.