0

I am using qqplot to compare two sets of generated data both fitted to gamma. How can I add the 95% confidence bounds to the plot?

x <- rgamma(100,shape=1,scale=1)
y <- rgamma(100,shape=1,scale=1.2)
library(car)
myqq <- function(x, y) {
rg <- range(x, y, na.rm=T)
qqplot(x, y, xlim=rg, ylim=rg)
}
myqq(x, y)
abline(0,1, col="red")
Reza
  • 147
  • 7
  • What quantity exactly do you want the confidence interval for? Are you trying to compare both to some reference gamma function? Not sure this request makes sense statistically yet. – MrFlick Jan 08 '18 at 19:08
  • I think the quantile-quantile (q-q) plot by definition is a plot of the quantiles of the first data set against the quantiles of the second data set. I need to show how much the two sets of data differ. – Reza Jan 08 '18 at 19:15
  • But here you appear to have two samples and aren't necessarily comparing it to a "standard." Every time you run `rgamma` you'll get a different set of values. This is different than `qqnorm` or `lattice::qqmath`. Are you trying to work with bootstrapped intervals or calculate the theoretical asymptotic order statistic distribution for gamma? – MrFlick Jan 08 '18 at 19:21
  • I have one set of raw data uploaded onto two different softwares. The softwares process the data and fit them to gamma distributions releasing shape and scale only. I need a measure to estimate the difference between the function of the two softwares. – Reza Jan 08 '18 at 19:26
  • 1
    That seems like an entirely different problem. I still don't exactly understand what modeling assumptions you want to make in order to calculate a confidence interval for that estimate. I think you'd be better off asking such a question on [stats.se] because it seems more statistical in nature rather than a specific programming question that's appropriate for Stack Overflow. – MrFlick Jan 08 '18 at 19:31

0 Answers0