View qqfind.R
qqfind <- function(x) { | |
# Generates the normal Q-Q plot for the given data | |
# as well as for three samples of the same size | |
# from a normal distribution with matching | |
# mean and variance. | |
# | |
# If it's obvious which one is the real data, | |
# it might not be normally distributed. | |
# | |
# Return value is the index of the plot |
View params-from-quantiles.R
params.from.quantiles <- function(q, p, family="normal", start=c(0.5, 0.5)) { | |
# Finds parameter values of distributions that closely match | |
# the specified quantiles. | |
# | |
# Args: | |
# q: A vector of quantiles (length 2, strictly increasing) | |
# p: A vector of percentiles (length 2, strictly increasing) | |
# family: One of "normal", "beta", or "gamma" specifying | |
# which family of distributions to use | |
# start: starting values for parameter search |