help >

**repeated measures ANOVA + covariate**Showing 1-7 of 7 posts

Mar 21, 2023 11:03 AM | Maksym Tokariev

repeated measures ANOVA + covariate

Dear Prof. Zalesky,

I have read the forum before and it was really helpful in addressing many question. However, now I stuck with the design matrix for the NBS. I need to construct 2 x 2 repated mesures ANOVA design matrix with the

Age

Group1 Session1 Subj1 1 0 0 0 0 15.5 1 1 Of note, the real number of subjects in each group is significantly larger.

Group1 Session1 Subj2 0 1 0 0 0 11.2 1 1

Group1 Session1 Subj3 0 0 1 0 0 9.6 1 1

Group1 Session2 Subj1 1 0 0 0 0 15.5 -1 -1

Group1 Session2 Subj2 0 1 0 0 0 11.2 -1 -1

Group1 Session3 Subj3 0 0 1 0 0 9.6 -1 -1

Group2 Session1 Subj4 0 0 0 1 0 7.7 1 -1

Group2 Session1 Subj5 0 0 0 0 1 8.2 1 -1

Group2 Session2 Subj4 0 0 0 1 0 7.7 -1 1

Group2 Session2 Subj5 0 0 0 0 1 8.2 -1 1

I wonder, is this the correct way of adding the covariate? I would be grateful for any help or suggestions.

Best regards,

Maksym

I have read the forum before and it was really helpful in addressing many question. However, now I stuck with the design matrix for the NBS. I need to construct 2 x 2 repated mesures ANOVA design matrix with the

**age as the covariate**to control for. The design has two groups and two time points (sessions). Here is an example of the design matrix for Group1 (3 subjects) and Group2 (2 subjects):Age

Group1 Session1 Subj1 1 0 0 0 0 15.5 1 1 Of note, the real number of subjects in each group is significantly larger.

Group1 Session1 Subj2 0 1 0 0 0 11.2 1 1

Group1 Session1 Subj3 0 0 1 0 0 9.6 1 1

Group1 Session2 Subj1 1 0 0 0 0 15.5 -1 -1

Group1 Session2 Subj2 0 1 0 0 0 11.2 -1 -1

Group1 Session3 Subj3 0 0 1 0 0 9.6 -1 -1

Group2 Session1 Subj4 0 0 0 1 0 7.7 1 -1

Group2 Session1 Subj5 0 0 0 0 1 8.2 1 -1

Group2 Session2 Subj4 0 0 0 1 0 7.7 -1 1

Group2 Session2 Subj5 0 0 0 0 1 8.2 -1 1

I wonder, is this the correct way of adding the covariate? I would be grateful for any help or suggestions.

Best regards,

Maksym

Mar 22, 2023 01:03 AM | Andrew Zalesky

RE: repeated measures ANOVA + covariate

Hi Maksym,

thanks for your question and interest.

Your design matrix is almost correct. But it will be important to remove the column corresponding to age. Because this is a within-subject (repeated measures) design and age does not change between the two time points, it can be removed. Technically speaking, if age is included, the design matrix will not be full rank because the columns will not be linearly independent. This makes it difficult to find a unique solution.

In summary, I recommend removing the column for age from the design matrix. The other parts of the design matrix appear to be correct.

Best wishes and let me know if you have any other questions.

Andrew Zalesky

thanks for your question and interest.

Your design matrix is almost correct. But it will be important to remove the column corresponding to age. Because this is a within-subject (repeated measures) design and age does not change between the two time points, it can be removed. Technically speaking, if age is included, the design matrix will not be full rank because the columns will not be linearly independent. This makes it difficult to find a unique solution.

In summary, I recommend removing the column for age from the design matrix. The other parts of the design matrix appear to be correct.

Best wishes and let me know if you have any other questions.

Andrew Zalesky

*Originally posted by Maksym Tokariev:*Dear Prof. Zalesky,

I have read the forum before and it was really helpful in addressing many question. However, now I stuck with the design matrix for the NBS. I need to construct 2 x 2 repated mesures ANOVA design matrix with the

