<< nan_welchtest Hypothesis Tests utility functions >>

NaN Toolbox >> NaN Toolbox > Hypothesis Tests > nan_ztest

nan_ztest

Test for mean of a normal sample with known variance

Calling Sequence

H = nan_ztest (x, m, sigma,alpha,tail)
H = nan_ztest (m1, sigma1, n1,m2, tail,alpha)
[H,pval, z, ci] = nan_ztest (...)

Parameters

x:

input vector

m:

mean value for testing

sigma:

known variance of x

alpha:

significance level (default alpha = 0.05)

tail:

H:

returns whether the Null-Hypotheses must be rejected.

pval:

p-value of the test

ci:

confidence internvals (depending on alpha)

Description

Perform a Z-test of the null hypothesis mean (x) == m for a sample x from a normal distribution with unknown mean and known variance sigma. Under the null, the test statistic z follows a standard normal distribution.

With the optional argument string tail, the alternative of interest can be selected. If tail is "~=" or "<>", the null is tested against the two-sided alternative mean (x) != m. If tail is ">", the one-sided alternative mean (x) > m is considered. Similarly for "<", the one-sided alternative mean (x) < m is considered. The default is the two-sided case.

Authors

<< nan_welchtest Hypothesis Tests utility functions >>