qqPlot: Quantile-Comparison Plot in car: Companion to Applied Regression (2024)

qqPlotR Documentation

Quantile-Comparison Plot

Description

Plots empirical quantiles of a variable, or of studentized residuals froma linear model, against theoretical quantiles of a comparison distribution. Includesoptions not available in the qqnorm function.

Usage

qqPlot(x, ...)qqp(...)## Default S3 method:qqPlot(x, distribution="norm", groups, layout, ylim=range(x, na.rm=TRUE), ylab=deparse(substitute(x)), xlab=paste(distribution, "quantiles"), glab=deparse(substitute(groups)), main=NULL, las=par("las"), envelope=TRUE, col=carPalette()[1], col.lines=carPalette()[2], lwd=2, pch=1, cex=par("cex"), line=c("quartiles", "robust", "none"), id=TRUE, grid=TRUE, ...)## S3 method for class 'formula'qqPlot(formula, data, subset, id=TRUE, ylab, glab, ...)## S3 method for class 'lm'qqPlot(x, xlab=paste(distribution, "Quantiles"), ylab=paste("Studentized Residuals(", deparse(substitute(x)), ")", sep=""), main=NULL, distribution=c("t", "norm"), line=c("robust", "quartiles", "none"), las=par("las"), simulate=TRUE, envelope=TRUE, reps=100, col=carPalette()[1], col.lines=carPalette()[2], lwd=2, pch=1, cex=par("cex"), id=TRUE, grid=TRUE, ...)

Arguments

x

vector of numeric values or lm object.

distribution

root name of comparison distribution – e.g., "norm" for thenormal distribution; t for the t-distribution.

groups

an optional factor; if specified, a QQ plot will be drawn for xwithin each level of groups.

layout

a 2-vector with the number of rows and columns for plotting bygroups – for example c(1, 3) for 1 row and 3 columns; if omitted, thenumber of rows and columns will be selected automatically; the specified numberof rows and columns must be sufficient to accomodate the number of groups; ignoredif there is no grouping factor.

formula

one-sided formula specifying a single variable to be plotted or a two-sided formula ofthe form variable ~ factor, where a QQ plot will be drawn for variable within eachlevel of factor.

data

optional data frame within which to evaluage the formula.

subset

optional subset expression to select cases to plot.

ylim

limits for vertical axis; defaults to the range of x. If plotting by groups, a commony-axis is used for all groups.

ylab

label for vertical (empirical quantiles) axis.

xlab

label for horizontal (comparison quantiles) axis.

glab

label for the grouping variable.

main

label for plot.

envelope

TRUE (the default), FALSE, a confidence level such as 0.95, or a list specifying how to plot a point-wise confidence envelope (see Details).

las

if 0, ticks labels are drawn parallel to theaxis; set to 1 for horizontal labels (see par).

col

color for points; the default is the first entryin the current car palette (see carPaletteand par).

col.lines

color for lines; the default is the second entryin the current car palette.

pch

plotting character for points; default is 1(a circle, see par).

cex

factor for expanding the size of plotted symbols; the default is1.

id

controls point identification; if FALSE, no points are identified;can be a list of named arguments to the showLabels function;TRUE is equivalent to list(method="y", n=2, cex=1, col=carPalette()[1], location="lr"),which identifies the 2 points with the 2 points with the most extremeverical values — studentized residuals for the "lm" method. Points labels are by defaulttaken from the names of the variable being plotted is any, else case indices are used. Unlike most graphical functions in car, the default is id=TRUE to include point identification.

lwd

line width; default is 2 (see par).

line

"quartiles" to pass a line through the quartile-pairs, or"robust" for a robust-regression line; the latter uses the rlmfunction in the MASS package. Specifying line = "none" suppresses the line.

simulate

if TRUE calculate confidence envelope by parametric bootstrap;for lm object only. The method is due to Atkinson (1985).

reps

integer; number of bootstrap replications for confidence envelope.

...

arguments such as df to be passed to the appropriate quantile function.

grid

If TRUE, the default, a light-gray background grid is put on thegraph

Details

Draws theoretical quantile-comparison plots for variables and for studentized residualsfrom a linear model. A comparison line is drawn on the plot either through the quartilesof the two distributions, or by robust regression.

Any distribution for which quantile anddensity functions exist in R (with prefixes q and d, respectively) may be used.When plotting a vector, the confidence envelope is based on the SEs of the order statisticsof an independent random sample from the comparison distribution (see Fox, 2016).Studentized residuals from linear models are plotted against the appropriate t-distribution with a point-wiseconfidence envelope computed by default by a parametric bootstrap,as described by Atkinson (1985).The function qqp is an abbreviation for qqPlot.

The envelope argument can take a list with the following named elements; if an element is missing, then the default value is used:

level

confidence level (default 0.95).

style

one of "filled" (the default), "lines", or "none".

col

color (default is the value of col.lines).

alpha

transparency/opacity of a filled confidence envelope, a number between 0 and 1 (default 0.15).

border

controls whether a border is drawn around a filled confidence envelope (default TRUE).

Value

These functions return the labels of identified points, unless a grouping factor is employed,in which case NULL is returned invisibly.

Author(s)

John Fox [email protected]

References

Fox, J. (2016)Applied Regression Analysis and Generalized Linear Models,Third Edition. Sage.

Fox, J. and Weisberg, S. (2019)An R Companion to Applied Regression, Third Edition, Sage.

Atkinson, A. C. (1985)Plots, Transformations, and Regression. Oxford.

See Also

qqplot, qqnorm,qqline, showLabels

Examples

x<-rchisq(100, df=2)qqPlot(x)qqPlot(x, dist="chisq", df=2, envelope=list(style="lines"))qqPlot(~ income, data=Prestige, subset = type == "prof")qqPlot(income ~ type, data=Prestige, layout=c(1, 3))qqPlot(lm(prestige ~ income + education + type, data=Duncan),envelope=.99)
qqPlot: Quantile-Comparison Plot in car: Companion to Applied Regression (2024)

FAQs

What does a quantile-quantile graph do for you in a regression analysis? ›

The QQ plot, or quantile-quantile plot, is a graphical tool to help us assess if a set of data plausibly came from some theoretical distribution such as a normal or exponential.

How to interpret quantile-quantile plot? ›

Interpreting QQ plots is intuitive. When all the dots generally follow the straight line y = x, the sample distribution is similar to the theoretical one. The data points don't have to fall right on the line. Instead, they only need to follow a line generally—with random variability placing them above and below it.

How do you interpret a Q-Q plot in linear regression? ›

A q-q plot is a plot of the quantiles of the first data set against the quantiles of the second data set. Below are the possible interpretations for two data sets. b) Y-values < X-values: If y-quantiles are lower than the x-quantiles. c) X-values < Y-values: If x-quantiles are lower than the y-quantiles.

What does a quantile-quantile or Q-Q plot compare? ›

Quantile-quantile plots allow us to compare the quantiles of two sets of numbers. This kind of comparison is much more detailed than a simple comparison of means or medians. There is a cost associated with this extra detail. We need more observations than for simple comparisons.

What does quantile regression tell you? ›

The main advantage of quantile regression methodology is that the method allows for understanding relationships between variables outside of the mean of the data,making it useful in understanding outcomes that are non-normally distributed and that have nonlinear relationships with predictor variables.

What is an acceptable Q-Q plot? ›

Points on the Normal QQ plot provide an indication of univariate normality of the dataset. If the data is normally distributed, the points will fall on the 45-degree reference line. If the data is not normally distributed, the points will deviate from the reference line.

Why is a Q-Q plot important? ›

Q-Q plots are used to find the type of distribution for a random variable whether it be a Gaussian distribution, uniform distribution, exponential distribution or even a Pareto distribution. You can tell the type of distribution using the power of the Q-Q plot just by looking at it.

What does a Q-Q plot of residuals tell you? ›

Normal Q-Q Plot: This is used to assess if your residuals are normally distributed. basically what you are looking for here is the data points closely following the straight line at a 45% angle upwards (left to right).

Which assumption of multiple regression is most likely evaluated using a Q-Q plot? ›

Second, the multiple linear regression analysis requires that the errors between observed and predicted values (i.e., the residuals of the regression) should be normally distributed. This assumption may be checked by looking at a histogram or a Q-Q-Plot.

