Hi, I am trying to correlate glucose levels (SSPG) and gene expression differences between individuals before (post) and after (pre) meals. In addition, I need to correct it for the protocol (Prep), age, weight differences between post and pre.
I am using the following formula to do it. Could you please let me know if this is a correct way or not?
### head (clinical_data)
Sample.ID Time.Point Prep Age SSPG weight..kg. 1396-807_pre_L 1396-807 pre L 51 140 101.97 1396-807_post_L 1396-807 post L 51 201 105.35 1396-006_pre_B 1396-006 pre B 52 117 70.00 1396-006_post_B 1396-006 post B 52 115 72.77 1396-006_pre_L 1396-006 pre L 52 117 70.00 1396-006_post_L 1396-006 post L 52 115 72.77
### design matrix
design <- model.matrix(SSPG ~ Time.Point +
Prep + Age + weight..kg.,
data=clinical_data)
@Gordon Smyth - Does it give genes that change between pre and post and correlated with SSPG? You mean like this?
design <- model.matrix(~ Time.Point + SSPG+
Prep + Age + weight..kg.,
data=clinical_data)