View source: R/plot_quantiles.R
plot_quantiles | R Documentation |
This function plots the quantiles of two vectors against each other as either a QQ or an MD plot.
plot_quantiles( x, y, method = c("QQ", "MD"), pts = 1000L, title = ifelse(method == "QQ", "QQ Plot", "MD Plot"), xlab = NULL, ylab = NULL )
x |
Vector of numeric values. |
y |
Second vector of numeric values for comparison. |
method |
Plot quantiles against quantiles ( |
pts |
Number of points to plot. |
xlab |
Optional x-axis label. |
ylab |
Optional y-axis label. |
main |
Optional plot title. |
Quantile-quantile (QQ) and mean-difference (MD) plots visualize the relationship between two numeric vectors, or between expected and observed values for given variable. They are a quick and easy alternative to scatterplots when variables are of unequal length. They can slso help visually assess parametric goodness of fit.
x1 <- rnorm(100) x2 <- runif(500) plot_quantiles(x1, x2) plot_quantiles(x1, x2, method = "MD")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.