empirical_mu_one_sample: Test the mean parameter of an unknown distribution.

View source: R/empirical_mu_tests.R

empirical_mu_one_sampleR Documentation

Test the mean parameter of an unknown distribution.

Description

Test the mean parameter of an unknown distribution.

Usage

empirical_mu_one_sample(x, mu, alternative = "two.sided", conf.level = 0.95)

Arguments

x

a numeric vector.

mu

a number indicating the tested value of mu.

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.

Value

An S3 class containing the test statistic, p value, likelihood based confidence 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(25, 0, 1)
empirical_mu_one_sample(x, 0, "two.sided")

# Null is false
set.seed(1)
x <- rnorm(25, 2, 1)
empirical_mu_one_sample(x, 1, "greater")

gmcmacran/MLTesteR documentation built on Sept. 12, 2024, 3:30 p.m.