Statistical Significance

Add statistical significance lines and asterisks to an existing plot
378 téléchargements
Mise à jour 21 mai 2021

Afficher la licence

This script gets an axis handle and a 4D matrix (stats) and plots significance lines and asterisks on top.
Significance lines and asterisks are added only for pairs assigned with a positive value (the number of asterisks) in stats. For non-integer values, the p-value is displayed instead.
To set the stats matrix, simply initialize a 4D matrix with the first two dimensions corresponding to categories, and the last two dimensions to groups (see the examples file).
Then, assign the number of asterisks (or p-value) to the relevant pairs. For example:
stats = zeros(5,5,4,4); % Initialize the stats matrix for 5 categories and 4 groups.
stats(1,3,1,2) = 2; % Add a significance line and two asterisks between the bar of category 1, group 1, and the bar of category 3, group 2.
This script takes into account error bars when adding significance lines, and can also deal with bar plots generated using the 'hist' parameter (see example 2).

Citation pour cette source

Omer Yuval (2024). Statistical Significance (https://www.mathworks.com/matlabcentral/fileexchange/92613-statistical-significance), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2020b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0