What is a Z-test? When would you use a Z test over a T test?
Sigiloso
If the population variance or standard deviation is available then we can use the Z-statistic regardless of the sample size. Whenever it is not available we need to estimate it with the sample standard deviation and this is when we prefer to use a T-test. If number of samples when testing for population mean using the sample mean is greater than or equal to 30 then the sampling distribution is already very much normal and it is okay to use Z-test in that case too. By the way, even for samples much less than 30, the sampling distribution can be normal if we started with a normal parent population.