Mixed Log Model using R

9 views
Skip to first unread message

carpoll

unread,
Feb 17, 2008, 8:33:11 AM2/17/08
to CorpLing with R
Hi All,

I am trying to run a Mixed Log Analysis on the occurrence of an
epenthetic vowel (The dependent variable is categorical (Occur)). The
independent variables are all categorical and it looks something like
this:

Subj Item Occur Placeartic Stress Voicing Vowel Order Mannerartic
Homorg
s1 14 0 3 2 1 1 2 1 0
s2 14 1 3 2 1 1 2 1 0
s3 14 0 3 2 1 1 2 1 0
s4 14 1 3 2 1 1 1 1 0
s5 14 0 3 2 1 1 2 1 0
s6 14 0 3 2 1 1 1 1 0
s7 14 0 3 2 1 1 2 1 0

The coding model I am using is
mlmcr <-lmer(Occur ~ (1 | Subject) + (1 | Item) * Placeart * Voicing *
Stress * Vowel * Order * Mannerartic * Homorg, data = numcr)

I get an error message saying that

"Error in lmer(Occur ~ (1 | Subject) + (1 | Item) * Placeart * :
Leading minor of order 11 in downdated X'X is not positive definite"

Does anyone know what exactly the error message refers to?
Are the variables 'Item' and 'Subject' coded as 'factors'
Thanks for your time. I'd appreciate help.

Sincerely,

Carlos

Stefan Th. Gries

unread,
Feb 17, 2008, 12:52:26 PM2/17/08
to corplin...@googlegroups.com
Hi Carlos

I have not come across that error myself (and have no clue what it
means) but there is a thread on this on the general R-help list which
you may find useful:
<http://tolstoy.newcastle.edu.au/R/help/06/06/29088.html> and
following.

> Are the variables 'Item' and 'Subject' coded as 'factors'

That depends on how you enter them: if you do the "read.table"
standard kind of input, then Subject will be a factor and Item will
not be (since your Item column seems to contain numbers only), which
is probably not what you want and that's something I'd play around
with first. If you set as.is or colClasses differently from the
default, then we can't say that without seeing your actual line and
data.

HTH at least a bit,
STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries
-----------------------------------------------

Austin Frank

unread,
Feb 17, 2008, 3:53:30 PM2/17/08
to corplin...@googlegroups.com
On Sun, Feb 17 2008, carpoll wrote:

> The coding model I am using is

> mlmcr <-lmer(Occur ~ (1 | Subject) + (1 | Item) * Placeart * Voicing *
> Stress * Vowel * Order * Mannerartic * Homorg, data = numcr)

This is a very very complex model. Do you have theories about a 7 way
interaction? You might want to try starting with a simpler model that
uses + instead of *, and then selectively add interactions where you
have specific predictions about non-additive effects.

> "Error in lmer(Occur ~ (1 | Subject) + (1 | Item) * Placeart * :
> Leading minor of order 11 in downdated X'X is not positive definite"
>
> Does anyone know what exactly the error message refers to?

While I still don't know the exact meaning of the error message, I can
tell you that practically speaking it means that this means that the
model won't be able to converge as currently specified. My best stab at
a more technical explanation is that this happens a lot if there's not
much variance in one of the factors or interaction terms being
investigated. As mentioned above, you've got a lot of interaction
terms, and so it's not surprising that the cells are sparsely populated
and there's not much variance in the sample.

> Are the variables 'Item' and 'Subject' coded as 'factors'

You can check this by running

--8<---------------cut here---------------start------------->8---
class(numcr$Subject) # or
is.factor(numcr$Subject)
--8<---------------cut here---------------end--------------->8---

If the first returns "factor" or the second returns "TRUE", then your
random effects are coded as factors. If they aren't and you want them
to be, try

--8<---------------cut here---------------start------------->8---
numcr$Subject <- as.factor(numcr$Subject) # or
numcr$Subject <- factor(numcr$Subject, levels=c(...), labels=c(...))
--8<---------------cut here---------------end--------------->8---

