NITRC Network-Based Statistic (NBS) Forum: help
http://www.nitrc.org/forum/forum.php?forum_id=3444
Get Public Helpen-usCopyright 2000-2023 NITRC OSITue, 30 May 2023 4:28:29 GMThttp://blogs.law.harvard.edu/tech/rssNITRC RSS generatorQuestion about the design matrix of ANCOVA
http://www.nitrc.org/forum/forum.php?thread_id=14365&forum_id=3444
Dear Prof. Zalesky<br />
<br />
I am writing to seek clarification regarding the usage of your toolkit for my data analysis. I am currently conducting a study involving four groups of participants. Additionally, I would like to consider age as a covariate in my analysis.<br />
Based on the information provided in the toolbox documentation, I have constructed the following design matrix and contrast:<br />
Design Matrix:<br />
Age<br />
Group1 subject1 1 0 0 0 25<br />
Group1 subject2 1 0 0 0 26<br />
Group1 subject3 1 0 0 0 22<br />
Group2 subject4 0 1 0 0 30<br />
Group2 subject5 0 1 0 0 29<br />
Group2 subject6 0 1 0 0 28<br />
Group2 subject7 0 1 0 0 25<br />
Group3 subject8 0 0 1 0 22<br />
Group3 subject9 0 0 1 0 23<br />
Group3 subject10 0 0 1 0 27<br />
Group4 subject11 0 0 0 1 28<br />
Group4 subject12 0 0 0 1 29<br />
<br />
Contrast:<br />
[1 1 1 1 1]<br />
<br />
I am unsure about how to specify the design matrix and the contrast vector appropriately. I want to compare the differences among the four groups while accounting for age as a covariate. Could you please advise me on how to correctly set up the contrast vector in this case?<br />
I appreciate your time and assistance in addressing my inquiry. Thank you for developing this valuable toolkit, which has greatly contributed to my research.<br />
Sincerely,<br />
Sitong ChenSitong ChenFri, 26 May 2023 6:04:24 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14365&forum_id=3444RE: Questions on design matrix (time x group interaction)
http://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444
[color=#000000]Yes - that sounds reasonable. [/color]<br />
<br />
[color=#000000]Also, the interaction term can be modelled in several ways. [/color]<br />
[i]Originally posted by Chris Pae:[/i][quote]Hi Andrew,<br />
<br />
Thank you for the comment. I guess I was overthinking it.<br />
<br />
According to your comment, only the "patient group" and "time=1" sections in the interaction column should be assigned a value of 1, while the rest should be 0. Please let me know if I have understood correctly.<br />
<br />
Thank you again for your kindness in answering my very basic question. <br />
<br />
Chris[/quote]Andrew ZaleskyFri, 28 Apr 2023 23:02:57 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444RE: Questions on design matrix (time x group interaction)
http://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444
Hi Andrew,<br />
<br />
Thank you for the comment. I guess I was overthinking it.<br />
<br />
According to your comment, only the "patient group" and "time=1" sections in the interaction column should be assigned a value of 1, while the rest should be 0. Please let me know if I have understood correctly.<br />
<br />
Thank you again for your kindness in answering my very basic question. <br />
<br />
ChrisChris PaeFri, 28 Apr 2023 7:54:29 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444RE: Questions on design matrix (time x group interaction)
http://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444
[color=#000000]Hi Chris, [/color]<br />
<br />
[color=#000000]the interaction column can be generated by multiplying (elementwise multiplication) the group column by the time column. [/color]<br />
<br />
[color=#000000]Based on the xls spreadsheet, I don't think that the interaction column is correct. Multiplying the group and time columns is a simple way to compute the interaction column. [/color]<br />
<br />
[color=#000000]The interpretation of the interaction is no different from any other statistical model. It is the extent to which the difference between groups is different at the two time points that you are considering.[/color]<br />
<br />
[color=#000000]andrew<br />
[/color]<br />
[i]Originally posted by Chris Pae:[/i][quote]Hello, <br />
<br />
First of all I would like to thank you very much for developing such a great toolbox. <br />
<br />
I wanted to see 1) the change in connectivity over time, and 2) the difference between groups in the connectivity change.<br />
With the help of many questions here and Prof.Zalesky, I was able to build a design matrix for 2 group, 2 session (attached).<br />
I was referring to the following link (https://www.nitrc.org/forum/forum.php?thread_id=8397&forum_id=3444).<br />
<br />
I have some questions here.<br />
<br />
1. Did I build the interaction column correctly?<br />
<br />
If so:<br />
2. The interaction is determined by group x time, I was wondering how the interaction was determined here? (with control=0 and patient=1?)<br />
3. if this interaction is significant, I'm wondering how to interpret it. I'm confused about time1 for control and time2 for patient being tied to the same 1.<br />
<br />
Thank you so much for the help.<br />
<br />
Chris[/quote]Andrew ZaleskyFri, 28 Apr 2023 6:39:54 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444Questions on design matrix (time x group interaction)
http://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444
Hello, <br />
<br />
First of all I would like to thank you very much for developing such a great toolbox. <br />
<br />
I wanted to see 1) the change in connectivity over time, and 2) the difference between groups in the connectivity change.<br />
With the help of many questions here and Prof.Zalesky, I was able to build a design matrix for 2 group, 2 session (attached).<br />
I was referring to the following link (https://www.nitrc.org/forum/forum.php?thread_id=8397&forum_id=3444).<br />
<br />
I have some questions here.<br />
<br />
1. Did I build the interaction column correctly?<br />
<br />
If so:<br />
2. The interaction is determined by group x time, I was wondering how the interaction was determined here? (with control=0 and patient=1?)<br />
3. if this interaction is significant, I'm wondering how to interpret it. I'm confused about time1 for control and time2 for patient being tied to the same 1.<br />
<br />
Thank you so much for the help.<br />
<br />
ChrisChris PaeFri, 28 Apr 2023 2:44:39 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14292&forum_id=3444RE: Array bounds error
http://www.nitrc.org/forum/forum.php?thread_id=14286&forum_id=3444
[color=#000000]hi Caroline, [/color]<br />
<br />
it is difficult to diagnose the issue based on this limited error message.<br />
<br />
Given that one of your models is working correctly, I suggest systematically considering the differences between the correct model and the one that is not working. Hopefully this process of deduction will identify the problem. <br />
<br />
The error does not seem to relate to the contrast. Might want to check that the size of the connectivity matrices has not changed. <br />
<br />
best, Andrew<br />
<br />
[i]Originally posted by Caroline Diehl:[/i][quote]Hi,<br />
<br />
I'm getting this error when running one of my models in NBS, although a similar model ran smoothly. I'm running a between-group t-test with [-1 1] as the contrast.<br />
<br />
<br />
The logical indices contain a true value outside of the array bounds.<br />
<br />
Error in NBSstats (line 175)<br />
ind=ind_upper(STATS.test_stat(i,:)>STATS.thresh);<br />
Error in NBSrun (line 323)<br />
catch; [nbs.NBS.n,nbs.NBS.con_mat,nbs.NBS.pval]=NBSstats(nbs.STATS,-1,nbs.GLM); end<br />
Error in NBS>get_ui (line 194)<br />
NBSrun(UI,S);<br />
Error while evaluating UIControl Callback.<br />
<br />
<br />
Would you be able to advise on the source of the error?<br />
<br />
Thanks!<br />
Caroline[/quote]Andrew ZaleskyWed, 26 Apr 2023 1:59:00 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14286&forum_id=3444Array bounds error
http://www.nitrc.org/forum/forum.php?thread_id=14286&forum_id=3444
Hi,<br />
<br />
I'm getting this error when running one of my models in NBS, although a similar model ran smoothly. I'm running a between-group t-test with [-1 1] as the contrast.<br />
<br />
<br />
The logical indices contain a true value outside of the array bounds.<br />
<br />
Error in NBSstats (line 175)<br />
ind=ind_upper(STATS.test_stat(i,:)>STATS.thresh);<br />
Error in NBSrun (line 323)<br />
catch; [nbs.NBS.n,nbs.NBS.con_mat,nbs.NBS.pval]=NBSstats(nbs.STATS,-1,nbs.GLM); end<br />
Error in NBS>get_ui (line 194)<br />
NBSrun(UI,S);<br />
Error while evaluating UIControl Callback.<br />
<br />
<br />
Would you be able to advise on the source of the error?<br />
<br />
Thanks!<br />
CarolineCaroline DiehlTue, 25 Apr 2023 15:28:47 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14286&forum_id=3444RE: repeated measures ANOVA + covariate
http://www.nitrc.org/forum/forum.php?thread_id=14189&forum_id=3444
[color=#000000]Hi Maksym, [/color]<br />
<br />
[color=#000000]Yes - you are right. [/color]<br />
<br />
[color=#000000]The equivalent F-test is given by F=t^2. [/color]<br />
<br />
[color=#000000]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. [/color]<br />
<br />
[color=#000000]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. [/color]<br />
<br />
[color=#000000]Andrew[/color]<br />
<br />
<br />
<br />
[i]Originally posted by Maksym Tokariev:[/i][quote]Dear Prof. Zalesky,<br />
<br />
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:<br />
1. Positive correlations (t-test) | set up [0 1] contrast<br />
2. Negative correaltion (t-test) | set up [0 -1] contrast<br />
3. Both positive and negative correlations (F test) | set up [0 1] contrst and select F-test instead of t-test<br />
<br />
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.<br />
<br />
Thank you in advance for the answer.<br />
<br />
Regards,<br />
Maksym[/quote]Andrew ZaleskyTue, 18 Apr 2023 7:45:09 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14189&forum_id=3444RE: Same statistic value in all the edges
http://www.nitrc.org/forum/forum.php?thread_id=14253&forum_id=3444
Hi, <br />
<br />
yes - there is an example of a t-test under the Stats help button. <br />
<br />
This will perform a t-test for each edge independently. <br />
Andrew<br />
<br />
[i]Originally posted by Mariana Vallejo-Azar:[/i][quote]Dear Andrew<br />
<br />
I understand. Is there any way to perform t-tests for each individual edge in NBS? Thank you very much[/quote]Andrew ZaleskyTue, 18 Apr 2023 7:38:39 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14253&forum_id=3444RE: Same statistic value in all the edges
http://www.nitrc.org/forum/forum.php?thread_id=14253&forum_id=3444
Dear Andrew<br />
<br />
I understand. Is there any way to perform t-tests for each individual edge in NBS? Thank you very muchMariana Vallejo-AzarMon, 17 Apr 2023 14:47:02 GMThttp://www.nitrc.org/forum/forum.php?thread_id=14253&forum_id=3444