Dear all,

I have run a model with fixed intercepts but random slopes on categorical
predictors by the following command:

FixedIntRandomSlope <- lmer(POPULAR ~ 1 + SEX + (0 + SEX|SCHOOL), data =
popular, REML = FALSE)
summary(FixedIntRandomSlope)

I got the different results in the random effect when I treated SEX as
dummy variable manually or treated SEX as factor.

Here is the result for the dummy-variable predictor:

Random effects:
 Groups   Name Variance Std.Dev.
 SCHOOL   SEX  0.87531  0.93558
 Residual      0.87053  0.93302

Here is the result for the variable transformed into factor format:

Random effects:
 Groups   Name Variance Std.Dev. Corr
 SCHOOL   SEX0 0.93044  0.96459
          SEX1 0.92104  0.95971  0.855
 Residual      0.39244  0.62645

I think SEX0 and SEX1 should not be both random effects.

I have checked predictor and found that the variable really have two
categories:

> summary(popular$SEX)
   0    1
1026  974

I use lme4 version lme4_0.999999-0.

Please teach me what is going on in this case. Thank you very much.

Best,
Sunthud

	[[alternative HTML version deleted]]

