R bloggers

Late anniversary edition redux: conditional vs marginal models for clustered data

FavoriteLoadingAdd to favorites

This afternoon, I was looking over some simulations I plan to use in an upcoming lecture on multilevel models. I created these examples a while ago, before I started this blog. But since it was just about a year ago that I first wrote about this topic (and started the blog), I thought I’d post this now to mark the occasion. The code below provides another way to visualize the difference between marginal and conditional logistic regression models for clustered data (see here for an earlier post that discusses in greater detail some of the key issues raised here.) The basic idea is that both models for a binary outcome are valid, but they provide estimates for different quantities. The marginal model is estimated using a generalized estimating equation (GEE) model (here using function geeglm in package geepack). If the…
Original Post: Late anniversary edition redux: conditional vs marginal models for clustered data