Compare Treatment Effects of 2 Groups - Repeated Measures & Binary Outcome


I have two groups (1:non-comorbid group, 2:comorbid group), where patients in one group have a condition that patients in the other group do not have at baseline. I want to compare risk factors among these groups on a binary outcome using longitudinal data.

In other words, I want to examine the effects of several time-varying variables on a binary outcome over a period of 4 years. Say, the binary outcome is hospital admission (Yes/No).

An example of one of these time-varying predictors is "medication adherence" measured as Yes/No over the 4 years.

What is the best model for this type of data?
Is it ...
Level 1 - Measurements
Level 2 - Patients
Level 3 - Comorbidity Group

I want to call this a "hierarchical repeated measures model". Is that correct?

How can I compare the longitudinal effects between the two comorbidity groups?
I think I would use glimmix over genmod in maybe the following set-up.
Currently, this is what I have. However, this doesn't give me effects for my covariates across the two groups. Is there a command that would allow for this?

proc glimmix data=coh0;
class id rep admit group;
model admit(ref='0')=covariates /dist=binary link=logit;
random rep/subject=id*group type=ar(1) residual v vcorr;

Thank you in advance for any advice on this matter!
Last edited: