Tests different nulls against a free alternative
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, ...)
The test functions return a list with class "hyper2test"
containing the following components:
the difference in support between the null and alternative
the (asymptotic) p-value for the test, based on Wilks's theorem
the maximum likelihood estimate for \(p\)
a character string indicating what type of test was performed
a character string giving the name(s) of the data.
A likelihood function, an object of class hyper2
In equalp.test()
, putative strength vector to be
tested
Further arguments passed by equalp.test()
to
maxp()
and ignored by print.hyper2test()
A character vector of names
Strength, real number between 0 and 1
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
)
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
Object of class equalp.test
, the result of
equalp.test()
Small value for numerical stability
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()
maxp
equalp.test(chess)
# samep.test(icons,c("NB","L"))
# knownp.test(icons,zipf(icons))
Run the code above in your browser using DataLab