##### One sample $z$ test: sampling distribution of the $z$ statistic

Definition of the sampling distribution of the $z$ statistic

##### Sampling distribution of $z$:

As you may know, when we perform a one sample $z$ test, we compute the $z$ statistic $$z = \dfrac{\bar{y} - \mu_0}{\sigma / \sqrt{N}}$$ based on our sample data. Now suppose that we would draw many more samples. Specifically, suppose that we would draw an infinite number of samples, each of size $N$. In each sample, we could compute the $z$ statistic $z = \frac{\bar{y} - \mu_0}{\sigma / \sqrt{N}}$. Different samples would give different $z$ values. The distribution of all these $z$ values is the sampling distribution of $z$. Note that this sampling distribution is purely hypothetical. We would never really draw an infinite number of samples, but hypothetically, we could.

##### Sampling distribution of $z$ if H0 were true:

Suppose that the assumptions of the one sample $z$ test hold, and that the null hypothesis that $\mu = \mu_0$ is true. Then the sampling distribution of $z$ is normal with mean 0 and standard deviation 1 (standard normal). That is, most of the time we would find $z$ values close to 0, and only sometimes we would find $z$ values further away from 0. If we find a $z$ value in our actual sample that is far away from 0, this is a rare event if the null hypothesis were true, and is therefore considered evidence against the null hypothesis ($z$ value in rejection region, small $p$ value).