[R-sig-ME] multicolinearity?

Douglas Bates bates at stat.wisc.edu
Mon Nov 29 22:36:17 CET 2010


On Mon, Nov 29, 2010 at 12:48 PM, Lucas Kid <statslearner at gmail.com> wrote:
> Thanks, Thierry, but I still receive the same error, albeit with fewer nan's
> in my verbose parameter output:

>> (m1 <- glmer(Correct ~ Months * ( Stimulus + Focus) + (1|Subject),
> family=binomial, data=mydataset, verbose=TRUE))
>  0:           nan: 0.0774439 -2.86253 0.309665  1.18527  2.32723  1.68874
>  2.42588  3.43032 -1.68977  2.91237      nan -0.169244 -0.232590 -0.212932
> -0.261447 -0.345893 0.0672266 -0.269589      nan
> Error in asMethod(object) : matrix is not symmetric [1,2]
> In addition: Warning message:
> In mer_finalize(ans) : gr cannot be computed at initial par (65)

Do you have missing cells in the data.  That is, are all combinations
of Months:Stimulus and Months:Focus present in the data?

Missing cells are one of the conditions that lead to rank-deficient
model matrices for the fixed-effects.  In functions like lm and glm
this is handled by a special pivoting scheme
based on very old code.  (It is ironic that the most common linear
algebra operation in R, determining least squares fits, does not
benefit from accelerated BLAS, because it is based on Linpack, not
Lapack.)  The code in lmer/glmer doesn't use such a scheme and I
suspect that is the cause of the nan's in the verbose output.

> vs
>
>> (m1 <- glmer(Correct ~ Months * Stimulus * Focus + (1|Subject),
> family=binomial, data=mydataset, verbose=TRUE))
>  0:           nan: 0.0774439 -2.86253 0.309665  1.18527  2.32723  1.68874
>  2.42588  3.43032 -1.68977  2.91237      nan -0.169244 -0.232590 -0.212932
> -0.261447 -0.345893 0.0672266 -0.269589      nan      nan      nan      nan
>     nan      nan      nan      nan      nan      nan      nan      nan
>  nan      nan      nan
> Error in asMethod(object) : matrix is not symmetric [1,2]
> In addition: Warning message:
> In mer_finalize(ans) : gr cannot be computed at initial par (65)
>
> Thanks,
>
> Luke
>
> On Mon, Nov 29, 2010 at 11:09 AM, ONKELINX, Thierry <
> Thierry.ONKELINX at inbo.be> wrote:
>
>> Dear Lucas,
>>
>> It will be probably sufficient to drop the Focus:Stimulus interaction.
>>
>> m1f <- glmer(Correct ~ Months*(Focus + Stimulus) + (1|Subject),
>> family=binomial, data=mydataset)
>>
>> You will be some NA values because stimulus is nested in focus.
>>
>> Best regards,
>>
>> Thierry
>>
>> ------------------------------------------------------------------------
>> ----
>> ir. Thierry Onkelinx
>> Instituut voor natuur- en bosonderzoek
>> team Biometrie & Kwaliteitszorg
>> Gaverstraat 4
>> 9500 Geraardsbergen
>> Belgium
>>
>> Research Institute for Nature and Forest
>> team Biometrics & Quality Assurance
>> Gaverstraat 4
>> 9500 Geraardsbergen
>> Belgium
>>
>> tel. + 32 54/436 185
>> Thierry.Onkelinx at inbo.be
>> 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
>>
>>
>> > -----Oorspronkelijk bericht-----
>> > Van: r-sig-mixed-models-bounces at r-project.org
>> > [mailto:r-sig-mixed-models-bounces at r-project.org] Namens Lucas Kid
>> > Verzonden: maandag 29 november 2010 16:27
>> > Aan: r-sig-mixed-models at r-project.org
>> > Onderwerp: [R-sig-ME] multicolinearity?
>> >
>> > Mixed modelers,
>> >
>> > I have a dataset (mydataset) where subjects' (Subject)
>> > responses (Correct) to a stimulus (Stimulus) was tested over
>> > time (Months). There were 8 stimuli, 2 of which had focus A
>> > and 6 had focus B (Focus).  At each time point, subjects were
>> > tested multiple times for each stimuli.  Subject, Stimulus,
>> > and Focus are all factors.
>> >
>> > I have run model as follows:
>> >
>> > (m1 <- glmer(Correct ~ Months*Stimulus + (1|Subject), family=binomial,
>> > data=mydataset))
>> > (m2 <- glmer(Correct ~ Months*Stimulus + (1|Subject) + (0 + Months
>> > |Subject), family=binomial, data=mydataset))
>> > (m3 <- glmer(Correct ~ Months*Stimulus + (1 + Months
>> > |Subject), family=binomial, data=mydataset))
>> > (m4 <- glmer(Correct ~ Months*Stimulus + (1 + Months +
>> > Stimulus |Subject), family=binomial, data=mydataset))
>> > (m5 <- glmer(Correct ~ Months*Stimulus + (1 + Months +
>> > Stimulus + Months * Stimulus |Subject), family=binomial,
>> > data=mydataset))
>> >
>> > I would like to test Focus to see if, when controlling for
>> > Focus, the effect of Stimulus goes away.
>> >
>> > (m1f <- glmer(Correct ~ Months*Stimulus*Focus + (1|Subject),
>> > family=binomial, data=mydataset))
>> >
>> > However, I get the following error:
>> >
>> > Error in asMethod(object) : matrix is not symmetric [1,2] In
>> > addition: Warning message:
>> > In mer_finalize(ans) : gr cannot be computed at initial par (65)
>> >
>> > I believe this is a case of multicolinearity between Focus
>> > and Stimulus.
>> > Would that be a correct assumption?  What options do I have
>> > in order to examine the relationship between Correct and
>> > Stimulus/Focus in a mixed-effects situation.
>> >
>> > I'm using version 0.999375-35 of lme4.
>> >
>> > Thanks!
>> >
>> > Luke
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > R-sig-mixed-models at r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> >
>>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at 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