This shows you the differences between two versions of the page.

tutorial:cluster_permutation_timelock [2012/07/21 16:03] 89.156.125.19 [Plotting the results] |
tutorial:cluster_permutation_timelock [2014/01/22 09:48] (current) jmhorschig changed to FAQ list by trick in bug#2434 |
||
---|---|---|---|

Line 1: | Line 1: | ||

- | {{tag>tutorial statistics eeg meg timelock plot}} | + | {{tag>tutorial statistics eeg meg timelock plot MEG-language}} |

====== Cluster-based permutation tests on event related fields ====== | ====== Cluster-based permutation tests on event related fields ====== | ||

Line 98: | Line 98: | ||

We now describe these options one-by-one. | We now describe these options one-by-one. | ||

* With **cfg.method** = 'montecarlo' we choose the Monte Carlo method for calculating the significance probability. This significance probability is a Monte Carlo estimate of the p-value under the permutation distribution. | * With **cfg.method** = 'montecarlo' we choose the Monte Carlo method for calculating the significance probability. This significance probability is a Monte Carlo estimate of the p-value under the permutation distribution. | ||

- | * With **cfg.statistic** = 'indepsamplesT', we choose the independent samples T-statistic to evaluate the effect (the difference between the fully congruent and the fully incongruent condition) at the sample level. In cfg.statistic, many other test statistics can be specified. Which test statistic is appropriate depends on your research question and your experimental design. For instance, in a within-UO design, one must use the dependent samples T-statistic ('depsamplesT'). And if you want to compare more than two experimental conditions, you should choose an F-statistic ('indepsamplesF' or 'depsamplesF'). | + | * With **cfg.statistic** = 'indepsamplesT', we choose the independent samples T-statistic to evaluate the effect (the difference between the fully congruent and the fully incongruent condition) at the sample level. In cfg.statistic, many other test statistics can be specified. Which test statistic is appropriate depends on your research question and your experimental design. For instance, in a within-UO design, one must use the dependent samples T-statistic ('depsamplesT'). And if you want to compare more than two experimental conditions, you should choose an F-statistic ('indepsamplesF' or 'depsamplesFmultivariate'). |

* We use **cfg.clusteralpha** to choose the critical value that will be used for thresholding the sample-specific T-statistics. With cfg.clusteralpha = 0.05, every sample-specific T-statistic is compared with the critical value of the univariate T-test with a critical alpha-level of 0.05. (This statistical test would have been the most appropriate test if we had observed a single channel at a single time-point.) The value of cfg.clusteralpha does not affect the false alarm rate of the statistical test at the cluster-level. It is a rational threshold for deciding whether a sample should be considered a member of some large cluster of samples (which may or may not be significant at the cluster-level). | * We use **cfg.clusteralpha** to choose the critical value that will be used for thresholding the sample-specific T-statistics. With cfg.clusteralpha = 0.05, every sample-specific T-statistic is compared with the critical value of the univariate T-test with a critical alpha-level of 0.05. (This statistical test would have been the most appropriate test if we had observed a single channel at a single time-point.) The value of cfg.clusteralpha does not affect the false alarm rate of the statistical test at the cluster-level. It is a rational threshold for deciding whether a sample should be considered a member of some large cluster of samples (which may or may not be significant at the cluster-level). | ||

* We use **cfg.clusterstatistic** to choose the test statistic that will be evaluated under the permutation distribution. This is the actual test statistic and it must be distinguished from the sample-specific T-statistics that are used for thresholding. With cfg.clusterstatistic = 'maxsum', the actual test statistic is the maximum of the cluster-level statistics. A cluster-level statistic is equal to the sum of the sample-specific T-statistics that belong to this cluster. Taking the largest of these cluster-level statistics of the different clusters produces the actual test statistic. | * We use **cfg.clusterstatistic** to choose the test statistic that will be evaluated under the permutation distribution. This is the actual test statistic and it must be distinguished from the sample-specific T-statistics that are used for thresholding. With cfg.clusterstatistic = 'maxsum', the actual test statistic is the maximum of the cluster-level statistics. A cluster-level statistic is equal to the sum of the sample-specific T-statistics that belong to this cluster. Taking the largest of these cluster-level statistics of the different clusters produces the actual test statistic. | ||

Line 111: | Line 111: | ||

We now briefly discuss the configuration fields that are not specific for **[[reference:ft_timelockstatistics|ft_timelockstatistics]]**: | We now briefly discuss the configuration fields that are not specific for **[[reference:ft_timelockstatistics|ft_timelockstatistics]]**: | ||

- | cfg.channel = {'MEG'}; % cell-array with selected channel labels | + | cfg_neighb = []; |

- | cfg.latency = [0 1]; % time interval over which the experimental | + | |

- | % conditions must be compared (in seconds) | + | |

cfg_neighb.method = 'distance'; | cfg_neighb.method = 'distance'; | ||

- | neighbours = ... % specifies with which sensors other sensors | + | neighbours = ft_prepare_neighbours(cfg_neighb, dataFC_LP); |

- | ft_prepare_neighbours(... % can form clusters | + | |

- | cfg.neighb, dataFC_LP); | + | cfg.neighbours = neighbours; % the neighbours specify for each sensor with |

- | cfg.neighbours = neighbours; | + | % which other sensors it can form clusters |

+ | cfg.channel = {'MEG'}; % cell-array with selected channel labels | ||

+ | cfg.latency = [0 1]; % time interval over which the experimental | ||

+ | % conditions must be compared (in seconds) | ||

