This function creates a qq-plot with a confidence interval.
ggqq( x, distribution = "norm", ..., ci = TRUE, line.estimate = NULL, conf.level = 0.95, sampleSizeOverride = NULL, observedOnX = TRUE, scaleExpected = TRUE, theoryLab = "Theoretical quantiles", observeLab = "Observed quantiles", theme = ggplot2::theme_bw() )
A vector containing the values to plot.
Any additional arguments are passed to the quantile function
qnorm). Because of these dots, any following arguments
must be named explicitly.
Whether to show the confidence interval.
Whether to show the line showing the match with the specified distribution (e.g. the normal distribution).
THe confidence of the confidence leven arround the estimate for the specified distribtion.
It can be desirable to get the confidence
intervals for a different sample size (when the sample size is very large,
for example, such as when this plot is generated by the function
normalityAssessment). That different sample size can be
Whether to plot the observed values (if
the theoretically expected values (if
FALSE) on the X axis. The other
is plotted on the Y axis.
Whether the scale the expected values to match the scale of the variable. This option is provided to be able to mimic SPSS' Q-Q plots.
The label for the theoretically expected values (on the Y axis by default).
The label for the observed values (on the Y axis by default).
The theme to use.
ggplot plot is returned.
This is strongly based on the answer by user Floo0 to a Stack Overflow
question at Stack Exchange (see
also posted at GitHub (see
https://gist.github.com/rentrop/d39a8406ad8af2a1066c). That code is in
turn based on the
qqPlot() function from the