get_qq_band {qqconf} | R Documentation |
Create QQ Plot Testing Band
Description
Flexible interface for creating a testing band for a Quantile-Quantile (QQ) plot.
Usage
get_qq_band(
n,
obs,
alpha = 0.05,
distribution = qnorm,
dparams = list(),
ell_params = list(),
band_method = c("ell", "ks", "pointwise"),
prob_pts_method = c("best_available", "normal", "uniform", "median")
)
Arguments
n , obs |
either a number of observations (specified by setting |
alpha |
(optional) desired significance level of the testing band. If |
distribution |
The quantile function for the specified distribution.
Defaults to |
dparams |
(optional) List of additional arguments for the |
ell_params |
(optional) list of optional arguments for |
band_method |
(optional) method for creating the testing band. The default,
|
prob_pts_method |
(optional) method used to get probability points for
use in a QQ plot. The quantile function will be applied to these points to
get the expected values. When this argument is set to |
Value
A list with components
lower_bound - Numeric vector of length
n
containing the lower bounds for the acceptance regions of the test corresponding to each order statistic. These form the lower boundary of the testing band for the QQ-plot.upper_bound - Numeric vector of length
n
containing the upper bounds for the acceptance regions of the test corresponding to each order statistic. These form the upper boundary of the testing band for the QQ-plot.expected_value - Numeric vector of length
n
containing the exact or approximate expectation (or median) of each order statistic, depending on howprob_pts_method
is set. These are the x-coordinates for both the bounds and the data points if used in a qq-plot. Note that if adding a band to an already existing plot, it is essential that the same x-coordinates be used for the bounds as were used to plot the data. Thus, if some other x-coordinates have been used to plot the data those same x-coordinates should always be used instead of this vector to plot the bounds.dparams - List of arguments used to apply
distribution
toobs
(if observations are provided). If the user provides parameters, then these parameters will simply be returned. If parameters are estimated from the data, then the estimated parameters will be returned.
Examples
# Get ell level .05 QQ testing band for normal(0, 1) distribution with 100 observations
band <- get_qq_band(n = 100)
# Get ell level .05 QQ testing band for normal distribution with unknown parameters
obs <- rnorm(100)
band <- get_qq_band(obs = obs)
# Get ell level .05 QQ testing band for t(2) distribution with 100 observations
band <- get_qq_band(
n = 100, distribution = qt, dparams = list(df = 2)
)