Learn R Programming

Morpho (version 2.1)

qqmat: Q-Q plot to assess normality of data

Description

qqmat plots Mahalanobisdistances of a given sample against those expected from a Gaussian distribution

Usage

qqmat(x, output = FALSE, square = TRUE)

Arguments

x
sample data: matrix or vector
output
logical: if TRUE results are returned
square
plot in a square window - outliers might be cut off.

Value

  • if output=TRUE, the following values are returned
  • xdistances from an expected Gaussian distribution
  • yobserved distances - sorted
  • dobserved distances - unsorted

See Also

qqplot

Examples

Run this code
require(MASS)
### create normally distributed data
data <- mvrnorm(100,mu=rep(0,5),Sigma = diag(5:1))
qqmat(data)

###create non normally distributed data
data1 <- rchisq(100,df=3)
qqmat(data1,square=FALSE)

Run the code above in your browser using DataLab