Simple effects following fitlme
15 views (last 30 days)
Show older comments
I am fitting a linear mixed effects model as below:
results = fitlme(temp,'deltaRSFC~ Drug*Time*pre_SHAPS+Age+Sex+Site+(1|Subj)','DummyVarCoding','reference','FitMethod','REML');
where both Drug and Time are categorical with each having two levels.
Following significant Drug*Time interaction, how do I test post-hoc test of simple effects. I.e., how do I test whether the effect of Time is significant only for a specific level of the factor Drug (e.g. Drug A (Time1 - Time2))?
I searched a lot of posts but the coefTest guidance is not clear. Any help is much appreciated.
0 Comments
Answers (1)
Akash
on 14 May 2024
Hi Avijit,
You can use the `coefTest` function, which allows to test the significance of specific effects within the model. You will need to construct a contrast vector that represents the coefficients for 'Time' within each level of 'Drug' (e.g., 'Drug A' and 'Drug B') as they appear in the model's output.
For information on setting up contrasts in models with interaction effects, the following MATLAB Central discussion links will be useful. They provide details on how to define the contrast matrix for the interaction term to test:-
You can also utilize the 'emmeans' function available on MATLAB File Exchange, which provides the predicted means from generalized linear mixed effect models in Matlab:-
0 Comments
See Also
Categories
Find more on ANOVA in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!