<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Hello,</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">I am trying to do the analysis based on the paper </span><span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><span style="font-variant-ligatures: inherit; font-variant-caps: inherit;">"nonparametric
 statistical testing of coherence differences" in fieldtrip for comparing differences between two conditions on single subject level.</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit;"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><span style="font-variant-ligatures: inherit; font-variant-caps: inherit;">I am using the following code</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><span style="font-variant-ligatures: inherit; font-variant-caps: inherit;"><br>
</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">
<p class="p1" style="margin:0px;font:10px Courier">cfg<span class="Apple-converted-space">           
</span>= [];</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.method = <span class="s1" style="color:rgb(160, 32, 240)">
'montecarlo'</span>;</p>
<p class="p2" style="margin:0px;font:10px Courier;color:rgb(160, 32, 240)"><span class="s2" style="color:rgb(0, 0, 0)">cfg.statistic =
</span>'indepsamplesZcoh'<span class="s2" style="color:rgb(0, 0, 0)">;</span></p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.design(1,1:148)=1;</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.design(1,149:296)=2;</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.numrandomization = 1000;</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.correctm <span class="Apple-converted-space">
        </span>= <span class="s1" style="color:rgb(160, 32, 240)">'cluster'</span>;</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.neighbours=[];</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.parameter=<span class="s1" style="color:rgb(160, 32, 240)">'crsspctrm'</span>;</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.alpha<span class="Apple-converted-space">           
</span>= 0.05;</p>
<p class="p1" style="margin:0px;font:10px Courier">cfg.clusteralpha <span class="Apple-converted-space">
    </span>= 0.05;</p>
<p class="p1" style="margin:0px;font:10px Courier">stat=ft_freqstatistics(cfg,freq_coh);</p>
<br>
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;"><br>
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><span style="font-variant-ligatures: inherit; font-variant-caps: inherit;">Where freq_coh is calculated as</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit;">
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg<span class="Apple-converted-space">           
</span>= [];</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg.output <span class="Apple-converted-space">
    </span>= <span class="s1" style="color:rgb(160, 32, 240)">'powandcsd'</span>;</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg.method <span class="Apple-converted-space">
    </span>= <span class="s1" style="color:rgb(160, 32, 240)">'mtmfft'</span>;</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg.foilim <span class="Apple-converted-space">
    </span>= [1 40];</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg.tapsmofrq<span class="Apple-converted-space"> 
</span>= 2;</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg.pad = <span class="s1" style="color:rgb(160, 32, 240)">
'nextpow2'</span>;</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">cfg.keeptrials = <span class="s1" style="color:rgb(160, 32, 240)">
'yes'</span>;</p>
<p class="p1" style="font: 10px Courier; margin: 0px;">freq_coh<span class="Apple-converted-space">         
</span>= ft_freqanalysis(cfg, Coh_data);</p>
<p class="p1" style="font: 10px Courier; margin: 0px;"><br>
</p>
<p class="p1" style="font-variant: normal; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; margin: 0px;">
<span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">I am getting the following error</span></p>
<p class="p1" style="font: 10px Courier; margin: 0px;"><br>
</p>
<div class="p1" style="font: 10px Courier; margin: 0px;">Error using ft_statistics_montecarlo (line 250)
<div>could not determine the parametric critical value for clustering</div>
<div><br>
</div>
<div>Error in ft_freqstatistics (line 194)</div>
  [stat, cfg] = statmethod(cfg, dat, design);<br>
</div>
<br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit;">Sample data can be found at the following link</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit;"><a href="https://www.dropbox.com/s/6gfj97srttteawy/Coh_data.mat?dl=0" id="LPlnk">https://www.dropbox.com/s/6gfj97srttteawy/Coh_data.mat?dl=0</a><br>
</span></div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1">
<div id="LPBorder_GTaHR0cHM6Ly93d3cuZHJvcGJveC5jb20vcy82Z2ZqOTdzcnR0dGVhd3kvQ29oX2RhdGEubWF0P2RsPTA." class="LPBorder553869" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer553869" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer553869" style="position: relative; margin-right: 12px; height: 160px; overflow: hidden;">
<a target="_blank" id="LPImageAnchor553869" href="https://www.dropbox.com/s/6gfj97srttteawy/Coh_data.mat?dl=0"><img id="LPThumbnailImageId553869" alt="" height="160" style="display: block;" width="160" src="https://www.dropbox.com/static/images/spectrum-icons/generated/content/content-unknown-large.png"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle553869" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor553869" href="https://www.dropbox.com/s/6gfj97srttteawy/Coh_data.mat?dl=0" style="text-decoration: none; color: var(--themePrimary);">Coh_data.mat</a></div>
<div id="LPDescription553869" style="font-size: 14px; max-height: 100px; color: rgb(102, 102, 102); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden;">
Shared with Dropbox</div>
<div id="LPMetadata553869" style="font-size: 14px; font-weight: 400; color: rgb(166, 166, 166); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">
www.dropbox.com</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">any help would be highly appreciated</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">Kind regards</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Bushra Riaz</div>
</body>
</html>