<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Son
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">For who have emailed asking for code, it is pasted below.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Son, I see what you mean. In that case creating surrogate data is still necessary, since you need a way to generate a confidence interval
 for each set of N channels. A rough outline of your pipeline would be: (this is all assuming your measure is not simply a function of the covariance matrix)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">for si = each surrogate dataset (1:1000):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">                64chanresult = compute result for 64 chan configuration<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">                for chani = each N of channels ranging from 64:32<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">                                Nchanresult = compute result for 64 chan configuration<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">                                change(si, chani) = 64chanresult - Nchanresult<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">                end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">then you can plot your data as a line graph with confidence intervals.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I dug out a script I used a while ago, although you might want to check that it works properly (comparing correlation matrices of input/output). 
 The main caveat is that you need to check that you take care of negative frequencies adequately. Here I have used a method of simply cancelling negative frequencies. The other way is to use the complex conjugate, but I found that less stable, perhaps due to
 numerical imprecision – I’m not sure. Anyway you should verify for yourself that the correlation matrix of your original data is almost exactly the same as your surrogate data (within reason: differences on the order of <1e-5, although this depends on the
 length of the data). You should detrend and filter before using this function.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">function data = randomisePhase(data, equalphase)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">% data = array: [time, channels]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">% equalphase boolean: [true | false] (do you want the same phase shift in<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">% each channel? default = true)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">if nargin == 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">    equalphase = true;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">L = size(data, 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">data = fft(data)*2;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">data(L/2+1:end, :) = 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">randphase = exp(1i*randn(1,L)*2*pi)'; % uses the same phase for each channel<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">for ii = 1:size(data,2)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">    if equalphase == false<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">        randphase = exp(1i*rand(L,1)*2*pi)’;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">    end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">    data(:,ii) = real(ifft(data(:,ii).*randphase));<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Darren<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Dr. Darren Price<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Investigator Scientist and Cam-CAN Data Manager<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">MRC Cognition & Brain Sciences Unit<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">15 Chaucer Road<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cambridge, CB2 7EF<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">England
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">EMAIL:  darren.price@mrc-cbu.cam.ac.uk<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">URL:   
</span><a href="http://www.mrc-cbu.cam.ac.uk/people/darren.price"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US;text-decoration:none">http://www.mrc-cbu.cam.ac.uk/people/darren.price</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">TEL     +44 (0)1223 355 294 x202<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">FAX     +44 (0)1223 359 062<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">MOB     +44 (0)7717822431<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-------------------------------------------------------<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl]
<b>On Behalf Of </b>Ta Dinh, Son<br>
<b>Sent:</b> 13 October 2016 10:25<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Subject:</b> Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Hi Darren,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Thanks for the great answer! I’ll definitely check out the reference you provided. Creating a surrogate dataset sounds like a good way
 to test robustness of my original data. The code for Matlab would be much appreciated if it isn’t too much effort for you. I would also be interested in the pitfalls you mentioned, could you elaborate on those?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">The thing is, what I was actually trying to do was not checking the robustness of the original data in general but rather to see how
 strongly the data (in particular this one specific graph measure) is affected by reducing the amount of electrodes. Context for this is that I wanted to check the viability of the measure in a clinical setting where it is unrealistic to have 64 electrodes
 available and the standard is usually 16 electrodes (or less). So what I would really like to know how strongly the graph measure is affected by reducing the amount of nodes in the graph, and whether this effect is on just a quantitative level or a qualitative
 one. Do you have any suggestions for this as well?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Thanks a lot again.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Son<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;color:#888888">Son Ta Dinh, M.Sc.</span><span lang="EN-US" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;color:#888888">PhD student in Human Pain Research</span><span lang="EN-US" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:7.5pt;color:#888888">Klinikum rechts der Isar</span><span lang="DE" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:7.5pt;color:#888888">Technische Universität München<br>
