View source: R/empirical_mu_tests.R
empirical_mu_one_way | R Documentation |
Test the equality of means of an unknown distribution.
empirical_mu_one_way(x, fctr, conf.level = 0.95)
x |
a numeric vector. |
fctr |
a factor vector indicating groups. |
conf.level |
overall confidence level of the likelihood intervals. Uses Bonferroni correction. |
Null: All mus are equal. (mu1 = mu2 ... muk).
Alternative: At least one mu is not equal.
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.
Yudi Pawitan. In All Likelihood. Oxford University Press.
Owen. Empirical Likelihood. Chapman & Hall/CRC.
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_mu_one_way(x, 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_mu_one_way(x, fctr, .95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.