# Is the $t$ test a special case of the generalized linear model?

The GLM consists of methods which model responses following a distribution from the exponential family. These distributions have a probability function which can be expressed as:

$$f(x; \theta) = a(\theta)g(x)\exp\left[b(\theta)R(x)\right]$$

Therefore, the $t$-distribution is not a member of the exponential family.

My understanding is that the $t$ test assumes that responses are $t$-distributed, and therefore the $t$ test is not a GLM.

However, some sources (example) indicate that the $t$ test assumes that the responses are normally-distributed and thus belongs in the GLM.

1. If responses are normally-distributed, wouldn't a $z$ test be more appropriate?
2. Can the $t$ distribution be used as the probability distribution of the response $Y$ in a GLM?
• Welcome to CV! I think your question suffers from a lack of clarity. What do you mean by "belong in the GLM?" When you write "My understanding is that the t test assumes that the sampling distribution is t-distributed", then you are talking about the sampling distribution of what? – Silverfish Sep 22 '15 at 22:47
• Two useful general rules (not just specific to this question). Whenever you find yourself using the word "distribution", and particularly "sampling distribution", ask yourself of what. Secondly, as a rule of thumb, anything you've been told about "$n$ has to be at least 30", as if 30 is a magic number that changes the way we do statistics, is almost certainly wrong. – Silverfish Sep 22 '15 at 22:49
• I think you mean "can the t distribution be used as the probability distribution of the response $Y$ in a GLM?" If that's so you should clarify that is what "does t belong in the GLM" means. But as you have observed, t is not a member of the exponential family. If you mean "can the t test be used in a GLM" then that's quite a different question. – Silverfish Sep 22 '15 at 22:54
• Note that the t-test assumes that the response is Gaussian; it's the resulting t-statistic that has a t-distribution. If you had t-distributed data, the t-statistic would not have a t-distribution. [And conversely, in general the test statistic for a coefficient in a GLM doesn't have a distribution in the exponential family]. Please clarify what you're asking. It may be that you need to ask a new, more basic, question first, in order to clarify your premises. – Glen_b Sep 22 '15 at 23:38
• I've clarified some parts of the question based on your suggestions. – Lance Upton Sep 23 '15 at 0:34

## 1 Answer

As @Glen_b notes, the $t$-test does not assume the response is distributed as $t$. It assumes the response is normally distributed. (The normal is, of course, in the exponential family.) However, the motivation for the $t$-test is that the group SDs are not known a-priori, but are estimated from the data instead. That fact induces more uncertainty into your result, and so we need to take that additional uncertainty into account. When you do so, it turns out that the test statistic $(\bar x_1 - \bar x_2)/SE$ is distributed as $t$. That's it.

The $t$-test is, in fact, a special case of linear regression, which, in turn, is a special case of the generalized linear model.

Regarding your specific questions:

1. If you know the response is normally distributed, and you know the SD a-priori, you should use the $z$-test instead of the $t$-test.
2. The $t$ distribution is not a member of the exponential family, so no, that wouldn't be a GLM.