Learn R Programming

hyper2 (version 3.0-0)

tests: Hypothesis testing

Description

Tests different nulls against a free alternative

Usage

equalp.test(H, ...)
knownp.test(H, p, ...)
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, ...)

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.

Arguments

H

A likelihood function, an object of class hyper2

p

In equalp.test(), putative strength vector to be tested

...

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

i

A character vector of names

specificp

Strength, real number between 0 and 1

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

Details

Given a hyper2 likelihood function, there are a number of natural questions to ask about the strengths of the players; see 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(H,p) tests the null that all strengths are equal to vector p. If p is missing, it tests H_0 p_1=p_2==p_n=1nH0: p1=p2=...=pn=1/n, for example equalp.test(icons)

  • Function knownp.test() tests the null that the strengths are equal to the elements of named vector p; it is a generalization of equalp.test(). Example: knownp.test(icons,zipf(6)).

  • Function specificp.test(H,i,p) tests H_0 p_i=pH0: p_i=p, for example specificp.test(icons,"NB",0.1)

  • Function samep.test() tests H_0 p_i_1=p_i_2==p_i_komitted, for example samep.test(icons,c("NB","L")) tests that NB has the same strength as L.

  • 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

equalp.test(chess)

# samep.test(icons,c("NB","L"))
# knownp.test(icons,zipf(icons))

Run the code above in your browser using DataLab