Skip to Main Content Skip to Search
Product Documentation

qqplot - Quantile-quantile plot

Syntax

qqplot(X)
qqplot(X,Y)
qqplot(X,PD)
qqplot(X,Y,pvec)
h = qqplot(X,Y,pvec)

Description

qqplot(X) displays a quantile-quantile plot of the sample quantiles of X versus theoretical quantiles from a normal distribution. If the distribution of X is normal, the plot will be close to linear.

qqplot(X,Y) displays a quantile-quantile plot of two samples. If the samples do come from the same distribution, the plot will be linear.

qqplot(X,PD) makes an empirical quantile-quantile plot of the quantiles of the data in the vector X versus the quantiles of the distribution specified by PD, a ProbDist object of the ProbDistUnivParam class or ProbDistUnivKernel class.

For matrix X and Y, qqplot displays a separate line for each pair of columns. The plotted quantiles are the quantiles of the smaller data set.

The plot has the sample data displayed with the plot symbol '+'. Superimposed on the plot is a line joining the first and third quartiles of each distribution (this is a robust linear fit of the order statistics of the two samples). This line is extrapolated out to the ends of the sample to help evaluate the linearity of the data.

Use qqplot(X,Y,pvec) to specify the quantiles in the vector pvec.

h = qqplot(X,Y,pvec) returns handles to the lines in h.

Examples

The following example shows a quantile-quantile plot of two samples from Poisson distributions.

x = poissrnd(10,50,1);
y = poissrnd(5,100,1);
qqplot(x,y);

How To

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS