How can I create an exponential graph of QQ in R?

How can I create an exponential graph of QQ in R? For the normal QQ section, I use

qqnorm(sample)
+4
source share
3 answers

EDIT (To reflect @Dason's input).

Like this:

set.seed(1)          # for reproducibility 
Z <- rexp(1000)      # random sample from exponential distribution
p <- ppoints(100)    # 100 equally spaced points on (0,1), excluding endpoints
q <- quantile(Z,p=p) # percentiles of the sample distribution
plot(qexp(p) ,q, main="Exponential Q-Q Plot",
     xlab="Theoretical Quantiles",ylab="Sample Quantiles")
qqline(q, distribution=qexp,col="blue", lty=2)
+6
source

Here is the solution ggplot2.

Z <- rexp(1000, rate = 2)
library(MASS)
params <- as.list(fitdistr(Z, "exponential")$estimate)

library(ggplot2)
qplot(sample = Z, geom = 'blank') +
  stat_qq(distribution = qexp, dparams = params)
+5
source

R qqplot. jlhoward "" quantile. R .

set.seed(1)
data = rnorm(100, mean=5, sd=2)
qqplot(x=qexp(ppoints(100)), y=data, main="Exponential Q-Q Plot",
       xlab="Theoretical Quantiles", ylab= "Your Data Quantiles")
qqline(data, distribution=qexp)

, R ( 10 )

, jlhoward 100 , 1000, . , , ?

+2

Source: https://habr.com/ru/post/1537359/


All Articles