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).
인용 양식
Omer Yuval (2024). Statistical Significance (https://www.mathworks.com/matlabcentral/fileexchange/92613-statistical-significance), MATLAB Central File Exchange. 검색 날짜: .
MATLAB 릴리스 호환 정보
개발 환경:
R2020b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!버전 | 게시됨 | 릴리스 정보 | |
---|---|---|---|
1.0.0 |