Skip to main content
edited body
Source Link
Rick Hass
  • 811
  • 4
  • 16

TL/DR: It helps to write down the model in hierarchical notation. This way it becomes clear what slopes are randomly varying. Only level-1 variables can have randomly varying slopes in a 2-level model (as this one). So here I discuss what I think is your intent.

For simplicity I'm not discussing the weights since they enter into the estimation, not the model construction. Also, we'll use the regular notation of $y_{ij}$ even though your outcome is on the logit scale, it's still a normal multilevel model.

In the syntax for your first model you have:

1000ms <- lmer(elog ~ tense.ct*t + (1|ParticipantName), data=bySubj1000, weights=1/wts)

This is the following model:

$$ y_{ij} = \beta_{0j} + \beta_{1j} \times Tense + \beta_{2j} \times Time + \beta_{3j} \times Tense*Time + e_{ij} $$

and at level 2 (participant level):

$$ \beta_{0j} = \gamma_{00} + u_{0j} \\ \beta_{1j} = \gamma_{10} \\ \beta_{2j} = \gamma_{20} \\ \beta_{3j} = \gamma_{30} $$

This is a straightforward model with random intercepts for each Participant. You asked about unbalanced groups, which isn't too much of a problem in GLME model setting. You don't want the groups too unbalanced but it's not like repeated measures ANOVA where the groups must have identical sizes.

Now to the effect of Language. This is a level-2 (participant) variable, so it is entered as a fixed effect as in the first of your models b1000msa1000ms. However, it seems you'd like to test a cross-level interaction between language and tense. First, you should verify that the tense effect varies substantially from participant to participant. This would be akin to changing the equation for $\beta_{1j}$ above to

$$ \beta_{1j} = \gamma_{10} + u_{0j} $$

And your model syntax becomes:

