help
help > RE: Within-subjects design longitudinal analysis with three time points.
Feb 27, 2021 05:02 AM | Andrew Zalesky
RE: Within-subjects design longitudinal analysis with three time points.
Hi Alvaro,
I suspect that your design matrix is not full rank and will produce a rank deficiency warning. Did you get a warning?
If so, you will need to remove the task column. I assume that the task remains that the same between the two time points.
Your design matrix should therefore comprise the main effect of time, the interaction between time and task, and the individual columns for each subject. But not the main effect of task.
If the task is the same for the two time points, you can test for the main effect of task by averaging the data for two time points and using the averaged data in a separate model. No need for multiple time points to assess the task effect.
The three time points is more complex. Perhaps focus on getting the simpler case working correctly.
Best wishes,
Andrew
Originally posted by Álvaro Deleglise:
I suspect that your design matrix is not full rank and will produce a rank deficiency warning. Did you get a warning?
If so, you will need to remove the task column. I assume that the task remains that the same between the two time points.
Your design matrix should therefore comprise the main effect of time, the interaction between time and task, and the individual columns for each subject. But not the main effect of task.
If the task is the same for the two time points, you can test for the main effect of task by averaging the data for two time points and using the averaged data in a separate model. No need for multiple time points to assess the task effect.
The three time points is more complex. Perhaps focus on getting the simpler case working correctly.
Best wishes,
Andrew
Originally posted by Álvaro Deleglise:
Hi again Andrew,
First of all, thank you very for your help.
Here I attach a file containing the design matrix that I have constructed for modeling only two time points. Could you please tell me if it is correct? MSL and CTL are the two taks, "ses" designates the corresponding session/time point, and "su" designates the corresponding subject.
I'm using the following constrasts:
-to test for task: [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-to test for session/time point: [0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-to test the interaction between task and session: [0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Finally, given that it is a within-subjects design, I have set the exchange blocks as follows (remember that I have 21 subjects):
[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21] Is this correct?
By the other hand, could you please show me in with a little example how the design matrix should look like for the case when modeling the three time points? I would really appreciate it.
Again, thank you so much in advance.
First of all, thank you very for your help.
Here I attach a file containing the design matrix that I have constructed for modeling only two time points. Could you please tell me if it is correct? MSL and CTL are the two taks, "ses" designates the corresponding session/time point, and "su" designates the corresponding subject.
I'm using the following constrasts:
-to test for task: [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-to test for session/time point: [0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-to test the interaction between task and session: [0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Finally, given that it is a within-subjects design, I have set the exchange blocks as follows (remember that I have 21 subjects):
[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21] Is this correct?
By the other hand, could you please show me in with a little example how the design matrix should look like for the case when modeling the three time points? I would really appreciate it.
Again, thank you so much in advance.
Threaded View
Title | Author | Date |
---|---|---|
Álvaro Deleglise | Feb 17, 2021 | |
Andrew Zalesky | Feb 20, 2021 | |
Álvaro Deleglise | Feb 25, 2021 | |
Andrew Zalesky | Feb 27, 2021 | |
Álvaro Deleglise | Mar 1, 2021 | |
Andrew Zalesky | Mar 2, 2021 | |