[R-sig-ME] Nested fixed factors in glmer: Error in mer_finalize(ans) : Downdated X'X is not positive definite, 1.
Rolf Turner
r.turner at auckland.ac.nz
Fri Mar 1 02:04:26 CET 2013
Perhaps I am just obtuse (there are those who would say there is
no "perhaps" about it) but it seems to me that nesting of fixed effects
makes no sense.
In the example given below you have in effect a ***single*** factor
with six levels: a.1, a.2, b.3, b.4, c.5, c.6. This really means that
you just have the second "nested" factor with levels 1, 2, 3, 4, 5, 6.
So just supply the second factor to the formula in the call to glmer()
and forget about the first factor entirely. It is redundant when the
second factor is supplied.
You *can* use the formula y ~ f1/f2 or equivalently y ~ f1 + f1:f2
but you'll find that you wind up getting 12 coefficient estimates, six
of which are "NA". The values of the six non-NA coefficients will
be identical with values of the six coefficient estimate that you get
from y ~ f2.
cheers,
Rolf Turner
On 03/01/2013 03:27 AM, PALACIO BLASCO, SARA wrote:
> Hi Hugo,
>
> Thanks for your e-mails. The structure of my data is not the one in
> your examples but:
>
> Factor 1: a,b,c
> factor 2: 1,2,3,4,5,6
>
> combination:
> a.1, a.2, b.3, b.4, c.5, c.6
>
> note factor 2 is nested within factor 1, so that not all levels of
> factor 2 are in every level of factor 1.
> Hence I do not have a full factorial or crossed design but a
> hierarchical one.
>
> My question: How can I include such a design in glmer?
>
> Cheers,
>
> Sara
>
> Hugo.Mildenberger at web.de escribió:
>
>> On Thu, 28 Feb 2013 14:27:36 +0100
>> "PALACIO BLASCO, SARA" <s.palacio at ipe.csic.es> wrote:
>>
>>> Maybe this is a trivial question but: how can I specify a nested
>>> structured of fixed factors in glmer?
>>>
>>> I still haven't found a way to solve the issues explained in my
>>> previous e-mail.
>>
>>
>> Sara,
>>
>> may be this fits your needs?
>>
>>> a<-factor(c('a','b','c','d'))
>>> b<-factor(c('1','2'))
>>> interaction(a,b)
>> [1] a.1 b.2 c.1 d.2
>> Levels: a.1 b.1 c.1 d.1 a.2 b.2 c.2 d.2
>>
>>
>> Best
>
> _______________________________________________
> 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