# [R] Multilevel model with lme(): Weird degrees of freedom (group level df > # of groups)

Bertolt Meyer bmeyer at sozpsy.uzh.ch
Sat Apr 3 19:20:56 CEST 2010

```Hello everyone,

I am trying to regress applicants' performance in an assessment center
(AC) on their gender (individual level) and the size of the AC (group
level) with a multi-level model:

model.0 <- lme(performance ~ ACsize + gender, random = ~1 | ACNumber,
method = "ML", control = list(opt = "optim"))

I have 1047 applicants in 118 ACs:

> length(performance)
[1] 1047

> length(levels(as.factor(ACNumber)))
[1] 118

There are five AC sizes and gender has two levels (coded as -1 for
female and 1 for male):

> length(levels(as.factor(ACsize)))
[1] 5

> length(levels(as.factor(gender)))
[1] 2

However, when I examine the model summary, the predictor on the
individual level (gender) and the predictor on group level (ACsize)
have the same degrees of freedom:

> summary(model.0)
Linear mixed-effects model fit by maximum likelihood
[...]

Random effects:
Formula: ~1 | ACNumber
(Intercept)  Residual
StdDev:   0.1650112 0.8146622

Fixed effects: performance ~ ACsize + gender
Value  Std.Error  DF   t-value p-value
(Intercept)  3.0927051 0.24573622 927 12.585467  0.0000
ACsize      -0.0568915 0.02782755 927 -2.044431  0.0412
gender       0.1679830 0.02780940 927  6.040510  0.0000
[...]

Number of Observations: 1047
Number of Groups: 118

How is it possible that the group-level predictor has a df > than the
number of groups? I am a little at a loss here and would appreciate it
if someone could explain this to me... What am I missing?

Regards,
Bertolt

--
Dr. Bertolt Meyer
Senior research and teaching associate
Social Psychology, Institute of Psychology, University of Zurich
Binzmuehlestrasse 14, Box 15
CH-8050 Zurich
Switzerland

bmeyer at sozpsy.uzh.ch
tel:   +41446357282
fax:   +41446357279
mob:   +41788966111

```