[R-sig-ME] singularity issue in lmer

Thierry Onkelinx th|erry@onke||nx @end|ng |rom |nbo@be
Tue Apr 23 11:33:07 CEST 2019


Dear Catalina,

This will depend on your assumptions. f_Order + (1|Subject) assumes an
overall effect of f_Order (constant over all subjects) and an overall
effect of subject (constant over all f_Order). f_Order + (f_Order|Subject)
allows for both an overall effect of f_Order and a different effect for
each subject. Another options is f_Order + (1|Subject)  +
(1|Subject:f_Order). The difference between the last to is the correlation
structure among the random effects.

Whether f_Order + (1|Subject) is conceptually too simple, depends on domain
knowledge. If domain knowledge dictate at least f_Order +
(f_Order|Subject), then you should collect enough data to support a model
with such complexity.

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 ma 22 apr. 2019 om 12:29 schreef Catalina Ratala <c.ratala using donders.ru.nl
>:

> Dear Thierry,
>
> Thank you very much for your reply!
> Indeed, i tried to simplify the model in different ways - the ones that
> run without errors are the ones where f_Order is not modelled as a random
> slope. So, the one you suggested:
>
> lmer(Rate ~ f_Order*f_Valence +  f_Attribute + (1 | Subject), data = data)
>
> works, without any errors.
> However, won’t the p-values I get for this model be inflated, since I
> don’t have random effects for any of the fixed factors in which I am
> interested in (f_Order and f_Valence)?
> Are these p-values reliable?
>
> best,
> Catalina
>
>
> On 17 Apr 2019, at 21:04, Thierry Onkelinx <thierry.onkelinx using inbo.be>
> wrote:
>
> 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
>>
>
> Cătălina E Rățală MSc
> PhD candidate
>
>
>
> ROTTERDAM SCHOOL OF MANAGEMENT
> ERASMUS UNIVERSITY
> DEPARTMENT OF MARKETING MANAGEMENT
>
> postal address: P.O. Box 1738; 3000 DR Rotterdam
> email: cratala using rsm.nl <touburg using rsm.nl>
> http://www.rsm.nl/people/catalina-ratala/
>
> DONDERS INSTITUTE FOR BRAIN, COGNITION & BEHAVIOUR
> DONDERS CENTRE FOR COGNITIVE NEUROIMAGING
>
> visiting address: Kapittelweg 29, Room 2.262n, 6525 EN, Nijmegen
> postal address: P.O. box 9101, 6500 HB Nijmegen
> tel: +31 - (0)24-3668388
> email: c.ratala using donders.ru.nl <c.ratala using donders.ru.nl>
> http://www.ru.nl/people/donders/ratala-c/
> http://www.decisionneurosciencelab.com/people/
>
>
>
>
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list