The Quantile-Quantile Plot or (Q-Q Plot) is defined as a value of two variables that are plotted corresponding to each other and check whether the distributions of two variables are similar or not with respect to the locations. qqline() function in R Language is used to draw a Q-Q Line Plot.
Syntax: qqline(x, y, col)
Parameters:
x, y: X and Y coordinates of plot
col: It defines colorReturns: A QQ Line plot of the coordinates provided
Example 1: Implementation of Basic QQplot Interpretation
# Set seed for reproducibility set.seed(500) # Create random normally distributed values x <- rnorm(1200) # QQplot of normally distributed values qqnorm(x) # Add qqline to plot qqline(x, col = "darkgreen") |
Output:

Above is a representation of QQplot of Normally Distributed Random Numbers.
Example 2: Implementation of QQplot of Logistically Distributed Values
# Set seed for reproducibility # Random values according to logistic distribution # QQplot of logistic distribution y <- rlogis(800) # QQplot of normally distributed values qqnorm(y) # Add qqline to plot qqline(y, col = "darkgreen") |
Output:

Above is the Q-Q Plot of theoretical quantiles.
Recommended Posts:
- Set Aspect Ratio of Scatter Plot and Bar Plot in R Programming - Using asp in plot() Function
- Plot Arrows Between Points in a Graph in R Programming - arrows() Function
- Plot a Geometric Distribution Graph in R Programming - dgeom() Function
- Create a Plot Matrix of Scatterplots in R Programming - pairs() Function
- Adding axis to a Plot in R programming - axis () Function
- Adding Straight Lines to a Plot in R Programming - abline() Function
- Plotting of Data using Generic plots in R Programming - plot() Function
- Get a List of all the 657 colors in R Programming - colors() Function
- Get the Hexadecimal Code of the Specified Shade in R Programming - rgb() Function
- Adding Text to Plots in R programming - text() and mtext () Function
- Create One Dimensional Scatterplots in R Programming - stripchart() Function
- Create Dot Charts in R Programming - dotchart () Function
- Plotting of Data using Generic plots in R Programming - plot() Function
- Create One Dimensional Scatterplots in R Programming - stripchart() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

