EVOLUTION-MANAGER
Edit File: qqnorm.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Quantile-Quantile Plots</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for qqnorm {stats}"><tr><td>qqnorm {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Quantile-Quantile Plots</h2> <h3>Description</h3> <p><code>qqnorm</code> is a generic function the default method of which produces a normal QQ plot of the values in <code>y</code>. <code>qqline</code> adds a line to a “theoretical”, by default normal, quantile-quantile plot which passes through the <code>probs</code> quantiles, by default the first and third quartiles. </p> <p><code>qqplot</code> produces a QQ plot of two datasets. </p> <p>Graphical parameters may be given as arguments to <code>qqnorm</code>, <code>qqplot</code> and <code>qqline</code>. </p> <h3>Usage</h3> <pre> qqnorm(y, ...) ## Default S3 method: qqnorm(y, ylim, main = "Normal Q-Q Plot", xlab = "Theoretical Quantiles", ylab = "Sample Quantiles", plot.it = TRUE, datax = FALSE, ...) qqline(y, datax = FALSE, distribution = qnorm, probs = c(0.25, 0.75), qtype = 7, ...) qqplot(x, y, plot.it = TRUE, xlab = deparse(substitute(x)), ylab = deparse(substitute(y)), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>The first sample for <code>qqplot</code>.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>The second or only data sample.</p> </td></tr> <tr valign="top"><td><code>xlab, ylab, main</code></td> <td> <p>plot labels. The <code>xlab</code> and <code>ylab</code> refer to the y and x axes respectively if <code>datax = TRUE</code>.</p> </td></tr> <tr valign="top"><td><code>plot.it</code></td> <td> <p>logical. Should the result be plotted?</p> </td></tr> <tr valign="top"><td><code>datax</code></td> <td> <p>logical. Should data values be on the x-axis?</p> </td></tr> <tr valign="top"><td><code>distribution</code></td> <td> <p>quantile function for reference theoretical distribution.</p> </td></tr> <tr valign="top"><td><code>probs</code></td> <td> <p>numeric vector of length two, representing probabilities. Corresponding quantile pairs define the line drawn.</p> </td></tr> <tr valign="top"><td><code>qtype</code></td> <td> <p>the <code>type</code> of quantile computation used in <code><a href="quantile.html">quantile</a></code>.</p> </td></tr> <tr valign="top"><td><code>ylim, ...</code></td> <td> <p>graphical parameters.</p> </td></tr> </table> <h3>Value</h3> <p>For <code>qqnorm</code> and <code>qqplot</code>, a list with components </p> <table summary="R valueblock"> <tr valign="top"><td><code>x</code></td> <td> <p>The x coordinates of the points that were/would be plotted</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>The original <code>y</code> vector, i.e., the corresponding y coordinates <em>including <code><a href="../../base/html/NA.html">NA</a></code>s</em>.</p> </td></tr> </table> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="ppoints.html">ppoints</a></code>, used by <code>qqnorm</code> to generate approximations to expected order statistics for a normal distribution. </p> <h3>Examples</h3> <pre> require(graphics) y <- rt(200, df = 5) qqnorm(y); qqline(y, col = 2) qqplot(y, rt(300, df = 5)) qqnorm(precip, ylab = "Precipitation [in/yr] for 70 US cities") ## "QQ-Chisquare" : -------------------------- y <- rchisq(500, df = 3) ## Q-Q plot for Chi^2 data against true theoretical distribution: qqplot(qchisq(ppoints(500), df = 3), y, main = expression("Q-Q plot for" ~~ {chi^2}[nu == 3])) qqline(y, distribution = function(p) qchisq(p, df = 3), probs = c(0.1, 0.6), col = 2) mtext("qqline(*, dist = qchisq(., df=3), prob = c(0.1, 0.6))") ## (Note that the above uses ppoints() with a = 1/2, giving the ## probability points for quantile type 5: so theoretically, using ## qqline(qtype = 5) might be preferable.) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>