%%%Plots a Bland-Altman Plot
%%% var1 and var2 - vectors of the measurements
%%%flag - how much you want to plot
%%% 0 = no plot
%%% 1 = just the data
%%% 2 = data and the difference and CR lines
%%% 3 = above and a linear fit
%%% means = the means of the data
%%% diffs = the raw differences
%%% meanDiff = the mean difference
%%% CR = the 2SD confidence limits
%%% linfit = the paramters for the linear fit
David Cumin (2021). Bland Altman Plot (https://www.mathworks.com/matlabcentral/fileexchange/24645-bland-altman-plot), MATLAB Central File Exchange. Retrieved .
For those wondering: the page Pete referred to has changed since then to match this code (and the paper), so it no longer shows N-1. See archive.org: http://web.archive.org/web/20140222030127/https://www.medcalc.org/manual/blandaltman.php
I think your calculation of the CR is off (standard deviation is usually corrected by N-1 when using the sample-population. Cf. http://www.medcalc.org/manual/blandaltman.php)
Good! I need it.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!