Learn R Programming

hyper2 (version 2.0-0)

tests: Hypothesis testing

Description

Tests different nulls against a free alternative

Usage

equalp.test(H, ...)
samep.test(H, i, give=FALSE, ...)
specificp.test(H, i, specificp=1/size(H),
         alternative = c("two.sided","less","greater"),  ...)
specificp.ne.test(H, i, specificp=1/size(H), ...)
specificp.gt.test(H, i, specificp=1/size(H), delta=1e-5, ...)
specificp.lt.test(H, i, specificp=1/size(H), ...)
# S3 method for hyper2test
print(x, ...)

Arguments

H

A likelihood function, an object of class hyper2

...

Further arguments passed by equalp.test() to maxp() and ignored by print.hyper2test()

i,specificp

Function specificp.test() tests the hypothesis that \(p_i\) is equal to specificp. Function samep.test() has i an integer vector of strengths. The null is that p[i[1]] == p[i[2]] == ... == p[i[r]]

alternative

a character string specifying the alternative hypothesis, must be one of two.sided (default), greater or less. You can specify just the initial letter (taken from t.test.Rd)

give

Boolean, with TRUE meaning to return more detailed debugging information, and default FALSE meaning to return a more user-friendly object of class equalp.test, which has its own print method

x

Object of class equalp.test, the result of equalp.test()

delta

Small value for numerical stability

Value

The test functions return a list with class "hyper2test" containing the following components:

statistic

the difference in support between the null and alternative

p.value

the (asymptotic) p-value for the test, based on Wilks's theorem

estimate

the maximum likelihood estimate for \(p\)

method

a character string indicating what type of test was performed

data.name

a character string giving the name(s) of the data.

Details

Given a hyper2 likelihood function, there are a number of natural questions to ask about the strengths of the players; see the Hankin 2010 (JSS) for examples. An extended discussion is presented in vignette “hyper2” and the functions documented here cover most of the tests used in the vignette.

The tests return an object with class hyper2test, which has its own print method.

  • Function equalp.test() tests H_0 p_1=p_2==p_n=1nH0: p1=p2=...=pn=1/n

  • Function specificp.test(H,i,p) tests H_0 p_i=pH0: p_i=p

  • Function samep.test() tests H_0 p_i_1=p_i_2==p_i_komitted.

  • Functions specificp.ne.test(H,i,p), specificp.gt.test(H,i,p), and specificp.lt.test(H,i,p) are low-level helper functions that implement one- or two-sided versions of specificp.test() via the alternative argument, following t.test()

See Also

maxp

Examples

Run this code
# NOT RUN {
equalp.test(volvo)

samep.test(icons,c("NB","L"))


# }

Run the code above in your browser using DataLab