QQplot: QQplot with a Linear Fit

View source: R/QQplot.R

QQplotR Documentation

QQplot with a Linear Fit

Description

Qantile-quantile plot with a linear fit

Usage

QQplot(X,Y,Type=8,NoQuantiles=10000,xlab, ylab,col="red",main='',
lwd=3,pch=20,subplot=FALSE,...)

Arguments

X

[1:n] numerical vector, First Feature

Y

1:n] numerical vector, Second Feature to compare first feature with

Type

an integer between 1 and 9 selecting one of the nine quantile algorithms detailed in quantile

NoQuantiles

number of quantiles used in QQ-plot, if number is low and the data has outliers, there may be empty space visible in the plot

xlab

x label, see plot ...

ylab

y label, see plot

col

color of line, see plot

main

title of plot, see plot

lwd

line width of plot, see plot

pch

type of point, see plot

subplot

FALSE: par is set specifically, TRUE: assumption is the usage as a subfigure, par has to be set by the user, no checks are performed, labels have to be set by the user

...

other parameters for qqplot

Details

Output is the evaluation of a linear (regression) fit of lm called 'line' and a quantile quantile plot (QQplot). Per default 10.000 quantiles are chosen, but in the case of very large data vectors one can reduce the quantiles for faster computation. The 100 percentiles used for the regression line are of darker blue than the quantiles chosen by the user.

Value

List with

Quantiles

[1:NoQuantiles,1:2] quantiles in y and y

Residuals

Output of the Regression with residuals.lm(line)

Summary

Output of the Regression with summaryline)

Anova

Output of the Regression with anova(line)

Author(s)

Michael Thrun

References

Michael, J. R.: The stabilized probability plot, Biometrika, Vol. 70(1), pp. 11-17, 1983.

Examples

data(MTY)
NormalDistribution=rnorm(50000)
QQplot(NormalDistribution,MTY)

Mthrun/DataVisualizations documentation built on Jan. 16, 2024, 1:01 a.m.