What should my quantile score be? ›

For example, a student's Quantile measure should be at 1350Q by high school graduation to handle the math needed in college and most careers. A student Quantile measure helps you to know: Which skills and concepts students are ready to learn.

How do you compare two distributions in Q-Q plot? ›

Q-Q plots can be used to compare two distributions to see if they are similar or different. If the two distributions are similar, the Q-Q plot will show the data points falling close to the straight line. If the two distributions are different, the Q-Q plot will show the data points deviating from the straight line.

What is a chi square quantile quantile plot? ›

A chi square quantile-quantile plots show the relationship between data-based values which should be distributed as χ2 and corresponding quantiles from the χ2 distribution.

What does the quantile function tell you? ›

Intuitively, the quantile function associates with a range at and below a probability input the likelihood that a random variable is realized in that range for some probability distribution.

Why you should care about quantile regression? ›

Quantile regression can provide more insight into the experiment than ANOVA, with the additional benefit of being applicable to data from any distribution.

What does the QQ residuals plot tell us? ›

Use a Q-Q plot with standardized residuals from the model to assess normality visually. A Q-Q (quantile-quantile) plot shows how two distributions' quantiles line up, with our theoretical distribution (e.g., the normal distribution) as the x variable and our model residuals as the y variable.

Top Articles
Supply chain software Top 10 suppliers - Supply Chain 24/7
Top 11 Supply Chain Management (SCM) Software for Businesses of All Sizes
Parke County Chatter
COLA Takes Effect With Sept. 30 Benefit Payment
Costco in Hawthorne (14501 Hindry Ave)
Moe Gangat Age
What’s the Difference Between Cash Flow and Profit?
UEQ - User Experience Questionnaire: UX Testing schnell und einfach
Truck Toppers For Sale Craigslist
This Modern World Daily Kos
Kris Carolla Obituary
Finger Lakes Ny Craigslist
Lazarillo De Tormes Summary and Study Guide | SuperSummary
Violent Night Showtimes Near Amc Fashion Valley 18
Divina Rapsing
Msu 247 Football
Ahrefs Koopje
Craigslist Prescott Az Free Stuff
*Price Lowered! This weekend ONLY* 2006 VTX1300R, windshield & hard bags, low mi - motorcycles/scooters - by owner -...
Soulstone Survivors Igg
Home
Craigslist Pennsylvania Poconos
Southland Goldendoodles
Violent Night Showtimes Near Amc Dine-In Menlo Park 12
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Is Light Raid Hard
Ardie From Something Was Wrong Podcast
Kqelwaob
San Jac Email Log In
3 Ways to Format a Computer - wikiHow
Redbox Walmart Near Me
Used 2 Seater Go Karts
Alima Becker
2430 Research Parkway
Wbli Playlist
RUB MASSAGE AUSTIN
Ark Unlock All Skins Command
The Mad Merchant Wow
October 31St Weather
Toth Boer Goats
Cookie Clicker The Advanced Method
301 Priest Dr, KILLEEN, TX 76541 - HAR.com
Shipping Container Storage Containers 40'HCs - general for sale - by dealer - craigslist
Mychart Mercy Health Paducah
Gander Mountain Mastercard Login
Dietary Extras Given Crossword Clue
A Snowy Day In Oakland Showtimes Near Maya Pittsburg Cinemas
M Life Insider
Spongebob Meme Pic
Loss Payee And Lienholder Addresses And Contact Information Updated Daily Free List Bank Of America
Latest Posts
Article information

Author: Sen. Ignacio Ratke

Last Updated:

Views: 5985

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Sen. Ignacio Ratke

Birthday: 1999-05-27

Address: Apt. 171 8116 Bailey Via, Roberthaven, GA 58289

Phone: +2585395768220

Job: Lead Liaison

Hobby: Lockpicking, LARPing, Lego building, Lapidary, Macrame, Book restoration, Bodybuilding

Introduction: My name is Sen. Ignacio Ratke, I am a adventurous, zealous, outstanding, agreeable, precious, excited, gifted person who loves writing and wants to share my knowledge and understanding with you.