NITRC Network-Based Statistic (NBS) Forum: help
http://www.nitrc.org/forum/forum.php?forum_id=3444
Get Public Helpen-usCopyright 2000-2019 NITRC OSIThu, 05 Dec 2019 18:22:40 GMThttp://blogs.law.harvard.edu/tech/rssNITRC RSS generatorRE: Design matrix and contrast for 2 way ANOVA, and f-value
http://www.nitrc.org/forum/forum.php?thread_id=10253&forum_id=3444
Hi Dr. Zalesky<br />
<br />
Thanks for this really usefull toolbox. I've just started to use it and I'm still quite insecure relatively to the definition of the design matrix.<br />
I think this is the adeguate place to post my question.<br />
I have 16 subjects equally divided in 2 groups (placebo & treatment) and each of the subjects participate in 2 different condition (inclusion & exclusion), I suppose I should design a 2 way between subjects anova.<br />
I've define the design matrix and contrast that you can find attached, I'm wondering if this is correct or not. Furthermore I have some other question:<br />
<br />
1- Should I also add a column of 1's as first column?<br />
2- What would be better to use a t-test or an f-test?<br />
3- How many permutation should I set?<br />
<br />
Thanks for your attention.<br />
Davidedavideit7Thu, 05 Dec 2019 14:55:17 GMThttp://www.nitrc.org/forum/forum.php?thread_id=10253&forum_id=3444RE: Mostly zero values when extracting connectivity strengths in the significant sub-network
http://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444
[color=#000000]Hi Laura, [/color]<br />
<br />
<br />
If you are comfortable doing so, I suggest sending through your connectivity matrices, design matrix and other data inputs. Please also send a screenshot of NBS GUI just before you run the analysis. <br />
<br />
Also send the code that you are using to extract the connectivity strengths. <br />
<br />
My email is: azalesky@unimelb.edu.au<br />
<br />
Andrew<br />
<br />
<br />
<br />
[i]Originally posted by laura_costello:[/i][quote]Hi, Andrew<br />
<br />
Thank you so much for your quick reply and suggestions. I have re-modelled No Trauma/Trauma as 1,-1 and similarly changed the interaction column in the design matrix to test this interaction (1,-1,1,-1) between trauma and diagnosis. I obtained an identical sub-network at T=8.5 as when the interaction was modelled as 1,-1,2 -2 and unfortunately the connectivity strengths extracted for these connections in this sub-network remain mostly zeros.<br />
<br />
To answer your question, the structural connectivity matrices are thresholded by a minimum FA value of 0.2, and our matrices do contain some zero values however the percentage of zeros present in these are not too far off from other datasets we previously analysed for which we were able to obtain connection strengths. Our pipeline involves combining 86 cortico-subcortical nodes (desikan-killianey atlas, freesurfer v6.0) and edges are derived from performing CSD tractography (lmax=4) on a 32 gradient diffusion-weighted images (1b0, b-value of 1000m/s^2)<br />
<br />
I really appreciate that you would be willing to have a look at these connectivity matrices for us. I could transfer these to you separately.<br />
<br />
Many Thanks,<br />
Laura[/quote]Andrew ZaleskyWed, 04 Dec 2019 23:58:37 GMThttp://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444RE: Mostly zero values when extracting connectivity strengths in the significant sub-network
http://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444
Hi, Andrew<br />
<br />
Thank you so much for your quick reply and suggestions. I have re-modelled No Trauma/Trauma as 1,-1 and similarly changed the interaction column in the design matrix to test this interaction (1,-1,1,-1) between trauma and diagnosis. I obtained an identical sub-network at T=8.5 as when the interaction was modelled as 1,-1,2 -2 and unfortunately the connectivity strengths extracted for these connections in this sub-network remain mostly zeros.<br />
<br />
To answer your question, the structural connectivity matrices are thresholded by a minimum FA value of 0.2, and our matrices do contain some zero values however the percentage of zeros present in these are not too far off from other datasets we previously analysed for which we were able to obtain connection strengths. Our pipeline involves combining 86 cortico-subcortical nodes (desikan-killianey atlas, freesurfer v6.0) and edges are derived from performing CSD tractography (lmax=4) on a 32 gradient diffusion-weighted images (1b0, b-value of 1000m/s^2)<br />
<br />
I really appreciate that you would be willing to have a look at these connectivity matrices for us. I could transfer these to you separately.<br />
<br />
Many Thanks,<br />
Lauralaura_costelloWed, 04 Dec 2019 16:16:18 GMThttp://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444RE: Using NBS to compare matrices between groups in cases where only 1 matrix exists per group
http://www.nitrc.org/forum/forum.php?thread_id=9990&forum_id=3444
Hi Klaas, <br />
thanks for reaching out. <br />
<br />
The NBS toolbox does not (yet) provide support for inference on structural covariance networks and matrices. <br />
<br />
There are however a few studies that have used custom versions of NBS on structural covariance matrices. For example: <br />
<br />
https://www.ncbi.nlm.nih.gov/pubmed/31164006<br />
<br />
You would need some experience in Matlab coding. <br />
<br />
If you are interested, please contact me via email and I can discuss with you in mode detail. <br />
<br />
Andrew<br />
<br />
<br />
<br />
[i]Originally posted by Klaas Bahnsen:[/i][quote]Hello Eric and Andrew,<br />
<br />
I can only join Eric, many thanks to all the developers for developing this really useful toolbox.<br />
<br />
I have now stumbled across the exact same problem and after reading this forum post, I have now invested some time to look for publications that apply NBS to structural covariance and I have to admit that unfortunately I did not find what I was looking for.<br />
I would be very happy to have a starting point for further research. Maybe someone of you can help me.<br />
<br />
Thank you very much for your time and assistance,<br />
Klaas[/quote]Andrew ZaleskyTue, 03 Dec 2019 23:38:25 GMThttp://www.nitrc.org/forum/forum.php?thread_id=9990&forum_id=3444RE: Mostly zero values when extracting connectivity strengths in the significant sub-network
http://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444
Hi Laura, <br />
thanks for reaching out. <br />
<br />
First, I think that you probably want to model the main effect of trauma using 0 and 1, or -1 and 1. Using 1 and 2, will test for a parametric effect, rather than a difference between the trauma and no trauma group.<br />
<br />
Note that you will also need to change the interaction column in the design matrix, if the main effect is changed as I suggest above. <br />
<br />
Regarding the 0's in the extracted connection strengths, this is quite strange. Have you thresholded your connectivity matrices and do the connectivity matrices contain any zeros to begin with? I sense that something might have gone wrong when you have tried to extract the connection strengths after running the NBS. <br />
<br />
I suggest making the change to the design matrix that I have described above and then trying to extract the connection strength again. If multiple 0's are still present, you are welcome to send me you NBS output and connection matrices. I can then have a closer look. <br />
<br />
Andrew<br />
<br />
[i]Originally posted by laura_costello:[/i][quote]Hi Andrew,<br />
<br />
I have a question regarding my design matrix set up and have mostly zero values when extracting connectivity strengths in the significant sub-network. <br />
<br />
In a between-subjects design, I want to use an ANCOVA design to test the interaction between 2 bivariate variables; diagnosis (2 groups) and trauma (2 groups) co-varying for the effect of sex and age. An example of the design matrix I have used to test for this interaction between diagnosis and trauma is illustrated below. The contrast I used in NBS to test this interaction was set up as: structural connectivity matrices -weighted-by FA (.txt) "000100" F-test, 5000 permutations using extent. Do you think that this design matrix set up is correctly to test this interaction between diagnosis and trauma?<br />
<br />
Columns: Intercept (1), Diagnosis (HC=1, SZ=-1), No Trauma (1)/Trauma (2), Interaction (1, -1, 2, -2), Sex (1, -1), Age<br />
<br />
1 1 1 1 -1 45<br />
1 1 2 2 -1 47<br />
1 -1 1 -1 -1 44<br />
1 -1 2 -2 -1 21<br />
1 -1 1 -1 -1 34<br />
1 -1 1 -1 -1 43<br />
<br />
When I ran this F-test to test for an interaction effect, I obtained a sub-network at a threshold of 8.5. I then tried to extract the connectivity strengths between each connection in the sub-network using the matlab script previously recommended in the NBS forum and manual. However, the connectivity strength values that I obtain come out as '0' values in most cases. For reduced design using this same data set, I am able to extract connection strengths that appear reasonable for a F-test contrast investigating the main effect of diagnosis that is modelled as '0100'.<br />
<br />
Below is an example of the output I receive in the matlab window after running the script to extract connection strengths for a sub-network relating to the interaction between diagnosis and trauma consisting of 26 edges, and 25 nodes in (T=8.5)<br />
0<br />
0.298<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0.273<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0.513<br />
0<br />
0<br />
<br />
Do you know what might be causing these 0 values in the connectivity strengths to appear? Is it possible that there could be a limit to the extent of the statistical model/ design that is suitable for this approach? Would you have any suggestions how we might overcome the issue or indeed whether you think the sub-network is valid?<br />
<br />
Thank you for your help in advance.<br />
Kind Regards<br />
Laura"[/quote]Andrew ZaleskyTue, 03 Dec 2019 23:30:27 GMThttp://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444RE: Using NBS to compare matrices between groups in cases where only 1 matrix exists per group
http://www.nitrc.org/forum/forum.php?thread_id=9990&forum_id=3444
Hello Eric and Andrew,<br />
<br />
I can only join Eric, many thanks to all the developers for developing this really useful toolbox.<br />
<br />
I have now stumbled across the exact same problem and after reading this forum post, I have now invested some time to look for publications that apply NBS to structural covariance and I have to admit that unfortunately I did not find what I was looking for.<br />
I would be very happy to have a starting point for further research. Maybe someone of you can help me.<br />
<br />
Thank you very much for your time and assistance,<br />
KlaasKlaas BahnsenTue, 03 Dec 2019 15:32:22 GMThttp://www.nitrc.org/forum/forum.php?thread_id=9990&forum_id=3444Mostly zero values when extracting connectivity strengths in the significant sub-network
http://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444
Hi Andrew,<br />
<br />
I have a question regarding my design matrix set up and have mostly zero values when extracting connectivity strengths in the significant sub-network. <br />
<br />
In a between-subjects design, I want to use an ANCOVA design to test the interaction between 2 bivariate variables; diagnosis (2 groups) and trauma (2 groups) co-varying for the effect of sex and age. An example of the design matrix I have used to test for this interaction between diagnosis and trauma is illustrated below. The contrast I used in NBS to test this interaction was set up as: structural connectivity matrices -weighted-by FA (.txt) "000100" F-test, 5000 permutations using extent. Do you think that this design matrix set up is correctly to test this interaction between diagnosis and trauma?<br />
<br />
Columns: Intercept (1), Diagnosis (HC=1, SZ=-1), No Trauma (1)/Trauma (2), Interaction (1, -1, 2, -2), Sex (1, -1), Age<br />
<br />
1 1 1 1 -1 45<br />
1 1 2 2 -1 47<br />
1 -1 1 -1 -1 44<br />
1 -1 2 -2 -1 21<br />
1 -1 1 -1 -1 34<br />
1 -1 1 -1 -1 43<br />
<br />
When I ran this F-test to test for an interaction effect, I obtained a sub-network at a threshold of 8.5. I then tried to extract the connectivity strengths between each connection in the sub-network using the matlab script previously recommended in the NBS forum and manual. However, the connectivity strength values that I obtain come out as '0' values in most cases. For reduced design using this same data set, I am able to extract connection strengths that appear reasonable for a F-test contrast investigating the main effect of diagnosis that is modelled as '0100'.<br />
<br />
Below is an example of the output I receive in the matlab window after running the script to extract connection strengths for a sub-network relating to the interaction between diagnosis and trauma consisting of 26 edges, and 25 nodes in (T=8.5)<br />
0<br />
0.298<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0.273<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0<br />
0.513<br />
0<br />
0<br />
<br />
Do you know what might be causing these 0 values in the connectivity strengths to appear? Is it possible that there could be a limit to the extent of the statistical model/ design that is suitable for this approach? Would you have any suggestions how we might overcome the issue or indeed whether you think the sub-network is valid?<br />
<br />
Thank you for your help in advance.<br />
Kind Regards<br />
Laura"laura_costelloTue, 03 Dec 2019 13:49:36 GMThttp://www.nitrc.org/forum/forum.php?thread_id=10753&forum_id=3444RE: Design matrix
http://www.nitrc.org/forum/forum.php?thread_id=8822&forum_id=3444
Thank you very much for the quick reply! <br />
I thought that somehow it was also possible to account for confounds across subjects. I will then disregard these variables and maybe look at them post-hoc.Leonardo TozziTue, 19 Nov 2019 0:49:45 GMThttp://www.nitrc.org/forum/forum.php?thread_id=8822&forum_id=3444RE: Design matrix
http://www.nitrc.org/forum/forum.php?thread_id=8822&forum_id=3444
[color=#000000]Hi Leonardo, [/color]<br />
<br />
In this design you are modelling the mean of each subject independently. <br />
<br />
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. <br />
<br />
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. <br />
<br />
This is why you are getting the rank warning. The columns of the design matrix are not independent when sex is added. <br />
<br />
The same is true for age in this case. <br />
<br />
<br />
Andrew<br />
<br />
[i]Originally posted by Leonardo Tozzi:[/i][quote]I have a followup question on this topic, i.e. adding covariates of no interest in the design, such as age and sex. <br />
I have a similar situation as what explained above:<br />
<br />
P1T1 1 0 1 0<br />
P2T1 0 1 1 0<br />
P1T2 1 0 0 1<br />
P2T2 0 1 0 1<br />
P1T3 1 0 0 0<br />
P2T3 0 1 0 0<br />
<br />
Echange block: [1 2 1 2 1 2]<br />
Contrast F test [0 0 1 1] <br />
<br />
Now I would like to add age and sex as between subjects covariates. If I do as a design matrix:<br />
<br />
P1T1 1 0 1 0 20 0<br />
P2T1 0 1 1 0 30 1<br />
P1T2 1 0 0 1 20 0<br />
P2T2 0 1 0 1 30 1<br />
P1T3 1 0 0 0 20 0<br />
P2T3 0 1 0 0 30 1<br />
<br />
Echange block: [1 2 1 2 1 2]<br />
Contrast F test [0 0 1 1 0 0]<br />
<br />
I get an error: <br />
Warning: Rank deficient, rank = 839, tol = 1.242192e-09.<br />
<br />
My question is, is it possible to have a between-subject covariate in such a design? <br />
Thank you very much.[/quote]Andrew ZaleskyMon, 18 Nov 2019 23:53:19 GMThttp://www.nitrc.org/forum/forum.php?thread_id=8822&forum_id=3444RE: Design matrix
http://www.nitrc.org/forum/forum.php?thread_id=8822&forum_id=3444
I have a followup question on this topic, i.e. adding covariates of no interest in the design, such as age and sex. <br />
I have a similar situation as what explained above:<br />
<br />
P1T1 1 0 1 0<br />
P2T1 0 1 1 0<br />
P1T2 1 0 0 1<br />
P2T2 0 1 0 1<br />
P1T3 1 0 0 0<br />
P2T3 0 1 0 0<br />
<br />
Echange block: [1 2 1 2 1 2]<br />
Contrast F test [0 0 1 1] <br />
<br />
Now I would like to add age and sex as between subjects covariates. If I do as a design matrix:<br />
<br />
P1T1 1 0 1 0 20 0<br />
P2T1 0 1 1 0 30 1<br />
P1T2 1 0 0 1 20 0<br />
P2T2 0 1 0 1 30 1<br />
P1T3 1 0 0 0 20 0<br />
P2T3 0 1 0 0 30 1<br />
<br />
Echange block: [1 2 1 2 1 2]<br />
Contrast F test [0 0 1 1 0 0]<br />
<br />
I get an error: <br />
Warning: Rank deficient, rank = 839, tol = 1.242192e-09.<br />
<br />
My question is, is it possible to have a between-subject covariate in such a design? <br />
Thank you very much.Leonardo TozziMon, 18 Nov 2019 19:20:31 GMThttp://www.nitrc.org/forum/forum.php?thread_id=8822&forum_id=3444