Age

Group1 Session1 Subj1 1 0 0 0 0 15.5 1 1 Of note, the real number of subjects in each group is significantly larger.

Group1 Session1 Subj2 0 1 0 0 0 11.2 1 1

Group1 Session1 Subj3 0 0 1 0 0 9.6 1 1

Group1 Session2 Subj1 1 0 0 0 0 15.5 -1 -1

Group1 Session2 Subj2 0 1 0 0 0 11.2 -1 -1

Group1 Session3 Subj3 0 0 1 0 0 9.6 -1 -1

Group2 Session1 Subj4 0 0 0 1 0 7.7 1 -1

Group2 Session1 Subj5 0 0 0 0 1 8.2 1 -1

Group2 Session2 Subj4 0 0 0 1 0 7.7 -1 1

Group2 Session2 Subj5 0 0 0 0 1 8.2 -1 1

I wonder, is this the correct way of adding the covariate? I would be grateful for any help or suggestions.

Best regards,

Maksym

I have read the forum before and it was really helpful in addressing many question. However, now I stuck with the design matrix for the NBS. I need to construct 2 x 2 repated mesures ANOVA design matrix with the

**age as the covariate**to control for. The design has two groups and two time points (sessions). Here is an example of the design matrix for Group1 (3 subjects) and Group2 (2 subjects):Age

Group1 Session1 Subj1 1 0 0 0 0 15.5 1 1 Of note, the real number of subjects in each group is significantly larger.

Group1 Session1 Subj2 0 1 0 0 0 11.2 1 1

Group1 Session1 Subj3 0 0 1 0 0 9.6 1 1

Group1 Session2 Subj1 1 0 0 0 0 15.5 -1 -1

Group1 Session2 Subj2 0 1 0 0 0 11.2 -1 -1

Group1 Session3 Subj3 0 0 1 0 0 9.6 -1 -1

Group2 Session1 Subj4 0 0 0 1 0 7.7 1 -1

Group2 Session1 Subj5 0 0 0 0 1 8.2 1 -1

Group2 Session2 Subj4 0 0 0 1 0 7.7 -1 1

Group2 Session2 Subj5 0 0 0 0 1 8.2 -1 1

I wonder, is this the correct way of adding the covariate? I would be grateful for any help or suggestions.

Best regards,

Maksym

Mar 22, 2023 02:03 AM | Maksym Tokariev

RE: repeated measures ANOVA + covariate

Thank you for the detailed answer. If I understand correctly, it is
not possible to test directly the main effect of group with
repeated measures 2x2 design. As such, I have another question.
What is the approach to test the main effect of group with two
groups, two sessions while accounting for the age variability? Does
one have to construct a separate design? These questions might be
straightforward, however, some explanation would be helpful.

Thank you again for helping with the design and NBS.

Best regards,

Maksym

Thank you again for helping with the design and NBS.

Best regards,

Maksym

Mar 22, 2023 02:03 AM | Andrew Zalesky

RE: repeated measures ANOVA + covariate

Hi Maksym,

Because the main effect of group does not change between the two time points, a within-subject design (i.e. two time points) is not needed to assess the effect of group.

If you are specifically interested in the main effect of group, you could consider only the data from the first time point (or only the data for the second time point). No need to collect follow-up data if group is the only effect of interest.

Alternatively, you could first compute the difference in the neuroimaging measure between the two time points for each subject and then run the NBS on the difference. This means that each subject would only have one measurement in the design matrix, which would be the difference between the two time points.

With these two alternatives, the effect of age can be modelled by including a column with age in the design matrix. The interaction between age and group could also be tested. Both alternatives will require you to create a new design matrix.

Andrew

Because the main effect of group does not change between the two time points, a within-subject design (i.e. two time points) is not needed to assess the effect of group.

If you are specifically interested in the main effect of group, you could consider only the data from the first time point (or only the data for the second time point). No need to collect follow-up data if group is the only effect of interest.

