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 psData—see readData or an object of class psFit—see fitDist.

y

either an object of class psData—see readData or an object of class psFit—see fitDist.

xname

an optional name for the first survey object.

yname

an optional name for the second survey object.

alternative

one of "two.sided", "less", or "greater", depending on the type of hypothesis test you wish to carry out. These may be replaced by single letter (or more) abbreviations.

null.value

the true value of the difference in the shape parameters under the null hypothesis.

print

if TRUE then the function will print summary output to the screen. This lets output be suppressed in situations where the user wants the function to run silently.

...

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—0 by 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)

Functions

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)


[Package fitPS version 1.0.1 Index]