[R-sig-ME] singularity issue in lmer
Thierry Onkelinx
th|erry@onke||nx @end|ng |rom |nbo@be
Wed Apr 17 20:04:13 CEST 2019
Dear Catalina,
Your model is too complex for the data. The NaN values in the output are a
hint. I see two solutions. 1) collect more data. 2) simplify your model.
Ttest if lmer(Rate ~ f_Order*f_Valence + f_Attribute + (1 | Subject),
data = data) works.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be
///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////
<https://www.inbo.be>
Op wo 17 apr. 2019 om 18:13 schreef Catalina Ratala <c.ratala using donders.ru.nl
>:
> Dear List,
>
> I’m trying to make the following model converge without warnings, using
> the lme4 package:
>
> Variables: Order (3 levels), Valence (2 levels), and Attribute (2 levels)
> are all factors, Rate is the DV, continuous, 1-10 range.
>
> model_lme4 <- lmer(Rate ~ f_Order*f_Valence + f_Attribute + (1 +
> f_Order*f_Valence | Subject), data = data)
>
> summary(model_lme4)
>
> Linear mixed model fit by REML ['lmerMod']
> Formula: Rate ~ f_Order * f_Valence + f_Attribute + (1 + f_Order *
> f_Valence |
> Subject)
> Data: data
>
> REML criterion at convergence: 12167.1
>
> Scaled residuals:
> Min 1Q Median 3Q Max
> -5.0966 -0.5745 -0.0331 0.5851 5.1733
>
> Random effects:
> Groups Name Variance Std.Dev. Corr
>
> Subject (Intercept) 0.135654 0.36831
>
> f_Order1 0.002681 0.05178 -0.66
>
> f_Order2 0.003578 0.05982 0.31 -0.92
>
> f_Valence1 0.343519 0.58611 0.35 -0.01 -0.17
>
> f_Order1:f_Valence1 0.009916 0.09958 -0.09 -0.49 0.66 0.36
>
> f_Order2:f_Valence1 0.001073 0.03276 0.01 0.02 -0.02 -0.88
> -0.70
> Residual 0.974439 0.98714
>
> Number of obs: 4237, groups: Subject, 29
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) 4.8820728 0.0700895 69.655
> f_Order1 -0.0005486 0.0235150 -0.023
> f_Order2 0.0220543 0.0241765 0.912
> f_Valence1 -1.3284410 0.1099083 -12.087
> f_Attribute1 0.0401858 0.0221600 1.813
> f_Attribute2 -0.1078952 0.0217247 -4.966
> f_Order1:f_Valence1 -0.0157678 0.0283515 -0.556
> f_Order2:f_Valence1 0.0552990 0.0223037 2.479
>
> Correlation of Fixed Effects:
> (Intr) f_Ord1 f_Ord2 f_Vln1 f_Att1 f_Att2 f_O1:_
> f_Order1 -0.263
> f_Order2 0.138 -0.578
> f_Valence1 0.340 -0.005 -0.077
> f_Attribut1 0.014 -0.014 -0.024 -0.001
> f_Attribut2 0.000 -0.007 0.023 0.007 -0.531
> f_Ordr1:_V1 -0.057 -0.131 0.200 0.234 0.016 -0.008
> f_Ordr2:_V1 0.001 0.001 -0.002 -0.237 -0.019 0.027 -0.488
> convergence code: 0
> boundary (singular) fit: see ?isSingular
>
>
>
> My problem is that I get this warning message saying that the model is
> singular:
>
> boundary (singular) fit: see ?isSingular
>
>
>
> I used the function isSingular() (package lme4) to test whether actually
> the warning is valid. It returned TRUE as an outcome, meaning the
> parameters are on the boundary of the feasible parameter space, and
> variances of one or more linear combinations of effects are (close to) zero.
>
> I also used allfits() function (afex package) to check whether different
> optimizers give the same error, which was the case for all the optimizers
> with which the model converged.
>
> Following different guidelines presented in the literature I tried:
>
> a) to remove the covariance between random effects, by running the
> following model:
>
> model_nocov <- lmer(Rate ~ f_Order*f_Valence + f_Attribute + (0 +
> f_Order*f_Valence | Subject) + (1 | Subject), data = data);
>
> Linear mixed model fit by REML ['lmerMod']
> Formula: Rate ~ f_Order * f_Valence + f_Attribute + (0 + f_Order *
> f_Valence |
> Subject) + (1 | Subject)
> Data: data
>
> REML criterion at convergence: 11707
>
> Scaled residuals:
> Min 1Q Median 3Q Max
> -5.1014 -0.5736 -0.0361 0.5815 5.1984
>
> Random effects:
> Groups Name Variance Std.Dev. Corr
>
> Subject f_Orderfirst 0.000000 0.00000
>
> f_Ordersecond 0.009510 0.09752 NaN
>
> f_Orderthird 0.004304 0.06561 NaN 0.66
>
> f_Valence1 0.105713 0.32514 NaN 0.74 0.68
>
> f_Order1:f_Valence1 0.009706 0.09852 NaN 0.83 0.13 0.49
>
> f_Order2:f_Valence1 0.001249 0.03534 NaN -0.52 -0.14 -0.82
> -0.60
> Subject.1 (Intercept) 0.127141 0.35657
>
> Residual 0.973996 0.98691
>
> Number of obs: 4087, groups: Subject, 28
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) 4.873808 0.069807 69.818
> f_Order1 -0.005478 0.023784 -0.230
> f_Order2 0.028555 0.024044 1.188
> f_Valence1 -1.420611 0.063388 -22.411
> f_Attribute1 0.048127 0.022588 2.131
> f_Attribute2 -0.120467 0.022118 -5.447
> f_Order1:f_Valence1 -0.016950 0.028729 -0.590
> f_Order2:f_Valence1 0.057331 0.022845 2.510
>
> Correlation of Fixed Effects:
> (Intr) f_Ord1 f_Ord2 f_Vln1 f_Att1 f_Att2 f_O1:_
> f_Order1 -0.054
> f_Order2 0.045 -0.548
> f_Valence1 0.103 -0.301 0.255
> f_Attribut1 0.015 -0.015 -0.025 -0.001
> f_Attribut2 0.000 -0.004 0.019 0.010 -0.533
> f_Ordr1:_V1 0.053 -0.154 0.260 0.306 0.018 -0.009
> f_Ordr2:_V1 -0.016 0.046 -0.070 -0.233 -0.018 0.028 -0.477
> convergence code: 0
> boundary (singular) fit: see ?isSingular
>
>
>
>
> b) to remove outlier cases;
>
> However, I still got the same warning and the is.singular() indicated that
> the warnings were to be considered (TRUE).
>
> Moreover, I realized that in this case, what causes the problem are the
> correlations between the levels of the factor ORDER, which is the one
> related to my main hypothesis and therefore, I cannot exclude its random
> slope from the model, as I am interested in its statistical significance
> and, thus, getting a p-value for it.
>
> I would like to ask for advice on what I can do to make the model converge
> without warnings. Is there anything that could be done with the levels of
> the factor (Order), that seem to be causing the problem? Any other
> suggestion is, of course, welcomed.
>
>
>
> Thank you in advance for your time and help!
>
>
>
> Best,
>
> Catalina
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list