The REPEATED statement in PROC GENMOD fits the GEE model. It is not a hierarchical model - which can be fit using the RANDOM statement in PROC GLIMMIX. The GEE method is robust to misspecifying the correlation structure, so the results can still be valid in your situation. The unstructured correlation matrix (TYPE=UN) can accommodate any correlations among the repeated measures since it imposes no structure on them, but it can cause fitting problems because it requires estimating all of the correlations. Similarly, using the log link with the binomial distribution can cause fitting problems since it doesn't ensure that predicted values are valid (in the 0 to 1 range) for the binomial distribution. So, you could follow the method at the beginning of this note, but use either PROC GENMOD (with REPEATED) or PROC GLIMMIX (with RANDOM) instead of PROC LOGISTIC to fit the usual logit-linked binomial model (logistic model), and then follow with the NLMeans macro to estimate the relative risk. The log-linked binomial model is covered later in the note and discusses the fitting problems that I mention above.
... View more