gaussian_mu_one_sample {LRTesteR}R Documentation

Test the mean of a gaussian distribution.

Description

Test the mean of a gaussian distribution.

Usage

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

Arguments

x

a numeric vector of at least 50 data values.

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

Examples

library(LRTesteR)

# Null is true
set.seed(1)
x <- rnorm(100, 0, 1)
gaussian_mu_one_sample(x, 0, "two.sided")

# Null is false
set.seed(1)
x <- rnorm(100, 3, 1)
gaussian_mu_one_sample(x, 0, "greater")

[Package LRTesteR version 1.1.1 Index]