Description Usage Arguments Details Value Examples
View source: R/qq_line_coeffs.R
Compute a slope and an intercept for a reference line ("qq-line") in a quantile comparison plot given a vector of data an a theoretical distribution.
1 2 3 4 5 6 7 8 9 | qq_line_coeffs(
y,
datax = FALSE,
distribution = qnorm,
probs = c(0.25, 0.75),
qtype = 7,
na.rm = TRUE,
...
)
|
y |
(numeric) A numeric vector. |
datax |
logical. Should data values be on the x-axis? |
distribution |
quantile function for reference theoretical distribution. |
probs |
numeric vector of length two, representing probabilities. Corresponding quantile pairs define the line drawn. |
qtype |
the |
na.rm |
logical; if true, any |
... |
Further arguments for |
The code is based on code of qqline()
in package stats.
But instead of plotting a reference line, it returns its coefficients.
A vector with a slope
and an intercept
for a qq-line.
1 2 3 4 | set.seed(254)
x <- rnorm(50)
qq_line_coeffs(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.