## ---------------------------------------------------------------- ## Compare Nile data with a gamma distributed ## sample with the parameters (alpha, beta) ## determined from the mean and the variance ## of the Nile sample. ## ---------------------------------------------------------------- png("nile_gamma_qqplot.png") m <- mean(Nile); sigmasq <- var(Nile); beta <- sigmasq / m; alpha <- m^2 / siqmasq; GeneratedSample <- rgamma(n=length(nile), shape=alpha, scale = beta); qqplot(Nile, GeneratedSample); dev.off(); ## ---------------------------------------------------------------- ## Compare Nile data with normal ## ---------------------------------------------------------------- png("nile_qqnorm.png"); qqnorm(Nile); dev.off(); ## ---------------------------------------------------------------- ## Compare Nile data with a normal ## sample with the mean and the variance ## set from the sample mean and variance ## ---------------------------------------------------------------- png("nile_qqplot.png") m <- mean(Nile); sd <- sd(Nile); GeneratedSample <- rnorm(n=100, mean=m, sd = sd); qqplot(Nile, GeneratedSample); dev.off();