help
help > RE: Design matrix
Nov 18, 2019 11:11 PM | Andrew Zalesky
RE: Design matrix
Hi Leonardo,
In this design you are modelling the mean of each subject independently.
Note that each subject's sex does not change between time points. If I am a male at time point 1, presumably I am still a male at time point 2. Therefore it does not make sense to include sex as a covariate in this kind of repeated measures design.
If you want to test hypotheses about sex, a repeated measures (multiple time points) is not necessary. You could simply average the data across the two time points if you are interested in a hypothesis about sex.
This is why you are getting the rank warning. The columns of the design matrix are not independent when sex is added.
The same is true for age in this case.
Andrew
Originally posted by Leonardo Tozzi:
In this design you are modelling the mean of each subject independently.
Note that each subject's sex does not change between time points. If I am a male at time point 1, presumably I am still a male at time point 2. Therefore it does not make sense to include sex as a covariate in this kind of repeated measures design.
If you want to test hypotheses about sex, a repeated measures (multiple time points) is not necessary. You could simply average the data across the two time points if you are interested in a hypothesis about sex.
This is why you are getting the rank warning. The columns of the design matrix are not independent when sex is added.
The same is true for age in this case.
Andrew
Originally posted by Leonardo Tozzi:
I have a followup question on this topic, i.e.
adding covariates of no interest in the design, such as age and
sex.
I have a similar situation as what explained above:
P1T1 1 0 1 0
P2T1 0 1 1 0
P1T2 1 0 0 1
P2T2 0 1 0 1
P1T3 1 0 0 0
P2T3 0 1 0 0
Echange block: [1 2 1 2 1 2]
Contrast F test [0 0 1 1]
Now I would like to add age and sex as between subjects covariates. If I do as a design matrix:
P1T1 1 0 1 0 20 0
P2T1 0 1 1 0 30 1
P1T2 1 0 0 1 20 0
P2T2 0 1 0 1 30 1
P1T3 1 0 0 0 20 0
P2T3 0 1 0 0 30 1
Echange block: [1 2 1 2 1 2]
Contrast F test [0 0 1 1 0 0]
I get an error:
Warning: Rank deficient, rank = 839, tol = 1.242192e-09.
My question is, is it possible to have a between-subject covariate in such a design?
Thank you very much.
I have a similar situation as what explained above:
P1T1 1 0 1 0
P2T1 0 1 1 0
P1T2 1 0 0 1
P2T2 0 1 0 1
P1T3 1 0 0 0
P2T3 0 1 0 0
Echange block: [1 2 1 2 1 2]
Contrast F test [0 0 1 1]
Now I would like to add age and sex as between subjects covariates. If I do as a design matrix:
P1T1 1 0 1 0 20 0
P2T1 0 1 1 0 30 1
P1T2 1 0 0 1 20 0
P2T2 0 1 0 1 30 1
P1T3 1 0 0 0 20 0
P2T3 0 1 0 0 30 1
Echange block: [1 2 1 2 1 2]
Contrast F test [0 0 1 1 0 0]
I get an error:
Warning: Rank deficient, rank = 839, tol = 1.242192e-09.
My question is, is it possible to have a between-subject covariate in such a design?
Thank you very much.
Threaded View
Title | Author | Date |
---|---|---|
Alexia Bourgeois | Dec 14, 2017 | |
Leonardo Tozzi | Nov 19, 2019 | |
Leonardo Tozzi | Nov 18, 2019 | |
Andrew Zalesky | Nov 18, 2019 | |
Andrew Zalesky | Dec 16, 2017 | |
Alexia Bourgeois | Dec 19, 2017 | |
Andrew Zalesky | Dec 20, 2017 | |