help
help > RE: How to write design matrix and contrast for continuous variable analysis (not comparison between groups)
Sep 1, 2021 12:09 AM | Andrew Zalesky
RE: How to write design matrix and contrast for continuous variable analysis (not comparison between groups)
Hi Ben,
yes - the baseline intuition is correct.
In the case of covariates, the relevant contrast is [0 1 0 0] or [0 -1 0 0] to test for an association with the behavioral data, and the test is still t-test.
Using [0 1 1 1] would not be correct here. This contrast does not have a straightforward interpretation and would not be used typically.
I hope that helps!
Andrew
Originally posted by Ben Sipes:
yes - the baseline intuition is correct.
In the case of covariates, the relevant contrast is [0 1 0 0] or [0 -1 0 0] to test for an association with the behavioral data, and the test is still t-test.
Using [0 1 1 1] would not be correct here. This contrast does not have a straightforward interpretation and would not be used typically.
I hope that helps!
Andrew
Originally posted by Ben Sipes:
Hi all,
@Andrew, thank you for contribution to NBS and answering questions on this forum!!
I have some follow-up questions to this thread to help me better understand the design matrix and contrast construction for continuous variables.
Let's say I have connectome data from N subjects as well as behavioral data from each subject as a continuous variable, then I want to ask whether there is some connected subgraph with edge strengths that linearly increase with the behavioral measure across subjects.
As I understand it, I should create an Nx2 design matrix, where the first column is a constant [ones(N,1)], and the second column is the demeaned continuous behavioral measure. Then the contrast vector would be [0 1] to find a linearly increasing connected subgraph (via NBS), and the statistical test would be "t-test." Conversely, if the question asked about a linearly decreasing subgraph, then the contrast vector would instead be [0 -1]. Is this baseline intuition correct?
Next, I would like to ask the same question, but control for two covariates, age and sex. I believe I should then have an Nx4 design matrix, with a constant (first column), demeaned behavioral measure (second column), and demeaned age and demeaned sex (third and fourth columns, respectively). Then would the associated contrast vector be [0 1 0 0]? Or would it instead be [0 1 1 1]? Are there valid but different interpretations for both of these contrasts? Is the appropriate statistical test still "t-test?"
Thank you so much for your help with this question!
--Ben
@Andrew, thank you for contribution to NBS and answering questions on this forum!!
I have some follow-up questions to this thread to help me better understand the design matrix and contrast construction for continuous variables.
Let's say I have connectome data from N subjects as well as behavioral data from each subject as a continuous variable, then I want to ask whether there is some connected subgraph with edge strengths that linearly increase with the behavioral measure across subjects.
As I understand it, I should create an Nx2 design matrix, where the first column is a constant [ones(N,1)], and the second column is the demeaned continuous behavioral measure. Then the contrast vector would be [0 1] to find a linearly increasing connected subgraph (via NBS), and the statistical test would be "t-test." Conversely, if the question asked about a linearly decreasing subgraph, then the contrast vector would instead be [0 -1]. Is this baseline intuition correct?
Next, I would like to ask the same question, but control for two covariates, age and sex. I believe I should then have an Nx4 design matrix, with a constant (first column), demeaned behavioral measure (second column), and demeaned age and demeaned sex (third and fourth columns, respectively). Then would the associated contrast vector be [0 1 0 0]? Or would it instead be [0 1 1 1]? Are there valid but different interpretations for both of these contrasts? Is the appropriate statistical test still "t-test?"
Thank you so much for your help with this question!
--Ben
Threaded View
Title | Author | Date |
---|---|---|
Qiushi Wang | Jul 20, 2021 | |
Ben Sipes | Aug 31, 2021 | |
Andrew Zalesky | Sep 1, 2021 | |
Ben Sipes | Sep 1, 2021 | |
Andrew Zalesky | Jul 20, 2021 | |
Qiushi Wang | Jul 21, 2021 | |