stat_pp_line {qqplotr} | R Documentation |
Probability-probability lines
Description
Draws a probability-probability line.
Usage
stat_pp_line(
mapping = NULL,
data = NULL,
geom = "path",
position = "identity",
na.rm = TRUE,
show.legend = NA,
inherit.aes = TRUE,
ab = c(0, 1),
detrend = FALSE,
...
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use to display the data, either as a
|
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
ab |
Numeric vector of length two. The intercept ( |
detrend |
Logical. Should the plot objects be detrended? If |
... |
Other arguments passed on to |
Examples
# generate random Normal data
set.seed(0)
smp <- data.frame(norm = rnorm(100))
# Normal P-P plot of Normal data
gg <- ggplot(data = smp, mapping = aes(sample = norm)) +
stat_pp_line() +
stat_pp_point() +
labs(x = "Probability Points", y = "Cumulative Probability")
gg
# Shifted Normal P-P plot of Normal data
dp <- list(mean = 1.5)
gg <- ggplot(data = smp, mapping = aes(sample = norm)) +
stat_pp_line() +
stat_pp_point(dparams = dp) +
labs(x = "Probability Points", y = "Cumulative Probability")
gg
# Normal P-P plot of mean ozone levels (airquality dataset)
dp <- list(mean = 38, sd = 27)
gg <- ggplot(data = airquality, mapping = aes(sample = Ozone)) +
stat_pp_line() +
stat_pp_point(dparams = dp) +
labs(x = "Probability Points", y = "Cumulative Probability")
gg