R/qqexp.R

"qqexp" <-
function(y, line=FALSE, ...)
{ y <- y[!is.na(y)]
  n <- length(y)
  x <- qexp(c(1:n)/(n+1))
  m <- mean(y)
  if (any(range(y)<0)) stop("Data contain negative values")
  ylim <- c(0,max(y))
  qqplot(x, y, xlab="Exponential plotting position",ylim=ylim,ylab="Ordered sample", ...)
  if (line) abline(0,m,lty=2)
  invisible()
}

Try the SMPracticals package in your browser

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

SMPracticals documentation built on May 2, 2019, 11:12 a.m.