Learn R Programming

asht (version 0.5)

quantileTest: Tests and Confidence Intervals about a Quantile.

Description

The ath quantile of a distribution is the value, q, such that F(q-)

Usage

## S3 method for class 'ordered':
quantileTest(x,\dots)

## S3 method for class 'default':
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.

Value

  • A list of class 'htest'.

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".

See Also

signTest

Examples

Run this code
## 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)

Run the code above in your browser using DataLab