Skip to content

Advice on Mixed Models

1 message · Rose Rosei

#
Many thanks, Professor Bolker- Very Much appriciated

When I use this model:

lmer(mark~ (1|A)+(1+D)+(1|S)+(1|Q)+ S1+ (1|S1/D/S/A), R) # session as a
fiexed effect

I got the following results, which are not consistent with the SPSS Output
( Variance Components)

Linear mixed model fit by REML ['lmerMod']
Formula: mark ~ (1 | A) + (1 + D) + (1 | S) + (1 | Q) + S1 + (1 | S1/D/S/A)
   Data: R
REML criterion at convergence: 190.5212
Random effects:
 Groups       Name        Std.Dev.
 A:(S:(D:S1)) (Intercept) 0.9581
 A            (Intercept) 0.7198
 Q            (Intercept) 0.0000
 S:(D:S1)     (Intercept) 0.0000
 D:S1         (Intercept) 0.0000
 S1           (Intercept) 1.1411
 S            (Intercept) 0.0000
 Residual                 0.6722
Number of obs: 80, groups:  A:(S:(D:S1)), 10; A, 10; Q, 8; S:(D:S1), 7;
D:S1, 4; S1, 2; S, 2
Fixed Effects:
(Intercept)            D           S1
    2.31250      0.02679     -0.59821
convergence code 0; 2 optimizer warnings; 0 lme4 warnings

SPSS output

*Variance Estimates*

Component

Estimate

Var(A)

2.443

Var(D)

-.302a

Var(S1)

-.348a

Var(O)

.093

Var(A * D)

.000b

Var(A * S1)

.000b

Var(A * O)

.548

Var(A * S)

.000b

Var(D * S1)

.139

Var(D * O)

-.074a

Var(D * S)

.554

Var(S1 * O)

-.210a

Var(S1 * S)

.644

Var(O * S)

-.124a

Var(A * D * S1)

.000b

Var(A * D * O)

.000b

Var(A * D * S)

.000b

Var(A * S1 * O)

.000b

Var(A * S1 * S)

.000b

Var(A * O * S)

.000b

Var(D * S1 * O)

.090

Var(D * S1 * S)

-1.834a

Var(D * O * S)

.070

Var(S1 * O * S)

.338

Var(A * D * S1 * O)

.000b

Var(A * D * S1 * S)

.000b

Var(A * D * O * S)

.000b

Var(A * S1 * O * S)

.000b

Var(D * S1 * O * S)

-.276a

Var(A * D * S1 * O * S)

.000b

Var(Error)

.000b

Dependent Variable: mark

 Method: Minimum Norm Quadratic Unbiased Estimation (Weight = 1 for Random
Effects and Residual)

a. For the ANOVA and MINQUE methods, negative variance component estimates
may occur. Some possible reasons for their occurrence are: (a) the
specified model is not the correct model, or (b) the true value of the
variance equals zero.

b. This estimate is set to zero because it is redundant.

When I use this model:
lmer(mark~ (1|A)+(1+D)+(1|S)+(1|Q)+ S1+ (1|S1:D/S/A), R)

I got the follwowig error

Error: couldn't evaluate grouping factor A:(S:(S1:`:`)) within model frame:
try adding grouping factor to data frame explicitly if possible
In addition: Warning message:
In S1:`:` : numerical expression has 80 elements: only the first used;

Would you advise me what went wrong with the model.

Many thanks,
Rose
On Fri, Mar 10, 2017 at 11:59 PM, Ben Bolker <bbolker at gmail.com> wrote: