# One sample $z$ test for the mean

This page offers all the basic information you need about the one sample $z$ test for the mean. It is part of Statkat’s wiki module, containing similarly structured info pages for many different statistical methods. The info pages give information about null and alternative hypotheses, assumptions, test statistics and confidence intervals, how to find *p * values, SPSS how-to’s and more.

To compare the one sample $z$ test for the mean with other statistical methods, go to Statkat's or practice with the one sample $z$ test for the mean at Statkat's

##### Contents

- 1. When to use
- 2. Null hypothesis
- 3. Alternative hypothesis
- 4. Assumptions
- 5. Test statistic
- 6. Sampling distribution
- 7. Significant?
- 8. $C\%$ confidence interval for $\mu$
- 9. Effect size
- 10. Visual representation
- 11. Example context

##### When to use?

Deciding which statistical method to use to analyze your data can be a challenging task. Whether a statistical method is appropriate for your data is partly determined by the measurement level of your variables. The one sample $z$ test for the mean requires one variable of the following type:

One quantitative of interval or ratio level |

Note that theoretically, it is always possible to 'downgrade' the measurement level of a variable. For instance, a test that can be performed on a variable of ordinal measurement level can also be performed on a variable of interval measurement level, in which case the interval variable is downgraded to an ordinal variable. However, downgrading the measurement level of variables is generally a bad idea since it means you are throwing away important information in your data (an exception is the downgrade from ratio to interval level, which is generally irrelevant in data analysis).

If you are not sure which method you should use, you might like the assistance of our method selection tool or our method selection table.

##### Null hypothesis

The one sample $z$ test for the mean tests the following null hypothesis (H_{0}):

_{0}: $\mu = \mu_0$

$\mu$ is the population mean; $\mu_0$ is the population mean according to the null hypothesis

##### Alternative hypothesis

The one sample $z$ test for the mean tests the above null hypothesis against the following alternative hypothesis (H_{1} or H_{a}):

_{1}two sided: $\mu \neq \mu_0$

H

_{1}right sided: $\mu > \mu_0$

H

_{1}left sided: $\mu < \mu_0$

##### Assumptions

Statistical tests always make assumptions about the sampling procedure that's been used to obtain the sample data. So called parametric tests also make assumptions about how data are distributed in the population. Non-parametric tests are more 'robust' and make no or less strict assumptions about population distributions, but are generally less powerful. Violation of assumptions may render the outcome of statistical tests useless, although violation of some assumptions (e.g. independence assumptions) are generally more problematic than violation of other assumptions (e.g. normality assumptions in combination with large samples).

The one sample $z$ test for the mean makes the following assumptions:

- Scores are normally distributed in the population
- Population standard deviation $\sigma$ is known
- Sample is a simple random sample from the population. That is, observations are independent of one another

##### Test statistic

The one sample $z$ test for the mean is based on the following test statistic:

$z = \dfrac{\bar{y} - \mu_0}{\sigma / \sqrt{N}}$$\bar{y}$ is the sample mean, $\mu_0$ is the population mean according to the null hypothesis, $\sigma$ is the population standard deviation, $N$ is the sample size.

The denominator $\sigma / \sqrt{N}$ is the standard deviation of the sampling distribution of $\bar{y}$. The $z$ value indicates how many of these standard deviations $\bar{y}$ is removed from $\mu_0$.

##### Sampling distribution

Sampling distribution of $z$ if H_{0}were true:

Standard normal distribution

##### Significant?

This is how you find out if your test result is significant:

Two sided:- Check if $z$ observed in sample is at least as extreme as critical value $z^*$ or
- Find two sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$

- Check if $z$ observed in sample is equal to or larger than critical value $z^*$ or
- Find right sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$

- Check if $z$ observed in sample is equal to or smaller than critical value $z^*$ or
- Find left sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$

##### $C\%$ confidence interval for $\mu$

$\bar{y} \pm z^* \times \dfrac{\sigma}{\sqrt{N}}$where the critical value $z^*$ is the value under the normal curve with the area $C / 100$ between $-z^*$ and $z^*$ (e.g. $z^*$ = 1.96 for a 95% confidence interval).

The confidence interval for $\mu$ can also be used as significance test.

##### Effect size

*Cohen's $d$:*

Standardized difference between the sample mean and $\mu_0$: $$d = \frac{\bar{y} - \mu_0}{\sigma}$$ Indicates how many standard deviations $\sigma$ the sample mean $\bar{y}$ is removed from $\mu_0$

##### Visual representation

##### Example context

The one sample $z$ test for the mean could for instance be used to answer the question:

Is the average mental health score of office workers different from $\mu_0$ = 50? Assume that the standard deviation of the mental health scores in the population is $\sigma$ = 3.