Alternatively, you could first compute the difference in the neuroimaging measure between the two time points for each subject and then run the NBS on the difference. This means that each subject would only have one measurement in the design matrix, which would be the difference between the two time points.

With these two alternatives, the effect of age can be modelled by including a column with age in the design matrix. The interaction between age and group could also be tested. Both alternatives will require you to create a new design matrix.

Andrew

*Originally posted by Maksym Tokariev:*Thank you for the detailed answer. If I
understand correctly, it is not possible to test directly the main
effect of group with repeated measures 2x2 design. As such, I have
another question. What is the approach to test the main effect of
group with two groups, two sessions while accounting for the age
variability? Does one have to construct a separate design? These
questions might be straightforward, however, some explanation would
be helpful.

Thank you again for helping with the design and NBS.

Best regards,

Maksym

Thank you again for helping with the design and NBS.

Best regards,

Maksym

Mar 22, 2023 02:03 AM | Andrew Zalesky

RE: repeated measures ANOVA + covariate

PS.

I should say that my remarks are not specific to the NBS. This is a general property of the general linear model (GLM).

I should say that my remarks are not specific to the NBS. This is a general property of the general linear model (GLM).

*Originally posted by Andrew Zalesky:*Hi
Maksym,

Because the main effect of group does not change between the two time points, a within-subject design (i.e. two time points) is not needed to assess the effect of group.

If you are specifically interested in the main effect of group, you could consider only the data from the first time point (or only the data for the second time point). No need to collect follow-up data if group is the only effect of interest.

Alternatively, you could first compute the difference in the neuroimaging measure between the two time points for each subject and then run the NBS on the difference. This means that each subject would only have one measurement in the design matrix, which would be the difference between the two time points.

With these two alternatives, the effect of age can be modelled by including a column with age in the design matrix. The interaction between age and group could also be tested. Both alternatives will require you to create a new design matrix.

Andrew

Because the main effect of group does not change between the two time points, a within-subject design (i.e. two time points) is not needed to assess the effect of group.

If you are specifically interested in the main effect of group, you could consider only the data from the first time point (or only the data for the second time point). No need to collect follow-up data if group is the only effect of interest.

Alternatively, you could first compute the difference in the neuroimaging measure between the two time points for each subject and then run the NBS on the difference. This means that each subject would only have one measurement in the design matrix, which would be the difference between the two time points.

With these two alternatives, the effect of age can be modelled by including a column with age in the design matrix. The interaction between age and group could also be tested. Both alternatives will require you to create a new design matrix.

Andrew

*Originally posted by Maksym Tokariev:*Thank you for the detailed answer. If I
understand correctly, it is not possible to test directly the main
effect of group with repeated measures 2x2 design. As such, I have
another question. What is the approach to test the main effect of
group with two groups, two sessions while accounting for the age
variability? Does one have to construct a separate design? These
questions might be straightforward, however, some explanation would
be helpful.

Thank you again for helping with the design and NBS.

Best regards,

Maksym

Thank you again for helping with the design and NBS.

Best regards,

Maksym

Apr 17, 2023 02:04 PM | Maksym Tokariev

RE: repeated measures ANOVA + covariate

Dear Prof. Zalesky,

Thank you once again for the detailed explanations on designs and their implementation in NBS. I have another question and it is about statistical thresholding. At present, I'm doing a correlation analysis of subjects' connectivity with the age. From the forum pages I found that there are three ways of searching for correlations:

1. Positive correlations (t-test) | set up [0 1] contrast

2. Negative correaltion (t-test) | set up [0 -1] contrast

3. Both positive and negative correlations (F test) | set up [0 1] contrst and select F-test instead of t-test

In my analysis, the threshold for t-test is 3.1. The question is, does one have to adjust this threshold when selecting the F-test instead of t-test? As I understand, the relationship between the two values is F=t^2. As such, to compare the connectivity maps from both statistical measures I need to change the t=3.1 (ttest) to F=t^2=9.61 (F-test). By doing so, the adjusted threshold brings more similarities with the t-test, which makes it easier to compare. I attached the .pdf to illustrate my concern.

