I am trying to fit a multilevel log-binomial model in order to calculate the prevalence (risk) ratio (rather than the odds ratio) for a clustered binary outcome and am running into an unexpected error.

using the glm command, one can correctly specify a single-level log-binomial model as

glm depvar indvar, family(binomial) link(log) eform

However, when specifying the same model as a 2 level-level, random intercept model using meglm

meglm depvar indvar || village: || household: , family(binomial) link(log) eform

I get the following error,

link log is not allowed with family bernoulli

r(198);

I am running Stata 14, so am wondering if there is an extra package i need to install to be able to run the log-binomial model at 2 levels.

or it is simply a limitation of the meglm command. Any insights or suggestions would be much appreciated

Thanks!!]]>

The help for meglm includes this:

This table says that the combination of binomial error and log link is not allowed. You say that the combination worked for you with a single-level glm model, and I am sure I have been able to run it as a single-level glm model. I'm guessing that you have found a difference between glm and meglm and there's nothing you can do to get around it. I would shift to a negative binomial or Poisson model. They will probably be indistinguishable in the estimates they produce. ]]>