where the "levels" and "labels" arguments give you more flexibility in
specifying how the current integer representation will be converted into
a factor.

HTH,
/au

--
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

Austin Frank

unread,
Feb 17, 2008, 4:14:26 PM2/17/08
to corplin...@googlegroups.com
On Sun, Feb 17 2008, carpoll wrote:

> I am trying to run a Mixed Log Analysis on the occurrence of an
> epenthetic vowel (The dependent variable is categorical (Occur)). The
> independent variables are all categorical and it looks something like
> this:

Another note: if Occur is dichotomous, then you want to be using mixed
logit models. In older versions of lme4 this is done by adding an
argument of family="binomial" to the call to lmer(). In current
development versions of lme4, this is done by using the function
glmer(), again with an argument of family="binomial" after the model
specification. If Occur is polytomous, lme4 won't be able to handle
this data set. Apparently the software packages called AD Model Builder
and MLWin can handle multi-level modeling with mixed effects and
multinomial dependent variables, though I have yet to use either one.

Good luck,

carpoll

unread,
Mar 16, 2008, 3:16:44 AM3/16/08
to CorpLing with R
Hi again,
Thanks so much Stefan and Austin for your help. Now the summary I get
from the mixed-log model is the following

> ocucr <- lmer(Occurrence ~ Placeartic + Stress + Voicing + (1 | Subject) + (1 | Item), data = occr, family = "binomial")
> summary(ocucr)
Generalized linear mixed model fit using Laplace
Formula: Occurrence ~ Placeartic + Stress + Voicing + (1 | Subject) +
(1 | Item)
Data: occr
Family: binomial(logit link)
AIC BIC logLik deviance
181.7 205.4 -82.84 165.7
Random effects:
Groups Name Variance Std.Dev.
Item (Intercept) 5.000e-10 2.2361e-05
Subject (Intercept) 2.911e-01 5.3954e-01
number of obs: 144, groups: Item, 18; Subject, 8

Estimated scale (compare to 1 ) 0.9668724

Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.69973 0.49029 1.4272 0.1535
Placeartic[T.coron] 0.33908 0.47455 0.7145 0.4749
Placeartic[T.dors] -0.10551 0.45528 -0.2317 0.8167
Stress[T.pret] -0.28768 0.43419 -0.6626 0.5076
Stress[T.tonic] 0.96020 0.50430 1.9040 0.0569 .
Voicing[T.voiced] -0.06377 0.38035 -0.1677 0.8669
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
(Intr) Plcrtc[T.c] Plcrtc[T.d] Strss[T.p] Strss[T.t]
Plcrtc[T.c] -0.453
Plcrtc[T.d] -0.471 0.487
Strss[T.pr] -0.459 -0.007 0.002
Strss[T.tn] -0.395 0.016 -0.006 0.445
Vcng[T.vcd] -0.392 -0.002 0.001 0.002 -0.004
>


The problem I have is that lmer estimates a coefficient for each of
the levels in the fixed factors. In addition, I was told that the
model is not reliable and the high coefficients of correlation of the
Fixed Effects mean that there is collinearity. Can you please suggest
a source that deals with how to read the model summary? I understand
that AIC indicates the general fit of the model, but at what point is
it considered to be a fit model?

Thanks so much for your time.
Best Regards,
Carlos

Stefan Th. Gries

unread,
Mar 17, 2008, 3:10:01 PM3/17/08
to corplin...@googlegroups.com
Hi

> Can you please suggest a source that deals with how to read the model summary?

The best sources I know of off the top of my head are Crawley's (2007)
R book, Baayen's (2008) Analyzing Linguistic Data, Faraway (2006),
<http://www.mpi.nl/world/persons/private/baayen/publications/baayenDavidsonBates.pdf>,
and stuff from T. Florian Jaeger's website at
<http://www.bcs.rochester.edu/people/fjaeger/presentations.html> and
<http://www.bcs.rochester.edu/people/fjaeger/tutorials.html>.

HTH,

Reply all
Reply to author
Forward
0 new messages