help > Question about the design matrix of ANCOVA
May 26, 2023  06:05 AM | Sitong Chen
Question about the design matrix of ANCOVA
Dear Prof. Zalesky

I am writing to seek clarification regarding the usage of your toolkit for my data analysis. I am currently conducting a study involving four groups of participants. Additionally, I would like to consider age as a covariate in my analysis.
Based on the information provided in the toolbox documentation, I have constructed the following design matrix and contrast:
Design Matrix:
                                               Age
Group1   subject1    1  0  0  0     25
Group1   subject2    1  0  0  0     26
Group1   subject3    1  0  0  0     22
Group2   subject4    0  1  0  0     30
Group2   subject5    0  1  0  0     29
Group2   subject6    0  1  0  0     28
Group2   subject7    0  1  0  0     25
Group3   subject8    0  0  1  0     22
Group3   subject9    0  0  1  0     23
Group3   subject10  0  0  1  0     27
Group4   subject11  0  0  0  1     28
Group4   subject12  0  0  0  1     29

Contrast:
[1 1 1 1 1]

I am unsure about how to specify the design matrix and the contrast vector appropriately. I want to compare the differences among the four groups while accounting for age as a covariate. Could you please advise me on how to correctly set up the contrast vector in this case?
I appreciate your time and assistance in addressing my inquiry. Thank you for developing this valuable toolkit, which has greatly contributed to my research.
Sincerely,
Sitong Chen