| compareSurveys {fitPS} | R Documentation |
Compare two surveys on the basis of their shape parameters
Description
Compare two surveys on the basis of their shape parameters
Usage
compareSurveys(x, ...)
## Default S3 method:
compareSurveys(
x,
y,
xname = NULL,
yname = NULL,
alternative = c("two.sided", "less", "greater"),
null.value = 0,
print = TRUE,
...
)
## S3 method for class 'psData'
compareSurveys(x, y, ...)
## S3 method for class 'psFit'
compareSurveys(x, y, ...)
compare.surveys(x, ...)
comp.survs(x, ...)
Arguments
x |
either an object of class |
y |
either an object of class |
xname |
an optional name for the first survey object. |
yname |
an optional name for the second survey object. |
alternative |
one of |
null.value |
the true value of the difference in the shape parameters under the null hypothesis. |
print |
if |
... |
further arguments to be passed to or from methods. |
Details
This function **only** works for the zeta distribution. It does not work for the zero-inflated zeta distribution. If the results from fitting ZIZ models are passed to this function, then it will ignore the zero-inflated part and simply refit a zeta model.
There is very little reason for null.value to be set to be anything other than 0. However it has been included for flexibility.
alternative = "greater" is the alternative that x has a larger shape parameter than y.
alternative = "less" is the alternative that x has a smaller shape parameter than y.
Value
The function returns a list of class "htest" with the following elements:
statistic– the test statistic.
p.value– the P-value associated with the estimate.
estimate– the estimated difference in the shape parameters.
null.value– the specified hypothesized value of the difference in shape parameters—
0by default.stderr– the standard error of the difference.
alternative– a character string describing the alternative hypothesis.
method– a character string describing the method.
data.name– a character string with the names of the two input data sets separated by " and ".
Methods (by class)
-
compareSurveys(default): Compare two surveys on the basis of their shape parameters -
compareSurveys(psData): Compare two surveys on the basis of their shape parameters -
compareSurveys(psFit): Compare two surveys on the basis of their shape parameters
Functions
-
compare.surveys(): Compare two surveys on the basis of their shape parameters -
comp.survs(): Compare two surveys on the basis of their shape parameters
Examples
data(Psurveys)
lau = Psurveys$lau
jackson = Psurveys$jackson
compareSurveys(lau, jackson)
## Example with fitted objects - note the function just refits the models
fit.lau = fitDist(lau)
fit.jackson = fitDist(jackson)
compareSurveys(fit.lau, fit.jackson)
## Example with a bigger difference
compareSurveys(Psurveys$roux, lau)