# Can one have a random effect in a mixed model without a corresponding fixed effect?

I struggling to understand whether it is possible to have random effect without the respectively fixed effect. For example, I use lme4 to fit two models:

y ~ 1 + (1 + x | z)


and

y ~ 1 + x + (1 + x | z)


the random effect for x seems to be the same despite the fact that in the first model, there should be a random effect of z on the slope of x, but x doesn't seem to have a fixed effect (!). What am I missing?

• Both models are possible. All random effects have mean zero, so in your first model you constrain the average (across z) effect of x on y to be zero. In the second model the average effect will be given by the fixed effect. – amoeba Mar 2 '18 at 11:45
• Thank amoeba. So this means that if the slope for the fixed effect is zero, the two models will be exactly the same? – nitzan shahar Mar 2 '18 at 13:33
• Yes, I think so. – amoeba Mar 2 '18 at 14:08