0
$\begingroup$

I have a pretty simple question.

Is it worth including a binary variable as a random effect within a mixed effect model?

For example, the fixed effect of a binary variable tells the mean effect between 0 and 1 in a regression. If I also include that as a random effect in a mixed effect model, what does this tell me?

For example, things like a rat's sex don't vary from year to year to year. They are fixed across time. But if I included it as a random effect, how would I interpret the correlation and standard deviation.

For example

    happiness = sex + money + ( sex | country)

If I am interpreting the output correctly, it is telling me the rate at which the differences between sex are not statistically different. Which seems somewhat obvious and not needed.

In other words, is there anything to be gained by including a fixed effect (non time varying) as a random effect in a model in terms of inference?

$\endgroup$
1
$\begingroup$

The term (sex | country) puts a random slope on sex, meaning that the model estimates a mean sex effect, + deviations of the mean sex effect for each country.

Yes, it's worth doing this and standard practice if you have reasons to expect that an effect of interest might be different in each group, regardless if the effect is produced by a binary or any other variable type.

ps: note that, if you write this syntax in lme4, it will estimate both the random slope and a normal random intercept (mean changes between countries).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.