+ | | ||

With these two options, we select the spatio-temporal dataset involving all MEG channels and the time interval between 0 and 1 second. The two experimental conditions will only be compared on this selection of the complete spatio-temporal dataset. Also, feel free to consult | With these two options, we select the spatio-temporal dataset involving all MEG channels and the time interval between 0 and 1 second. The two experimental conditions will only be compared on this selection of the complete spatio-temporal dataset. Also, feel free to consult | ||

Line 163: | Line 164: | ||

clusterstat: -1.0251e+04 | clusterstat: -1.0251e+04 | ||

- | It is possible that the p-values in your output are a little bit different from 0. This is because **[[reference:ft_timelockstatistics|ft_timelockstatistics]]** calculated as a Monte Carlo approximation of the permutation p-values: the p-value for the k-th positive cluster is calculated as the proportion of random draws from the permutation distribution in which the maximum of the cluster-level statistics is more larger than stat.posclusters(k).clusterstat. | + | It is possible that the p-values in your output are a little bit different from 0. This is because **[[reference:ft_timelockstatistics|ft_timelockstatistics]]** calculated as a Monte Carlo approximation of the permutation p-values: the p-value for the k-th positive cluster is calculated as the proportion of random draws from the permutation distribution in which the maximum of the cluster-level statistics is larger than stat.posclusters(k).clusterstat. |

==== Plotting the results ==== | ==== Plotting the results ==== | ||

Line 176: | Line 177: | ||

raweffectFICvsFC = avgFIC; | raweffectFICvsFC = avgFIC; | ||

% Then take the difference of the averages. | % Then take the difference of the averages. | ||

- | raweffectFICvsFC.avg = avg_FIC.avg - avg_FC.avg; | + | raweffectFICvsFC.avg = avgFIC.avg - avgFC.avg; |

We then construct a boolean matrix indicating membership in the significant clusters. This matrix has size [Number_of_MEG_channels × Number_of_temporal_samples], like stat.posclusterslabelmat. We'll make two such matrices: one for positive clusters (named pos), and one for negative (neg). All (channel,time)-pairs belonging to the significant clusters will be coded in the new boolean matrix as 1, and all those that don't will be coded as 0. | We then construct a boolean matrix indicating membership in the significant clusters. This matrix has size [Number_of_MEG_channels × Number_of_temporal_samples], like stat.posclusterslabelmat. We'll make two such matrices: one for positive clusters (named pos), and one for negative (neg). All (channel,time)-pairs belonging to the significant clusters will be coded in the new boolean matrix as 1, and all those that don't will be coded as 0. | ||

Line 442: | Line 443: | ||

If you are interested in parametric tests in FieldTrip, you can read the [[tutorial:eventrelatedstatistics|Parametric and non-parametric statistics on event-related fields]] tutorial. If you are interested in how to do the same statistics on time-frequency representations, you can read the [[tutorial:cluster_permutation_freq|Cluster-based permutation tests on time-frequency data]] tutorial. | If you are interested in parametric tests in FieldTrip, you can read the [[tutorial:eventrelatedstatistics|Parametric and non-parametric statistics on event-related fields]] tutorial. If you are interested in how to do the same statistics on time-frequency representations, you can read the [[tutorial:cluster_permutation_freq|Cluster-based permutation tests on time-frequency data]] tutorial. | ||

- | If you would like to read more about issues related to statistical analysis, you can read the following FAQ's as well: | + | If you would like to read more about issues related to statistical analysis, you can read the following as well: |

- | \\ | + | FAQs: |

- | [[faq:why_should_i_use_the_cfg.correcttail_option_when_using_statistics_montecarlo|Why should I use the cfg.correcttail option when using statistics_montecarlo?]] | + | {{topic>statistics cluster neighbour +faq &list}} |

- | \\ | + | |

- | [[faq:what_is_the_idea_behind_statistical_inference_at_the_second-level|What is the idea behind statistical inference at the second-level?]] | + | |

- | If you would like to read about neighborhood selection, you can read the following FAQ's: | + | Example scripts: |

- | \\ | + | {{topic>statistics cluster neighbour +example &list}} |

- | [[faq:how_can_i_define_my_own_neighbourhood_template|How can I define my own neighbourhood templates or updating an already existing template?]] | + | |

- | \\ | + | |

- | [[faq:how_can_i_define_neighbouring_sensors|How can I define neighbouring sensors?]] | + | |

- | \\ | + | |

- | [[faq:how_does_ft_prepare_neighbours_work|How does ft_prepare_neighbours work?]] | + | |

- | \\ | + | |

- | | + | |

- | Or you can look also at the following example scripts: | + | |

- | \\ | + | |

- | [[example:apply_clusterrandanalysis_on_tfrs_of_power_that_were_computed_with_besa|Apply clusterrandanalysis on TFRs of power that were computed with BESA]] | + | |

- | \\ | + | |

- | [[example:source_statistics|Source statistics]] | + | |

- | \\ | + | |

- | [[example:stratify|Stratify the distribution of one variable that differs in two conditions]] | + | |

- | \\ | + | |

- | [[example:statistics_toolbox|Using the MATLAB statistics toolbox]] | + | |

----- | ----- | ||

- | This tutorial was last tested by Jörn, with version 20110507 of FieldTrip, using Matlab 2009b on a Windows 7 platform. | + | This tutorial was last tested by Jan-Mathijs, with version 20130301 of FieldTrip, using Matlab 2011a on a Windows 7 platform. |

This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.

Share this page: