help > ANCOVA rank deficient
Showing 1-8 of 8 posts
Display:
Results per page:
May 11, 2016  02:05 PM | Giulia Forcellini
ANCOVA rank deficient
Dear NBS' users,

I am running an analysis with two groups (HC and patients) where I want to control for age and gender. 
This is a short example of the matrix I am using to do so:

1 1 0 -1 0.5
1 1 0 1 -05
1 1 0 -1 0.5
1 0 1 1 -05
1 0 1 1 -05
1 0 1 -1 0.5

Where the first column is the intercept, the second column the first group, 3rd the second group, 4th column is gender and 5th age (demeaned).

My contrast would be [0 1 -1 0 0] running an F-test.

Now, when I run the analysis with these settings MATLAB gives me the following warning: 
Warning: Rank deficient, rank = 4, tol = 1.154632e-14.

Is it possible this is caused by the sample size being too small (HC=26, patients=26)?
What else could the problem be? How is it possible to solve this?

Thank you so much!

Best, 

Giulia
May 12, 2016  12:05 AM | Andrew Zalesky
RE: ANCOVA rank deficient
Hi Giulia,

Use the following design matrix
1 1 0  27
1 1 1  31
1 1 0  43
1 0 1  56
1 0 0  22
1 0 1  34

The 1st column is intercept, 2nd is patient or control; 3rd is gender and 4th is age.

To test for a between-group difference, use a "t-test" and the contrast:
[0 1 0 0]   
or
[0 -1 0 0]

The first one is patients > controls and the second is patients < controls.

Andrew



Originally posted by Giulia Forcellini:
Dear NBS' users,

I am running an analysis with two groups (HC and patients) where I want to control for age and gender. 
This is a short example of the matrix I am using to do so:

1 1 0 -1 0.5
1 1 0 1 -05
1 1 0 -1 0.5
1 0 1 1 -05
1 0 1 1 -05
1 0 1 -1 0.5

Where the first column is the intercept, the second column the first group, 3rd the second group, 4th column is gender and 5th age (demeaned).

My contrast would be [0 1 -1 0 0] running an F-test.

Now, when I run the analysis with these settings MATLAB gives me the following warning: 
Warning: Rank deficient, rank = 4, tol = 1.154632e-14.

Is it possible this is caused by the sample size being too small (HC=26, patients=26)?
What else could the problem be? How is it possible to solve this?

Thank you so much!

Best, 

Giulia
Aug 20, 2016  05:08 AM | Juan Pablo Princich - Neurociencias Hospital El Cruce, Buenos Aires
RE: ANCOVA rank deficient
Dear Andrew and Giulia
Thanks for the example , it is very useful.

Still have two questions maybe not related to NBS but to statistics in general that you could please kindly acknowledge...
1. under this ancova example , do we need to perform a multiple comparison correction if we perform any additional ttest on the same matrices but  with a different group definition ? in other words i found a significant network with this design but also want to look for differences re-arranging a sub group distribution according to clinical properties.. lets say i split the patients group in two and compare them with individual t test using the same design agaisnt all the controls.

2. is there a way to define a contrast that only shows the effect of covariates alone? (not accounting for the groups differences) or shall i modify the design matrix ?

Thanks for your patience and grateful help!
sincerely, Juan P
Aug 22, 2016  04:08 AM | Andrew Zalesky
RE: ANCOVA rank deficient
Hi Juan,

this is just like a typical F-test: you may want to perform subsequent testing to identify the groups that are driving the result. This can be done using independent t-tests, as you suggest, although there are more fancy ways of doing this. 

To test the significance of a single covariate, use a t-test and set the contrast vector equal to 1 in the position corresponding to the covariate. All other elements in the contrast vector should be zero. This will give you the significance of the covariate.


Andrew

Originally posted by Juan Pablo Princich:
Dear Andrew and Giulia
Thanks for the example , it is very useful.

