I am using xtgee in Stata to model change in consent rates over time. I have three levels (time, students, and schools). I am modeling only two time points - consent before (0/1) and consent after (0/1). Currently my model looks like this: xtgee wcon ib1.time, fam(poisson) link(log) i(studentid) t(time) corr(uns) robust eform This model only adjusts for time within students, not schools. I have looked across the interwebs and in various books but can't seem to find how I would code school as a third level. I've tried to add SchoolID to xtset, but it tells me I have too many variables (there are already time and studentid added). I've also tried to add SchoolID to i() directly in the model, but I get the same error. Any help is appreciated |