9
$\begingroup$

Can someone give an explanation for why the t-test "happens"? I was taught to use the t-test when you don't know the population standard deviation (i.e., you only know the standard deviation of your sample), but I'm not sure why that would make it different from a z-test.

$\endgroup$
  • $\begingroup$ I've updated your title to get at the question I think you are asking; feel free to edit if I have misconstrued $\endgroup$ – Jeromy Anglim Sep 30 '11 at 6:58
3
$\begingroup$

I don't think I understand your question completely. Are you asking why you would use a t-test?

If you understand why you would use a z-test, you should have a good idea of why you would use a t-test. For large samples, a z-test and a t-test should render similar or identical results. But while a z-test will assume a normal distribution, a t-test will take into account uncertainty in sample distribution at smaller samples sizes.

$\endgroup$
  • 3
    $\begingroup$ Hmm the t-test also assumes a normal distribution. Perhaps what you meant to say is that we require less information about that distribution. $\endgroup$ – JohnK Sep 8 '14 at 12:11
  • $\begingroup$ @JohnK I don't think it makes sense saying a test assumes a distribution in the first place, but I think Benjamin meant that the t-score/statistic assumes the T-distribution and not the Z-distribution. $\endgroup$ – Datoraki Aug 8 '15 at 0:33
3
$\begingroup$

The z-test itself is actually a likelihood ratio test between the likelihood assuming the null hypothesis and the likelihood assuming the alternate hypothesis. Assuming underlying normal distributions with known variances and only testing the means, the algebra simplifies to the z-test we know and love (DeGroot 1986, pp. 442–447).

Using the same maximum likelihood procedure, but treating the variance as an unknown, creates a different pair of likelihoods and their ratio, and letting the algebra simplify out gives the statistic: $$ \frac{\sqrt{n}\left(\bar{X}_n - \mu_0\right)}{\sqrt{\frac{S^2_n}{n-1}}} $$ (DeGroot 1986, pp. 485–489). The testing distribution in question changes as well, as the numerator of the above statistic is normally distributed, $\bar{X}$, and the denominator is distributed as square root of squared normals, the $S^2$, which is the square root of a chi-square random variable. Gosset (Student) showed that if you have a random variable: $$ Y \sim N(0, 1)\\ Z \sim \chi^2_n\\ X \sim \frac{Y}{\sqrt{\frac{Z}{n}}} $$ then X is distributed with the t distribution and n degrees of freedom.

So, to state it without rigor, the t-test is the natural outcome of the same likelihood ratio process that is behind the z-test when the variance of the data is itself unknown and is being estimated through maximum likelihood.

$\endgroup$
  • 1
    $\begingroup$ this was very enlightening. I had completely forgotten that the t-test comes from maximum likelihoood $\endgroup$ – Moderat Apr 16 '15 at 16:19
1
$\begingroup$

The non-rigorous answer is that you want to use a t-test when you have a small number of samples because of the chance that the samples are unusually close together (relative to the actual population variance). In that case, the denominator in the formula for the t-statistic will be unusually small, and so the t-statistic itself will be unusually large. Thus, you're much more likely to get a large value for the t-stat when you have a small number of samples than you would be to get a comparably large z-stat, so you need a larger value to reject the null using the t-test than the z-test at the same significance level.

$\endgroup$
  • $\begingroup$ I find the argument appealing but, upon reflection, unconvincing. After all, if by chance the samples are unusually far apart (which ought to happen just as easily as being unusually close), then it seems the very same logic would lead to the opposite conclusion. $\endgroup$ – whuber Sep 8 '14 at 15:06
0
$\begingroup$

The most important differentiator is sample size, as a rule of thumb: If $n$ is smaller than $30$ a t-test should be used, otherwise a z-test.

A good overview of the underlying assumptions and differences (and similarities) of both tests is given here:
http://www.le.ac.uk/bl/gat/virtualfc/Stats/ttest.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.