1000ms <- lmer(elog ~ tense.ct*t + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The results of this model will illustrate whether there is variability in the tense slopes. If so, you can model that variability with an interaction between tense and language. Note here that the link you provide uses all possible interactions, which may be a part of the particular method, but seems superfluous. To only insert the fixed effect of Language and the cross level interaction, your the $\beta_{ij}$ equation changes to:

$$ \beta_{1j} = \gamma_{10} + \gamma_{11}\times Language + u_{0j} $$

and your syntax to:

1000ms <- lmer(elog ~ tense.ct*t + L1_L2.ct + L1_L2.ct:tense.ct + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The remaining options you have insert variables into the random-effects part of the formula that seem to be inappropriate based on your design. Essentially, any variable that is inserted to the left of the | ParticipantName is flagging a randomly varying coefficient. So that's a 1 if only the intercepts at level 2 are varying. Then, you add variables that you think have random slopes (not often more than 1 or two), and these need to be level-1 variables. Language is a participant variable (not a characteristic of a trial) so it stays as a fixed effect. You model the interaction of language and tense to get the effect you're looking for.

TL/DR: It helps to write down the model in hierarchical notation. This way it becomes clear what slopes are randomly varying. Only level-1 variables can have randomly varying slopes in a 2-level model (as this one). So here I discuss what I think is your intent.

For simplicity I'm not discussing the weights since they enter into the estimation, not the model construction. Also, we'll use the regular notation of $y_{ij}$ even though your outcome is on the logit scale, it's still a normal multilevel model.

In the syntax for your first model you have:

1000ms <- lmer(elog ~ tense.ct*t + (1|ParticipantName), data=bySubj1000, weights=1/wts)

This is the following model:

$$ y_{ij} = \beta_{0j} + \beta_{1j} \times Tense + \beta_{2j} \times Time + \beta_{3j} \times Tense*Time + e_{ij} $$

and at level 2 (participant level):

$$ \beta_{0j} = \gamma_{00} + u_{0j} \\ \beta_{1j} = \gamma_{10} \\ \beta_{2j} = \gamma_{20} \\ \beta_{3j} = \gamma_{30} $$

This is a straightforward model with random intercepts for each Participant. You asked about unbalanced groups, which isn't too much of a problem in GLME model setting. You don't want the groups too unbalanced but it's not like repeated measures ANOVA where the groups must have identical sizes.

Now to the effect of Language. This is a level-2 (participant) variable, so it is entered as a fixed effect as in the first of your models b1000ms. However, it seems you'd like to test a cross-level interaction between language and tense. First, you should verify that the tense effect varies substantially from participant to participant. This would be akin to changing the equation for $\beta_{1j}$ above to

$$ \beta_{1j} = \gamma_{10} + u_{0j} $$

And your model syntax becomes:

1000ms <- lmer(elog ~ tense.ct*t + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The results of this model will illustrate whether there is variability in the tense slopes. If so, you can model that variability with an interaction between tense and language. Note here that the link you provide uses all possible interactions, which may be a part of the particular method, but seems superfluous. To only insert the fixed effect of Language and the cross level interaction, your the $\beta_{ij}$ equation changes to:

$$ \beta_{1j} = \gamma_{10} + \gamma_{11}\times Language + u_{0j} $$

and your syntax to:

1000ms <- lmer(elog ~ tense.ct*t + L1_L2.ct + L1_L2.ct:tense.ct + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The remaining options you have insert variables into the random-effects part of the formula that seem to be inappropriate based on your design. Essentially, any variable that is inserted to the left of the | ParticipantName is flagging a randomly varying coefficient. So that's a 1 if only the intercepts at level 2 are varying. Then, you add variables that you think have random slopes (not often more than 1 or two), and these need to be level-1 variables. Language is a participant variable (not a characteristic of a trial) so it stays as a fixed effect. You model the interaction of language and tense to get the effect you're looking for.

TL/DR: It helps to write down the model in hierarchical notation. This way it becomes clear what slopes are randomly varying. Only level-1 variables can have randomly varying slopes in a 2-level model (as this one). So here I discuss what I think is your intent.

For simplicity I'm not discussing the weights since they enter into the estimation, not the model construction. Also, we'll use the regular notation of $y_{ij}$ even though your outcome is on the logit scale, it's still a normal multilevel model.

In the syntax for your first model you have:

1000ms <- lmer(elog ~ tense.ct*t + (1|ParticipantName), data=bySubj1000, weights=1/wts)

This is the following model:

$$ y_{ij} = \beta_{0j} + \beta_{1j} \times Tense + \beta_{2j} \times Time + \beta_{3j} \times Tense*Time + e_{ij} $$

and at level 2 (participant level):

$$ \beta_{0j} = \gamma_{00} + u_{0j} \\ \beta_{1j} = \gamma_{10} \\ \beta_{2j} = \gamma_{20} \\ \beta_{3j} = \gamma_{30} $$

This is a straightforward model with random intercepts for each Participant. You asked about unbalanced groups, which isn't too much of a problem in GLME model setting. You don't want the groups too unbalanced but it's not like repeated measures ANOVA where the groups must have identical sizes.

Now to the effect of Language. This is a level-2 (participant) variable, so it is entered as a fixed effect as in the first of your models a1000ms. However, it seems you'd like to test a cross-level interaction between language and tense. First, you should verify that the tense effect varies substantially from participant to participant. This would be akin to changing the equation for $\beta_{1j}$ above to

$$ \beta_{1j} = \gamma_{10} + u_{0j} $$

And your model syntax becomes:

1000ms <- lmer(elog ~ tense.ct*t + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The results of this model will illustrate whether there is variability in the tense slopes. If so, you can model that variability with an interaction between tense and language. Note here that the link you provide uses all possible interactions, which may be a part of the particular method, but seems superfluous. To only insert the fixed effect of Language and the cross level interaction, your the $\beta_{ij}$ equation changes to:

$$ \beta_{1j} = \gamma_{10} + \gamma_{11}\times Language + u_{0j} $$

and your syntax to:

1000ms <- lmer(elog ~ tense.ct*t + L1_L2.ct + L1_L2.ct:tense.ct + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The remaining options you have insert variables into the random-effects part of the formula that seem to be inappropriate based on your design. Essentially, any variable that is inserted to the left of the | ParticipantName is flagging a randomly varying coefficient. So that's a 1 if only the intercepts at level 2 are varying. Then, you add variables that you think have random slopes (not often more than 1 or two), and these need to be level-1 variables. Language is a participant variable (not a characteristic of a trial) so it stays as a fixed effect. You model the interaction of language and tense to get the effect you're looking for.

Source Link
Rick Hass
  • 811
  • 4
  • 16

TL/DR: It helps to write down the model in hierarchical notation. This way it becomes clear what slopes are randomly varying. Only level-1 variables can have randomly varying slopes in a 2-level model (as this one). So here I discuss what I think is your intent.

For simplicity I'm not discussing the weights since they enter into the estimation, not the model construction. Also, we'll use the regular notation of $y_{ij}$ even though your outcome is on the logit scale, it's still a normal multilevel model.

In the syntax for your first model you have:

1000ms <- lmer(elog ~ tense.ct*t + (1|ParticipantName), data=bySubj1000, weights=1/wts)

This is the following model:

$$ y_{ij} = \beta_{0j} + \beta_{1j} \times Tense + \beta_{2j} \times Time + \beta_{3j} \times Tense*Time + e_{ij} $$

and at level 2 (participant level):

$$ \beta_{0j} = \gamma_{00} + u_{0j} \\ \beta_{1j} = \gamma_{10} \\ \beta_{2j} = \gamma_{20} \\ \beta_{3j} = \gamma_{30} $$

This is a straightforward model with random intercepts for each Participant. You asked about unbalanced groups, which isn't too much of a problem in GLME model setting. You don't want the groups too unbalanced but it's not like repeated measures ANOVA where the groups must have identical sizes.

Now to the effect of Language. This is a level-2 (participant) variable, so it is entered as a fixed effect as in the first of your models b1000ms. However, it seems you'd like to test a cross-level interaction between language and tense. First, you should verify that the tense effect varies substantially from participant to participant. This would be akin to changing the equation for $\beta_{1j}$ above to

$$ \beta_{1j} = \gamma_{10} + u_{0j} $$

And your model syntax becomes:

1000ms <- lmer(elog ~ tense.ct*t + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The results of this model will illustrate whether there is variability in the tense slopes. If so, you can model that variability with an interaction between tense and language. Note here that the link you provide uses all possible interactions, which may be a part of the particular method, but seems superfluous. To only insert the fixed effect of Language and the cross level interaction, your the $\beta_{ij}$ equation changes to:

$$ \beta_{1j} = \gamma_{10} + \gamma_{11}\times Language + u_{0j} $$

and your syntax to:

1000ms <- lmer(elog ~ tense.ct*t + L1_L2.ct + L1_L2.ct:tense.ct + (tense.ct|ParticipantName), data=bySubj1000, weights=1/wts)

The remaining options you have insert variables into the random-effects part of the formula that seem to be inappropriate based on your design. Essentially, any variable that is inserted to the left of the | ParticipantName is flagging a randomly varying coefficient. So that's a 1 if only the intercepts at level 2 are varying. Then, you add variables that you think have random slopes (not often more than 1 or two), and these need to be level-1 variables. Language is a participant variable (not a characteristic of a trial) so it stays as a fixed effect. You model the interaction of language and tense to get the effect you're looking for.