cdf.compare
Compare Cumulative Distribution Functions
Description
For a one sample problem, compares the empirical distribution function (edf)
of the sample with a hypothesized cumulative distribution function.
For a two sample problem,
compares the edfs for the two samples. This graphical comparison
is often useful
before performing the
Kolmogorov-Smirnov test (function ks.gof).
Usage
cdf.compare(x, y = NULL, distribution = "normal", ...)
Arguments
x |
numeric vector. NAs and Infs are allowed but will be
removed.
|
y |
numeric vector. NAs and Infs are allowed but will be removed.
|
distribution |
character string that specifies the hypothesized distribution in the
one sample test. For two samples, i.e. when y is specified, this
argument is ignored. distribution can be one of:
"normal", "beta", "cauchy", "chisquare", "exponential", "f", "gamma",
"lognormal",
"logistic", "t", "uniform", "weibull", "binomial", "geometric",
"hypergeometric",
"negbinomial", "poisson", or "wilcoxon".
You need only supply the first characters that
uniquely specify the distribution name. For example, "logn"
and "logi" uniquely specify the lognormal and logistic
distributions.
|
... |
For one sample, parameter arguments for
the function that generates p-values for
the hypothesized distribution.
|
Side Effects
Produces a plot of the two compared cdfs on the current graphics device.
See Also
Examples
# one sample
z <- rnorm(100)
# compare with a normal distn:
cdf.compare(z, dist = "normal")
# compare with a chisquare distn.:
cdf.compare(z, dist = "chisquare", df = 2)
# two sample
x <- rnorm(25)
y <- rexp(100)
cdf.compare(x, y)