[R-sig-ME] Unidentifiable model in lmer
Thierry Onkelinx
thierry.onkelinx at inbo.be
Fri Sep 18 09:23:37 CEST 2015
The formula shouldn't be the problem. model.matrix() is clever enough
to handle this. Have a look at the examples below.
model.matrix(~ A + B + A * B, data= data.frame(A = 1, B = 1))
model.matrix(~ A + B + A * B + B + A:B + B:A, data= data.frame(A = 1, B = 1))
I suggest to give use a reproducible example of the problem so that we
can invesigate what when wrong.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
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
2015-09-18 7:23 GMT+02:00 Ché Lucero <chelucero op uchicago.edu>:
> I don't know if this is causing the problem you're seeing, but A*B expands
> to A + B + A:B, so your model right now is R ~ A + B + A + B + A:B + (1|S).
>
> On Thu, Sep 17, 2015 at 5:53 PM Takahiro Fushimi <taka.6765 op gmail.com>
> wrote:
>
>> Hi everyone,
>>
>> I have been working on a linear mixed effect model by using lmer()
>> function, but I got an error saying that the fitted model is not
>> identifiable.
>>
>> The data set includes the following variables:
>> y = a numeric variable
>> factorA = a 3-level categorical variable
>> factorB = a 2-level categorical variable
>> subjectID = subject id number. 2 measurements of y for each subject
>>
>> R code and output are as follows:
>> > (result <- lmer(y ~ factorA + factorB + factorA*factorB +
>> (1|subjectID)))
>> Linear mixed model fit by REML ['merModLmerTest']
>> Formula: y ~ factorA + factorB + factorA * factorB + (1 | subjectID)
>> REML criterion at convergence: 1928.966
>> Random effects:
>> Groups Name Std.Dev.
>> subjectID (Intercept) 4711
>> Residual 7688
>> Number of obs: 97, groups: subjectID, 51
>> Fixed Effects:
>> (Intercept) factorA1 factorA2 factorB1
>> factorA1:factorB1 factorA2:factorB1
>> 62411 -2700 -1124
>> -1037 1279 2482
>> > summary(result)
>> Model is not identifiable...
>> summary from lme4 is returned
>> some computational error has occurred in lmerTest
>> Linear mixed model fit by REML ['lmerMod']
>> Formula: y ~ factorA + factorB + factorA * factorB + (1 | subjectID)
>>
>> REML criterion at convergence: 1929
>>
>> Scaled residuals:
>> Min 1Q Median 3Q Max
>> -1.93423 -0.62611 0.01837 0.48887 2.73380
>>
>> Random effects:
>> Groups Name Variance Std.Dev.
>> subjectID (Intercept) 22194074 4711
>> Residual 59108495 7688
>> Number of obs: 97, groups: subjectID, 51
>>
>> Fixed effects:
>> Estimate Std. Error t value
>> (Intercept) 62411 2065 30.227
>> factorA1 -2700 3238 -0.834
>> factorA2 -1124 3008 -0.374
>> factorB1 -1037 2512 -0.413
>> factorA1:factorB1 1279 4013 0.319
>> factorA2:factorB1 2482 3642 0.681
>>
>> Correlation of Fixed Effects:
>> (Intr) fctrA1 fctrA2 fctrB1 fA1:B1
>> factorA1 -0.638
>> factorA2 -0.687 0.438
>> factorB1 -0.608 0.388 0.418
>> fctrA1:fcB1 0.381 -0.601 -0.262 -0.626
>> fctrA2:fcB1 0.420 -0.268 -0.606 -0.690 0.432
>> >
>>
>> Could anyone give me some idea of why this unidentifiability problem
>> happens and how to fix it?
>> Any help would be appreciated.
>>
>> Best regards,
>> Takahiro
>>
>> _______________________________________________
>> R-sig-mixed-models op r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models op r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list