[R-lang] trouble with mixed-model
Roger Levy
rlevy at ucsd.edu
Mon Jul 30 15:37:40 PDT 2007
Francisco Torreira wrote:
> Hello,
>
> I am fitting a mixed model that prompts the following warning messages:
>
> Warning messages:
> 1: Estimated variance-covariance for factor 'spk' is singular
> in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance =
> 1.49011611938477e-08,
> 2: nlminb returned message function evaluation limit reached without
> convergence (9)
> in: `LMEoptimize<-`(`*tmp*`, value = list(maxIter = 200L, tolerance =
> 1.49011611938477e-08,
>
> Although the model is fitted, R does not let me run simulations on it
> with mcmcamp(). This is the error message I get:
>
>> mcmcsamp(full, n=10000)
> Error: inconsistent degrees of freedom and dimension
> Error in t(.Call(mer_MCMCsamp, object, saveb, n, trans, verbose, deviance)) :
> error in evaluating the argument 'x' in selecting a method for function 't
>
> The model was:
> full <- lmer(an ~ type + (1 + type | spk) - 1)
>
> My design included 5 speakers (spk) and 5 utterance types (type). For
> each combination of speaker and utterance type there were
> approximately 20 repetitions. If I fit a more reduced model with no
> random effect for type within speakers, as in lmer(an~type+(1|spk)),
> no warning appears. Here is the summary of my full model:
>
> Linear mixed-effects model fit by REML
> Formula: an ~ 1 + type + (1 + type | spk) - 1
> AIC BIC logLik MLdeviance REMLdeviance
> 4663 4747 -2311 4653 4623
> Random effects:
> Groups Name Variance Std.Dev. Corr
> spk (Intercept) 1568.3 39.601
> typee 1037.3 32.208 -0.745
> typeg 1303.7 36.107 -0.659 0.946
> typei 1780.9 42.200 -0.778 0.976 0.864
> typel 757.4 27.521 -0.725 0.839 0.826 0.865
> Residual 598.8 24.470
> number of obs: 498, groups: spk, 5
>
> Fixed effects:
> Estimate Std. Error t value
> typea 78.87 17.88 4.410
> typee 18.49 12.13 1.524
> typeg 50.86 14.26 3.566
> typei 11.42 12.48 0.915
> typel 14.94 12.46 1.199
>
> Correlation of Fixed Effects:
> typea typee typeg typei
> typee 0.570
> typeg 0.491 0.898
> typei 0.240 0.851 0.722
> typel 0.699 0.758 0.739 0.622
>
> I wonder if the high correlations correlations between several
> utterance types and the intercept in the random part of the model
> aren't causing all this trouble. I would appreciate any comment on the
> warnings.
Dear Francisco,
I think many of us have experienced problems with singular estimated
variance-covariance matrices with lmer. In some cases I am certain that
the problem arises from near-perfect correlations between random
effects, but I personally have not yet come to a deep understanding of
what conditions can give rise to these near-perfect correlations.
A couple of possibilities: first, you can remove the
intercept/utterance-type correlation term from your model by
respecifying it as
an ~ type + (1 | spk) + (0 + type | spk) - 1
and see whether this eliminates the singularity. In your case, however,
it seems like the strongest correlations are type pairs e&g and e&i.
Perhaps you might try recoding utterance type (e.g., merge e & i since
their coefficients seem similar anyway)?
Best & let us know if this helps,
Roger
--
Roger Levy Email: rlevy at ucsd.edu
Assistant Professor Phone: 858-534-7219
Department of Linguistics Fax: 858-534-4789
UC San Diego Web: http://ling.ucsd.edu/~rlevy
More information about the R-lang
mailing list