[R-sig-ME] lmer fits model with counter-intuitive nesting?

Björn Lindström Bjorn.Lindstrom at ki.se
Mon Aug 5 23:18:44 CEST 2013


Hi, yea I totally agree.

Here is the xtabs output. Looks correct  right?

> xtabs(~Subject+Group, data=data)
       Group
Subject      A 	          B
     1            70            0
     2             0           70
     3            70            0
     5            70            0
     6             0           70
     7            70            0
     8             0           70
     9            70            0
     10            0           70
     11           70            0
     12            0           70
     13           70            0
     14            0           70
     15           70            0
     16            0           70
     17           70            0
     18            0           70
     19            0           70
     20           70            0
     21            0           70
     22           70            0
     24           70            0
     25            0           70
     26           70            0
     27            0           70
     28           70            0
     29            0           70
     30           70            0

/Björn
________________________________________
Från: r-sig-mixed-models-bounces at r-project.org [r-sig-mixed-models-bounces at r-project.org] för Jake Westfall [jake987722 at hotmail.com]
Skickat: den 5 augusti 2013 22:34
Till: r-sig-mixed-models at r-project.org
Ämne: Re: [R-sig-ME] lmer fits model with counter-intuitive nesting?

Hi Bjorn,

Of course my first thought is that there is a coding error in the dataset. Would be curious to see the output from xtabs(~Subject+Group, data=data) to verify the structure is what it should be...

Other than that I don't really have any ideas.

Jake

From: Bjorn.Lindstrom at ki.se
To: r-sig-mixed-models at r-project.org
Date: Mon, 5 Aug 2013 16:20:59 +0000
Subject: [R-sig-ME] lmer fits model with counter-intuitive nesting?

Dear all, I am a new member (although long time reader) to the list.

My motivation for finally joining is to clearify a (for me) very confusing issue. I apologize beforehand if I have missed any standard or crucial information.

I am analyzing data from a learning experiment with the following structure:

30 subjects with 70 binary resposes each. These respones are ordered by Phase(Factor w/ 2 levels) within subject, where each Phase level is associated with 35 responses.
The subjects are nested within Group(Factor w/ 2 levels), but have an unique index (1:30).

I am interested in the Phase*Group interaction. My orginal model was just lmer(response ~ Group*Phase+(Phase|Subject),family=binomial(link="logit"),data=data), since this seem to be the logical and standard formulation for models with both within and beteen -subjects predictors.

For various obscure reasons, I fitted lmer(response ~ Group*Phase+(Phase*Group|Subject)), which I expected to fail since no Subject belong to both groups (I double checked ...).
However, lmer gladly accepted this and gave by-subject random effects for both the Group effect and the Phase*Groupp interaction.

As far as I see, this situation is identical to trying to fit random slopes for Gender for each subject....

How is this possible? What am i missing?

kind regards
Björn

        [[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]]




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