normal_inference_pvalue: Calculate the p-value for a hypothesis test about mean of...

View source: R/normalinference.R

normal_inference_pvalueR Documentation

Calculate the p-value for a hypothesis test about mean of normal distribution

Description

Given a set of values assumed to sampled independently from a normal distribution, calculate the p-value for any hypothetical value of the distribution's mean.

Usage

normal_inference_pvalue(y, mu, sigma = NULL, na.rm = TRUE, verbose = FALSE)

Arguments

y

(numeric) A set of values assumed to be drawn independently from a normal distribution.

mu

(numeric) The hypothesized mean of the normal distribution.

sigma

(numeric) If not numeric, the assumed value of the standard deviation

na.rm

(logical) When calculating the sufficient statistics, do we remove NA's

Details

The standard deviation of the normal distribution can assumed to be known to have the value of the sample standard deviation. If so, the p-value is calculated assuming a normal sampling distribution.

If the standard deviation is not assumed to be known, the p-value is calculated using the t-distribution.

Value

(numeric) A p-value for the hypothesis

Examples

y <- rnorm(10, mean = 1)
normal_inference_pvalue(y, mu = 1)

mark-andrews/isdsr-pkg documentation built on Sept. 13, 2022, 11:47 p.m.