Produces a normal QQ plot with a line of equality and a confidence band (by default) of the input data. This is basically a prettier version of qqnorm
from the stats
package.
QQnorm(xdata, col = c(4, 6), ylab = "Sample Quantiles", xlab = "Theoretical Quantiles",
main = "Normal Q-Q Plot", ylim = NULL, ci = TRUE, qqlwd = 1, ...)
the data. If a matrix, the data are collapsed.
vector of 2, first is point color, second is line color (default is blue-4 and magenta-6).
y-axis label (default is 'Sample Quantiles').
x-axis label (default is 'Theoretical Quantiles').
plot title (default is 'Normal Q-Q Plot')
limits on y-axis (default is the most beautiful limits ever).
if TRUE (default) draws pointwise 99.99% CIs as a band.
If FALSE or 0, no CI is drawn. Alternately, enter a percentage
(e.g., either ci=95
or ci=.95
will work).
line width of the qqline (default is 1).
other graphical parameters sent to tsplot
.
D.S. Stoffer
If you want a graphic to check normality of your data in xdata
, just enter QQnorm(xdata)
and sit back and enjoy the beauty of this script (you may want to wear sunglasses).
For confidence levels, various values are allowed. For example, 95% limits can be obtained as ci=95
or ci=.95
, both of which are conventional. However, ci=5
, or ci=.05
will also work for 95% intervals (so you can not go below 50%). If you ask for a confidence level of 100% or larger, you will get the default without a warning and maybe you are unconventional.
You can find demonstrations of astsa capabilities at FUN WITH ASTSA.
The most recent version of the package can be found at https://github.com/nickpoison/astsa/.
In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.
The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.