<html lang="en"> <head> <title>Statistical Plots - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Statistics.html#Statistics" title="Statistics"> <link rel="prev" href="Basic-Statistical-Functions.html#Basic-Statistical-Functions" title="Basic Statistical Functions"> <link rel="next" href="Tests.html#Tests" title="Tests"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Statistical-Plots"></a> <p> Next: <a rel="next" accesskey="n" href="Tests.html#Tests">Tests</a>, Previous: <a rel="previous" accesskey="p" href="Basic-Statistical-Functions.html#Basic-Statistical-Functions">Basic Statistical Functions</a>, Up: <a rel="up" accesskey="u" href="Statistics.html#Statistics">Statistics</a> <hr> </div> <h3 class="section">25.3 Statistical Plots</h3> <!-- Should hist be moved to here, or perhaps the qqplot and ppplot --> <!-- functions should be moved to the Plotting Chapter? --> <p>Octave can create Quantile Plots (QQ-Plots), and Probability Plots (PP-Plots). These are simple graphical tests for determining if a data set comes from a certain distribution. <p>Note that Octave can also show histograms of data using the <code>hist</code> function as described in <a href="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots">Two-Dimensional Plots</a>. <!-- ./statistics/base/qqplot.m --> <p><a name="doc_002dqqplot"></a> <div class="defun"> — Function File: [<var>q</var>, <var>s</var>] = <b>qqplot</b> (<var>x, dist, params</var>)<var><a name="index-qqplot-1863"></a></var><br> <blockquote><p>Perform a QQ-plot (quantile plot). <p>If F is the CDF of the distribution <var>dist</var> with parameters <var>params</var> and G its inverse, and <var>x</var> a sample vector of length <var>n</var>, the QQ-plot graphs ordinate <var>s</var>(<var>i</var>) = <var>i</var>-th largest element of x versus abscissa <var>q</var>(<var>i</var>f) = G((<var>i</var> - 0.5)/<var>n</var>). <p>If the sample comes from F except for a transformation of location and scale, the pairs will approximately follow a straight line. <p>The default for <var>dist</var> is the standard normal distribution. The optional argument <var>params</var> contains a list of parameters of <var>dist</var>. For example, for a quantile plot of the uniform distribution on [2,4] and <var>x</var>, use <pre class="example"> qqplot (x, "uniform", 2, 4) </pre> <p class="noindent"><var>dist</var> can be any string for which a function <var>dist_inv</var> that calculates the inverse CDF of distribution <var>dist</var> exists. <p>If no output arguments are given, the data are plotted directly. </p></blockquote></div> <!-- ./statistics/base/ppplot.m --> <p><a name="doc_002dppplot"></a> <div class="defun"> — Function File: [<var>p</var>, <var>y</var>] = <b>ppplot</b> (<var>x, dist, params</var>)<var><a name="index-ppplot-1864"></a></var><br> <blockquote><p>Perform a PP-plot (probability plot). <p>If F is the CDF of the distribution <var>dist</var> with parameters <var>params</var> and <var>x</var> a sample vector of length <var>n</var>, the PP-plot graphs ordinate <var>y</var>(<var>i</var>) = F (<var>i</var>-th largest element of <var>x</var>) versus abscissa <var>p</var>(<var>i</var>) = (<var>i</var> - 0.5)/<var>n</var>. If the sample comes from F, the pairs will approximately follow a straight line. <p>The default for <var>dist</var> is the standard normal distribution. The optional argument <var>params</var> contains a list of parameters of <var>dist</var>. For example, for a probability plot of the uniform distribution on [2,4] and <var>x</var>, use <pre class="example"> ppplot (x, "uniform", 2, 4) </pre> <p class="noindent"><var>dist</var> can be any string for which a function <var>dist_cdf</var> that calculates the CDF of distribution <var>dist</var> exists. <p>If no output arguments are given, the data are plotted directly. </p></blockquote></div> </body></html>