QQplot is a generic function that produces QQ plot of two datasets, distribution and dataset or two distributions.
QQplot(
d1,
d2,
line = TRUE,
col = "#122e94",
line_col = "#f28df9",
xlab = deparse(substitute(d1)),
ylab,
main = "Q-Q plot",
lwd = 2,
...
)# S3 method for default
QQplot(
d1,
d2,
line = TRUE,
col = "#122e94",
line_col = "#f28df9",
xlab = deparse(substitute(d1)),
ylab = deparse(substitute(d2)),
main = "Q-Q plot",
lwd = 2,
...
)
# S3 method for dist
QQplot(
d1,
d2,
line = TRUE,
col = "#122e94",
line_col = "#f28df9",
xlab = deparse(substitute(d1)),
ylab = ylabe,
main = "Q-Q plot",
lwd = 2,
CI = re,
conf = 0.95,
n = 100,
CI_col = "grey80",
...
)
QQnorm(d2, xlab = "Standard Normal", ylab = deparse(substitute(d2)), ...)
distribution object or dataset.
distribution object or dataset.
if qqline should be included, default: TRUE.
color of points, default: '#122e94'.
color of qqline, default: '#f28df9'.
xlab, default: deparse(substitute(d1)).
ylab, default: deparse(substitute(d2)).
title, default: 'Q-Q plot'.
lwd of qqline, default: 2.
further arguments to be passed.
if confidence bound should be included.
confidence level for confidence bound, default: 0.95.
number of points at which quantile functions are evaluated if two distributions are compared, default: 100.
color of confidence bound, default: 'grey80'.
QQplot
is able to compare any combination of dataset and distributions.
QQnorm
is a wrapper around QQplot
, where d1 is set to normdist()
.
If quantiles of a continuous distribution are compared with a sample, a confidence bound for data is offered. This confidence "envelope" is based on the asymptotic results of the order statistics. For more details see https://en.wikipedia.org/wiki/Order_statistic.
# sample vs sample
QQplot(r(normdist(), 10000), r(tdist(df = 4), 10000))
# distribution vs sample
QQplot(normdist(), r(tdist(df = 4), 10000))
# distribution vs distribution
QQplot(normdist(), tdist(df = 4))
Run the code above in your browser using DataLab