I had a single sample of a binary outcomes (success / failure), and I wanted to estimate the population proportion with a point estimate and a confidence interval. The problem was that some subjects contributed 2 samples, while others just 1, so my observations, or at least some of them, weren't independent.
To solve this problem, I ran both a GEE model and a GLMM model. I used the binary outcome as a dependent variable, and a vector of 1's as an independent variable, making the intercept my parameter of interest. I thought that it would give me the proportion I look for. The vector of 1's was declared in SAS as a classification variable.
And now for the problem. When I used the
logit link function, I did not get the correct results. When I used the log link function, I did. I thought that the
log link function suits the Poisson model, so I am confused. I suspect it might have something to do with the difference between proportion and predicted probabilities, but I'm not sure. I wanted to ask if someone can explain to me (and maybe please attach a formula) why the log link function is what I need here? To be more specific, if $b$ is the estimate of the intercept, I did at first $e^b/(1+e^b)$, which was wrong. When I did $e^b$, it was correct. I need to know why...
My SAS code was:
PROC GENMOD DATA=data descending; CLASS ID D * D is vector of 1's; MODEL Y = D / dist = bin link=log cl; REPEATED subject= ID; LSMEANS D/ cl exp; RUN;