qqplot.m

来自「一个非常实用的统计工具箱」· M 代码 · 共 27 行

M
27
字号
function qqplot(x,y,ps);%QQPLOT   Plot empirical quantile vs empirical quantile %%         qqplot(x,y,ps)%%         If two distributions are the same (or possibly linearly %	  transformed) the points should form an approximately straight %	  line. Data is x and y. Third argument ps is an optional plot %	  symbol.%%         See also QQNORMif nargin<3, ps = '*'; endx = sort(x);y = sort(y);if length(x) < length(y)   n = length(x);   plot(x, quantile(y, ((1:n)-0.5)/n, 1), ps)elseif length(y) < length(x)   n = length(y);   plot(quantile(x, ((1:n)-0.5)/n, 1), y, ps)else   plot(x,y,ps)endxlabel('Data X')ylabel('Data Y')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?