R/mqqnorm.R

Defines functions mqqnorm

Documented in mqqnorm

# car: qqPlot

mqqnorm <- function(x,main="Multi-normal Q-Q Plot") {
  if (!is.matrix(x)) {x <- as.matrix(x)}
  distances <- mahalanobis(x,colMeans(x),cov(x))
  car::qqPlot(distances,distribution="chisq",df=mean(distances),lwd=1,grid=FALSE,
    main=main,xlab=expression(chi^2 * " quantiles"),
    ylab=expression("Mahalanobis distances "^2))
}

Try the RVAideMemoire package in your browser

Any scripts or data that you put into this service are public.

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.