Description Usage Arguments Details Value Author(s) References See Also Examples
Produces a normal QQ plot of data, or of residuals from a fitted model y
, with a userspecified
line to compare to "theoretical" quantiles, and global envelopes constructed
by simulating new residuals. Global envelopes are constructed using the
GET
package for simultaneous control of error rates over the whole curve.
1  qqenvelope(y, n.sim = 199, conf.level = 0.95, ylab = "Sample Quantiles", ...)

y 
can be a set of values for which we wish to check (multivariate) normality,
or it can be any object that responds to the 
n.sim 
the number of simulated sets of residuals to be generated, to which the observed residuals will be compared. The default is 199 datasets. 
conf.level 
the confidence level to use in constructing the envelope. 
ylab 

... 
further arguments sent through to 
A challenge when interpreting a qqplot
is understanding the extent to which
deviations from expected values could be due to random noise (sampling variation)
rather than actual assumption violations. This function is intended to assess this,
by simulating multiple realizations of residuals in situations where assumptions
are satisfied, and plotting a global (or "simultaneous") simulation envelope around these at level conf.level
.
All data points should lie if assumptions are satisfied, and will do so for a proportion conf.level
of
datasets which satisfy their assumptions.
This function can take data (univariate or multivariate) and check for (multivariate) normality, or it can take a fitted model and use qq plots to interrogate residuals and see if they are behaving as we would expect them to if the model were true.
The envelope is global, constructed using the GETpackage
. So if any data points lie outside the
envelope we have evidence that assumptions are not satisfied.
The GETpackage
was originally constructed to place envelopes around functions, motivated by
the problem of diagnostic testing of spatial processes (Myllymäki et al 2017), but it can equally
well be applied here, by treating sorted residuals as pointwise evaluations of a function.
For further details refer to plotenvelope
, which is called to construct the plot.
a qqplot with simulation envelope is returned, and additionally:
x 
a vector of theoretical quantiles from the standard normal sorted from smallest to largest 
y 
a vector of observed residuals sorted from smallest to largest 
lo 
lower bounds on the global simulation envelope for residuals 
hi 
upper bounds on the global simulation envelope for residuals 
p.value 
A Pvalue for the test that model assumptions are correct, using a 'parametric bootstrap' test, based on how far sample residuals depart from the values expected of them if model assumptions were satisfied. 
David Warton <david.warton@unsw.edu.au>
Myllymäki, M., Mrkvička, T., Grabarnik, P., Seijo, H. and Hahn, U. (2017), Global envelope tests for spatial processes. J. R. Stat. Soc. B, 79: 381404. doi:10.1111/rssb.12172
1 2 3 4 5 6 7 8 9 10 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.