View source: R/empirical_quantile_tests.R
empirical_quantile_one_sample | R Documentation |
Test a quantile of an unknown distribution.
empirical_quantile_one_sample(
x,
Q,
value,
alternative = "two.sided",
conf.level = 0.95
)
x |
a numeric vector. |
Q |
The quantile. A single numeric number. (.50 is median.) |
value |
A single numeric value that is the hypothesized Q quantile. |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". |
conf.level |
confidence level of the likelihood interval. |
For confidence intervals, an endpoint may be outside the observed range of x. In this case, NA is returned. Reducing confidence or collecting more data will make the CI computable.
An S3 class containing the test statistic, p value, likelihood based confidence interval, and alternative hypothesis.
Yudi Pawitan. In All Likelihood. Oxford University Press.
Owen. Empirical Likelihood. Chapman & Hall/CRC.
library(LRTesteR)
# Null is true
set.seed(1)
x <- rnorm(25, 0, 1)
empirical_quantile_one_sample(x, .5, 0, "two.sided")
# Null is false
set.seed(1)
x <- rnorm(25, 2, 1)
empirical_quantile_one_sample(x, .5, 1, "greater")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.