Munich, Germany<br>
Phone: </span><a href="tel:%2B49%2089%204140%207664" target="_blank"><span lang="DE" style="font-size:7.5pt">+49 89 4140 7664</span></a><span lang="DE" style="font-size:7.5pt;color:#888888"><br>
</span><a href="http://www.painlabmunich.de/" target="_blank"><span lang="DE" style="font-size:7.5pt">http://www.painlabmunich.de/</span></a><span lang="DE" style="color:#888888"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">fieldtrip-bounces@science.ru.nl</span></a><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> [</span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:fieldtrip-bounces@science.ru.nl</span></a><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<b>Im Auftrag von </b>Darren Price<br>
<b>Gesendet:</b> Mittwoch, 12. </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Oktober 2016 19:01<br>
<b>An:</b> </span><a href="mailto:fieldtrip@science.ru.nl"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">fieldtrip@science.ru.nl</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Betreff:</b> Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Sorry, I don’t have time to write a long answer right now, but in short you don’t need to select a subset of channels. In fact this
 would not be a valid null since those subset of channels are really just picking up roughly the same signal as the unselected channels. One type of valid null (given certain assumptions) can be computed by phase randomisation of the original data (to create
 what is known as a surrogate dataset). The general idea is to Fourier transform each channel, randomise the phase (but not the amplitude) of each frequency component, using the same phase randomisation for each channel, and then inverse Fourier transform each
 channel. Don’t try to do this yourself unless you know what you are doing, as there are a couple of big pitfalls to avoid. What you will be left with is a random time domain signal, that has the same frequency components, and also (crucially) the same covariance
 structure between channels (so that the rank of the data is the same as your original data in each iteration), although you might not want this, and it’s not strictly necessary. If you want a proper reference then here it is.
</span><a href="http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.73.951</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">
 .<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If you want an example of how to do this in Matlab. I can provide it. It’s actually just a few lines of code. Let me know and I will
 send the code over.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">P.S if you want your results to be reproducible you should always set your random seed at the start of your script.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Good luck.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Darren
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Dr. Darren Price<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Investigator Scientist and Cam-CAN Data Manager<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">MRC Cognition & Brain Sciences Unit<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">15 Chaucer Road<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cambridge, CB2 7EF<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">England
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">EMAIL: 
</span><a href="mailto:darren.price@mrc-cbu.cam.ac.uk"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">darren.price@mrc-cbu.cam.ac.uk</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">URL:   
</span><a href="http://www.mrc-cbu.cam.ac.uk/people/darren.price"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US;text-decoration:none">http://www.mrc-cbu.cam.ac.uk/people/darren.price</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">TEL     +44 (0)1223 355 294 x202<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">FAX     +44 (0)1223 359 062<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">MOB     +44 (0)7717822431<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-------------------------------------------------------<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">fieldtrip-bounces@science.ru.nl</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> [</span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">mailto:fieldtrip-bounces@science.ru.nl</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<b>On Behalf Of </b>Ta Dinh, Son<br>
<b>Sent:</b> 12 October 2016 16:06<br>
<b>To:</b> </span><a href="mailto:fieldtrip@science.ru.nl"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">fieldtrip@science.ru.nl</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Subject:</b> Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Hey Matthew,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Thanks for the answer, but the question is exactly how to actually build a representative null distribution. As the calculation using
 all (64) electrodes is deterministic, it can’t really be used to create a distribution, it would just be a vector of 1000 x 1 exact same value.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">The graph measure is called hub disruption index and was introduced here: Achard, S., et al. (2012). "Hubs of brain functional networks
 are radically reorganized in comatose patients." PNAS.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">To put it in a nutshell, it compares a subject against a group of controls, thereby giving a single value for every subject (in comparison
 to the control group).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I hope this has cleared up the context a bit.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Best<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Son<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;color:#888888">Son Ta Dinh, M.Sc.</span><span lang="EN-US" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;color:#888888">PhD student in Human Pain Research</span><span lang="EN-US" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:7.5pt;color:#888888">Klinikum rechts der Isar</span><span lang="DE" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:7.5pt;color:#888888">Technische Universität München<br>
