I am estimating a set of log binomial models using -glm-; from these, I would like to report relative risks (RRs). In general this is trivial, because RR=exp(coeff). However, for a couple of the models, the only way to get convergence is to use the complement of the outcome, that is, Z=1-Y in place of Y. This means that my RRs have an opposite interpretation, which is nusiance for reporting them all in a single table. So I would like to 'invert' these RRs for 1-Y to get the RR for Y.
If there are no covariates, I can do this quite simply with -nlcom-
but naturally I have additional covariates and this trick doesn't work. I thought I could do something like this using -margins- , but I can't seem to get -margins- to give me the appropriate probabilities. That is,
margins x1, atmeans
reports what I thought were Pr(Z | x1=1) and Pr(Z|x1=0) from which I could get Pr(Y|x1=1) = 1-Pr(Z|x1=1) etc and construct the RR for the effect of x1 on Y, but the result I get does not agree with exp(coeff) from the Y model (in the case where I can model both Y and Z). I don't typically work with log binomial models or relative risks, so I feel like I'm missing something obvious.
thanks,
Jeph
If there are no covariates, I can do this quite simply with -nlcom-
Code:
glm z i.x1, family(binomia) link(log) nlcom (1-exp(_b[1.x1]+_b[_cons]))/(1-exp(_b[_cons]))
margins x1, atmeans
reports what I thought were Pr(Z | x1=1) and Pr(Z|x1=0) from which I could get Pr(Y|x1=1) = 1-Pr(Z|x1=1) etc and construct the RR for the effect of x1 on Y, but the result I get does not agree with exp(coeff) from the Y model (in the case where I can model both Y and Z). I don't typically work with log binomial models or relative risks, so I feel like I'm missing something obvious.
thanks,
Jeph
Comment