quantileTest {asht} | R Documentation |
Tests and Confidence Intervals about a Quantile.
Description
The ath quantile of a distribution is the value, q, such that F(q-) <= a <= F(q), where F(x)=Pr[X <= x]. These are exact tests and confidence intervals on independent observations that do not any assumptions on the distribution, F. For example, the tests are exact when data are discrete or continuous, and when the distribution is non-symmetric.
Usage
## S3 method for class 'ordered'
quantileTest(x,...)
## Default S3 method:
quantileTest(x, q = 0, prob = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, ...)
medianTest(x, m=0, ...)
Arguments
x |
a vector of numeric, integer or ordered factor values |
q |
null quantile for test |
m |
null median for test |
prob |
quantile |
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. |
conf.level |
confidence level of the interval |
... |
further arguments to be passed to or from methods. |
Details
A test on the quantile. The medianTest
is just a wrapper function to call quantileTest
with prob
=0.5.
Ordinal factors may be used. The calculations just use as.numeric(x) for the factors, then return the character associated with that value. Estimates that are between two ordered factors, say "C" and "D", return the character "C/D".
Value
A list of class 'htest'.
Author(s)
Michael P. Fay
See Also
Examples
## For Poisson(mean=2.5) the median is 2
x<-rpois(20,2.5)
medianTest(x)
x<-ordered(c(rep("A",10),rep("B",60),rep("C",30)),levels=c("A","B","C"))
xnum<-as.numeric(x)
quantileTest(xnum,q=2,prob=0.705)
quantileTest(x,q=2,prob=0.705)