Still have two questions maybe not related to NBS but to statistics in general that you could please kindly acknowledge...
1. under this ancova example , do we need to perform a multiple comparison correction if we perform any additional ttest on the same matrices but  with a different group definition ? in other words i found a significant network with this design but also want to look for differences re-arranging a sub group distribution according to clinical properties.. lets say i split the patients group in two and compare them with individual t test using the same design agaisnt all the controls.

2. is there a way to define a contrast that only shows the effect of covariates alone? (not accounting for the groups differences) or shall i modify the design matrix ?

Thanks for your patience and grateful help!
sincerely, Juan P
Dec 7, 2017  01:12 AM | Juan Pablo Princich - Neurociencias Hospital El Cruce, Buenos Aires
RE: ANCOVA rank deficient
Dear Andrew, 

I used NBS to compare 2 groups as stated in this post accounting for age and sex differences using a t-test, with a [0 1 0 0] contrast type as you suggest.
I found one component with 6 connection pairs that shall have higher connectivity in patients than in controls as the matrices were arranged in the same way as mentioned in this post (patients first followed by controls).

But i get confused interpreting results because when i extract the identified connections for all participants and perform individual tests (mann withney, non parametric)  on each connection pair between patients and controls , the values on patients are indeed significantly lower than in controls... contrary to the NBS results.


Will really appreciate your comments and possible explanations for this ambiguity.  Please be aware that age and sex effects are not regressed out for the individual connections test, but significance levels ares still very low (p.001).


Sincerely 
Juan P
Dec 7, 2017  01:12 AM | Andrew Zalesky
RE: ANCOVA rank deficient
You might want to check that you are interpreting the contrast correctly. If you code patients as 1 and controls as 0 (or -1), then the contrast of [0 1 0 0] will give patients greater than controls. Otherwise, if patients are coded as 0 (or -1) and controls as 1, then contrast [ 0 1 0 0] will give controls > patients. 

You might also want to check that your connectivity matrices are ordered correctly.



Originally posted by Juan Pablo Princich:
Dear Andrew, 

I used NBS to compare 2 groups as stated in this post accounting for age and sex differences using a t-test, with a [0 1 0 0] contrast type as you suggest.
I found one component with 6 connection pairs that shall have higher connectivity in patients than in controls as the matrices were arranged in the same way as mentioned in this post (patients first followed by controls).

But i get confused interpreting results because when i extract the identified connections for all participants and perform individual tests (mann withney, non parametric)  on each connection pair between patients and controls , the values on patients are indeed significantly lower than in controls... contrary to the NBS results.


Will really appreciate your comments and possible explanations for this ambiguity.  Please be aware that age and sex effects are not regressed out for the individual connections test, but significance levels ares still very low (p.001).


Sincerely 
Juan P
Dec 13, 2017  02:12 PM | Juan Pablo Princich - Neurociencias Hospital El Cruce, Buenos Aires
RE: ANCOVA rank deficient
Thanks for the quick response as usual.

Unfortunately the the coding looks correct.. first column intercept term, second patients (1) and controls (0), followed by one column for sex and the last accounting for age. ie..

1 1 1 31
1 1 1 24
1 1 0 50
1 1 1 30
1 0 1 24
1 0 1 24
1 0 1 25
1 0 1 34

If i followed you correctly the contras [0 1 0 0] shows higher connectivity in patients than controls.
I used the function (combine.m, kindly provided by you) to combine all subjects in a 4D matrix that were alphabetically ordered.. will recheck visually.

Is it possible to have some connection pairs showing higher connectivity values and at the same time others connections within the same component with lower values? or NBS should show separate components in that case?

Thanks again for your support!
Dec 18, 2017  11:12 AM | Juan Pablo Princich - Neurociencias Hospital El Cruce, Buenos Aires
RE: ANCOVA rank deficient
Solved.
Thanks, i just realised that matrices lost alphabetic order when compressed in a 3D stack,  because controls  filenames all started with a capital letter and all patients were low case names.
It resulted in an inverted order for the contrasts i 've used and consequently inverted results.

Just my 2 cents.

thanks for the advice.
JP