- If A and B are somehow the same, for example measurements of the same variable or of comparable variables with the same units, then you may choose to conduct a repeated measures analysis. For example, you may do the analysis on left arm and right arm of subjects.
- If A and B are fundamentally different things, then you may choose not to use repeated measures analysis. For example, If A were age and B were weight of some subjects, and they are of very different scales, then you may decide fitrm is not appropriate.
Implementing Moderation analysis using fitrm when i have a 2 within subjects factors
7 次查看(过去 30 天)
显示 更早的评论
I have a (A)2x(B)2 within subjects design and a continuous moderator variable (X). I want to test whether X moderates the relationship between A and B. How can I impliment this in matlab using the fitrm function?
I have tried the following :
rm = fitrm(Datamatrix,'A-B ~1 + X','WithinDesign',within);
However I am not sure if this is the right thing to do.
Should i be using the fitlm function instead? If so, can someone explain how i should construct my design matrix for it?
Thanks in advance!
0 个评论
回答(1 个)
Aditya Patil
2020-12-24
The idea behind repeated measures is that we measure the response variable over time or under different conditions.
As a workaround, it would be possible to model A and B separately. An advantage is that they would not be constrained to have the same functional relationship. For example, A could be a linear function of X and B could be a quadratic function of X. It would also be possible to study the residuals from the two models in order to decide the degree of correlation between A and B after adjusting for the between-subject models.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!