Hello – thank you in advance for anyone able to help.
I’m analysing data from a repeated measures experiment on human subjects with a linear mixed effects model using fitlme. My model includes three random effects: intercept by Subject, slope over repeated measurements by Subject and slope over another independent variable [not important what it is] by Subject: one intercept and two slopes all by Subject. That’s a good model (e.g. compared to simpler alternative models) with good fit and tight confidence intervals on the fixed and variance parameters.
It looks something like:
‘TestScore ~ 1 + Repeat*Condition + (1|Subject) + (Condition – 1|Subject) + (Repeat – 1|Subject)’
As I understand it, a full random effect variance-covariance matrix (and the default pattern in MATLAB) related to Subject would contain the variance for each of three three random effects (which the above model also delivers) and the three covariances/correlations between them (which the above model does not deliver).
What I can’t figure out is how to specify the model so it shows the three covariances/correlations.
I can get one correlation or other by modifying as such:
‘TestScore ~ 1 + Repeat*Condition + (1 + Condition|Subject) + (Repeat – 1|Subject)’
or
‘TestScore ~ 1 + Repeat*Condition + (Condition – 1|Subject) + (1 + Repeat|Subject)’
But not in same model and not the additional correlation between slopes, all of which I want.
I presume I need to define both slopes as well as the intercept in the same term / set of brackets, but my guesses at that have failed.
Can anyone help with this?
It is possible that this is revealing a misunderstanding I have about the random effects and the associated variance-covariance matrix – if so, I’d be grateful to have that pointed out.
Thank you againHello – thank you in advance for anyone able to help.
I’m analysing data from a repeated measures experiment on human subjects with a linear mixed effects model using fitlme. My model includes three random effects: intercept by Subject, slope over repeated measurements by Subject and slope over another independent variable [not important what it is] by Subject: one intercept and two slopes all by Subject. That’s a good model (e.g. compared to simpler alternative models) with good fit and tight confidence intervals on the fixed and variance parameters.
It looks something like:
‘TestScore ~ 1 + Repeat*Condition + (1|Subject) + (Condition – 1|Subject) + (Repeat – 1|Subject)’
As I understand it, a full random effect variance-covariance matrix (and the default pattern in MATLAB) related to Subject would contain the variance for each of three three random effects (which the above model also delivers) and the three covariances/correlations between them (which the above model does not deliver).
What I can’t figure out is how to specify the model so it shows the three covariances/correlations.
I can get one correlation or other by modifying as such:
‘TestScore ~ 1 + Repeat*Condition + (1 + Condition|Subject) + (Repeat – 1|Subject)’
or
‘TestScore ~ 1 + Repeat*Condition + (Condition – 1|Subject) + (1 + Repeat|Subject)’
But not in same model and not the additional correlation between slopes, all of which I want.
I presume I need to define both slopes as well as the intercept in the same term / set of brackets, but my guesses at that have failed.
Can anyone help with this?
It is possible that this is revealing a misunderstanding I have about the random effects and the associated variance-covariance matrix – if so, I’d be grateful to have that pointed out.
Thank you again Hello – thank you in advance for anyone able to help.
I’m analysing data from a repeated measures experiment on human subjects with a linear mixed effects model using fitlme. My model includes three random effects: intercept by Subject, slope over repeated measurements by Subject and slope over another independent variable [not important what it is] by Subject: one intercept and two slopes all by Subject. That’s a good model (e.g. compared to simpler alternative models) with good fit and tight confidence intervals on the fixed and variance parameters.
It looks something like:
‘TestScore ~ 1 + Repeat*Condition + (1|Subject) + (Condition – 1|Subject) + (Repeat – 1|Subject)’
As I understand it, a full random effect variance-covariance matrix (and the default pattern in MATLAB) related to Subject would contain the variance for each of three three random effects (which the above model also delivers) and the three covariances/correlations between them (which the above model does not deliver).
What I can’t figure out is how to specify the model so it shows the three covariances/correlations.
I can get one correlation or other by modifying as such:
‘TestScore ~ 1 + Repeat*Condition + (1 + Condition|Subject) + (Repeat – 1|Subject)’
or
‘TestScore ~ 1 + Repeat*Condition + (Condition – 1|Subject) + (1 + Repeat|Subject)’
But not in same model and not the additional correlation between slopes, all of which I want.
I presume I need to define both slopes as well as the intercept in the same term / set of brackets, but my guesses at that have failed.
Can anyone help with this?
It is possible that this is revealing a misunderstanding I have about the random effects and the associated variance-covariance matrix – if so, I’d be grateful to have that pointed out.
Thank you again statistics, model MATLAB Answers — New Questions
