empirical_quantile_one_way {LRTesteR} | R Documentation |
Test the equality of a quantile from an unknown distribution.
Description
Test the equality of a quantile from an unknown distribution.
Usage
empirical_quantile_one_way(x, Q, fctr, conf.level = 0.95)
Arguments
x |
a numeric vector. |
Q |
The quantile. A single numeric number. (.50 is median.) |
fctr |
a factor vector indicating groups. |
conf.level |
overall confidence level of the likelihood intervals. Uses Bonferroni correction. |
Details
Null: Quantiles are equal. (Q1 = Q2 ... Qk).
Alternative: At least one quantile is not equal.
Value
An S3 class containing the test statistic, p value, list of likelihood based confidence intervals, overall confidence level, individual confidence level of each interval and alternative hypothesis.
Source
Yudi Pawitan. In All Likelihood. Oxford University Press.
Owen. Empirical Likelihood. Chapman & Hall/CRC.
Examples
library(LRTesteR)
# Null is true
set.seed(1)
x <- rnorm(75, 1, 1)
fctr <- c(rep(1, 25), rep(2, 25), rep(3, 25))
fctr <- factor(fctr, levels = c("1", "2", "3"))
empirical_quantile_one_way(x, .50, fctr, .95)
# Null is false
set.seed(1)
x <- c(rnorm(25, 1, 1), rnorm(25, 2, 1), rnorm(25, 3, 1))
fctr <- c(rep(1, 25), rep(2, 25), rep(3, 25))
fctr <- factor(fctr, levels = c("1", "2", "3"))
empirical_quantile_one_way(x, .50, fctr, .95)
[Package LRTesteR version 1.1.1 Index]