Munich, Germany<br>
Phone: </span><a href="tel:%2B49%2089%204140%207664" target="_blank"><span lang="DE" style="font-size:7.5pt">+49 89 4140 7664</span></a><span lang="DE" style="font-size:7.5pt;color:#888888"><br>
</span><a href="http://www.painlabmunich.de/" target="_blank"><span lang="DE" style="font-size:7.5pt">http://www.painlabmunich.de/</span></a><span lang="DE" style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Nickel, Moritz
<br>
<b>Gesendet:</b> Mittwoch, 12. </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Oktober 2016 16:37<br>
<b>An:</b> Ta Dinh, Son <</span><a href="mailto:son.ta.dinh@tum.de"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">son.ta.dinh@tum.de</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Betreff:</b> Fwd: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">---------- Forwarded message ----------<br>
From: <b>Matt Gerhold</b> <</span><a href="mailto:matt.gerhold@gmail.com"><span lang="EN-US">matt.gerhold@gmail.com</span></a><span lang="EN-US">><br>
Date: 2016-10-05 13:31 GMT+02:00<br>
Subject: Re: [FieldTrip] Statistical test of robustness of a graph measure based on reduced amount of nodes<br>
To: FieldTrip discussion list <</span><a href="mailto:fieldtrip@science.ru.nl"><span lang="EN-US">fieldtrip@science.ru.nl</span></a><span lang="EN-US">><o:p></o:p></span></p>
<div>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">Hi Son,</span><span lang="EN-US"><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">What you are explaining sounds like resampling to build a distribution under the null hypothesis. You would need to make sure that your random draws are representative in some way of an
 instance where the test statistic (graph theoretic measure) is truly zero, i.e. representative of the null hypothesis. There is no info on your measure, so one can't comment any further on how one would achieve this.
</span><span lang="EN-US"><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">Once you have the bootstrapped distribution you compute the proportion of values above the test statistic and those below the test statistic--the test statistic is the measure you got from
 the actual sample, not the bootstrapped distribution. </span><span lang="EN-US"><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">Then it depends whether you use a two-tail or one-tail test and the direction of the hypothesized effect: for a one-tail test you could potentially take the proportion of the distribution
 above equal to the test statistic, that would be your p-value. For two tailed-tests take the min value of the two-proportions as your p-value and remember to divide alpha by 2 to test for significance.
</span><span lang="EN-US"><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">That, in a nutshell, is a simple approach; however, there are other ways to go about this.
</span><span lang="EN-US"><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">Matthew</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">On Wed, Oct 5, 2016 at 6:54 AM, Ta Dinh, Son <</span><a href="mailto:son.ta.dinh@tum.de" target="_blank"><span lang="EN-US">son.ta.dinh@tum.de</span></a><span lang="EN-US">> wrote:<o:p></o:p></span></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Dear Fieldtrippers,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">the general problem we are facing is one of statistics. In particular, we are trying to test the robustness of a graph measure when reducing the amount of nodes
 it is computed with. In our case, we use the EEG electrodes as nodes.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">We are trying to find out whether a graph measure differs significantly from zero over a group of subjects. The exact calculation of the measure is rather complicated
 to explain, suffice it to say that every subject has exactly one scalar value in the end. Computation of this measure using 64 electrodes is straightforward and we can easily calculate a p-value and/or a confidence interval.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">When we calculate based on only 32 electrodes however, we draw 32 electrodes randomly. Therefore, we need to repeat this computation many times (let’s say 1000
 times). So we then get [1000 x number of subjects] values, or 1000 p-values/confidence intervals.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">How do we statistically test whether the measure is robustly different from 0? Is it too naive to simply assume that if the confidence interval does not contain
 0 in at least 950 of the 1000 computations then it is robustly different from 0?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Any help would be greatly appreciated!<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Son<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:7.5pt;color:#888888">Son Ta Dinh, M.Sc.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:7.5pt;color:#888888">PhD student in Human Pain Research</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="DE" style="font-size:7.5pt;color:#888888">Klinikum rechts der Isar</span><span lang="DE"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="DE" style="font-size:7.5pt;color:#888888">Technische Universität München<br>
Munich, Germany<br>
Phone: </span><a href="tel:%2B49%2089%204140%207664" target="_blank"><span lang="DE" style="font-size:7.5pt">+49 89 4140 7664</span></a><span lang="DE" style="font-size:7.5pt;color:#888888"><br>
</span><a href="http://www.painlabmunich.de/" target="_blank"><span lang="DE" style="font-size:7.5pt">http://www.painlabmunich.de/</span></a><span lang="DE"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="DE"> <o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US">_______________________________________________<br>
fieldtrip mailing list<br>
</span><a href="mailto:fieldtrip@donders.ru.nl" target="_blank"><span lang="EN-US">fieldtrip@donders.ru.nl</span></a><span lang="EN-US"><br>
</span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank"><span lang="EN-US">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><span lang="EN-US"><o:p></o:p></span></p>
</blockquote>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><br>
_______________________________________________<br>
fieldtrip mailing list<br>
</span><a href="mailto:fieldtrip@donders.ru.nl"><span lang="EN-US">fieldtrip@donders.ru.nl</span></a><span lang="EN-US"><br>
</span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank"><span lang="EN-US">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>