Thank you in advance for the answer.

Regards,

Maksym

Thank you once again for the detailed explanations on designs and their implementation in NBS. I have another question and it is about statistical thresholding. At present, I'm doing a correlation analysis of subjects' connectivity with the age. From the forum pages I found that there are three ways of searching for correlations:

1. Positive correlations (t-test) | set up [0 1] contrast

2. Negative correaltion (t-test) | set up [0 -1] contrast

3. Both positive and negative correlations (F test) | set up [0 1] contrst and select F-test instead of t-test

In my analysis, the threshold for t-test is 3.1. The question is, does one have to adjust this threshold when selecting the F-test instead of t-test? As I understand, the relationship between the two values is F=t^2. As such, to compare the connectivity maps from both statistical measures I need to change the t=3.1 (ttest) to F=t^2=9.61 (F-test). By doing so, the adjusted threshold brings more similarities with the t-test, which makes it easier to compare. I attached the .pdf to illustrate my concern.

Thank you in advance for the answer.

Regards,

Maksym

Apr 18, 2023 07:04 AM | Andrew Zalesky

RE: repeated measures ANOVA + covariate

Hi Maksym,

Yes - you are right.

The equivalent F-test is given by F=t^2.

There is a subtle difference between F and t in that t is always a one-sided test, whereas F is two-sided. So the results with t=3.1 will not necessarily be exactly the same as F=9.61, since F will consider positive and negative correlations whereas t will either consider positive or negative.

Finally, it is important to note that there is no right or wrong threshold. It is ok to match between t and F but it is also ok to consider other thresholds.

Andrew

Yes - you are right.

The equivalent F-test is given by F=t^2.

There is a subtle difference between F and t in that t is always a one-sided test, whereas F is two-sided. So the results with t=3.1 will not necessarily be exactly the same as F=9.61, since F will consider positive and negative correlations whereas t will either consider positive or negative.

Finally, it is important to note that there is no right or wrong threshold. It is ok to match between t and F but it is also ok to consider other thresholds.

Andrew

*Originally posted by Maksym Tokariev:*Dear Prof. Zalesky,

Thank you once again for the detailed explanations on designs and their implementation in NBS. I have another question and it is about statistical thresholding. At present, I'm doing a correlation analysis of subjects' connectivity with the age. From the forum pages I found that there are three ways of searching for correlations:

1. Positive correlations (t-test) | set up [0 1] contrast

2. Negative correaltion (t-test) | set up [0 -1] contrast

3. Both positive and negative correlations (F test) | set up [0 1] contrst and select F-test instead of t-test

In my analysis, the threshold for t-test is 3.1. The question is, does one have to adjust this threshold when selecting the F-test instead of t-test? As I understand, the relationship between the two values is F=t^2. As such, to compare the connectivity maps from both statistical measures I need to change the t=3.1 (ttest) to F=t^2=9.61 (F-test). By doing so, the adjusted threshold brings more similarities with the t-test, which makes it easier to compare. I attached the .pdf to illustrate my concern.

Thank you in advance for the answer.

Regards,

Maksym

Thank you once again for the detailed explanations on designs and their implementation in NBS. I have another question and it is about statistical thresholding. At present, I'm doing a correlation analysis of subjects' connectivity with the age. From the forum pages I found that there are three ways of searching for correlations:

1. Positive correlations (t-test) | set up [0 1] contrast

2. Negative correaltion (t-test) | set up [0 -1] contrast

3. Both positive and negative correlations (F test) | set up [0 1] contrst and select F-test instead of t-test

In my analysis, the threshold for t-test is 3.1. The question is, does one have to adjust this threshold when selecting the F-test instead of t-test? As I understand, the relationship between the two values is F=t^2. As such, to compare the connectivity maps from both statistical measures I need to change the t=3.1 (ttest) to F=t^2=9.61 (F-test). By doing so, the adjusted threshold brings more similarities with the t-test, which makes it easier to compare. I attached the .pdf to illustrate my concern.

Thank you in advance for the answer.

Regards,

Maksym