# Why are t-tests rather than z-tests used in linear regression? [duplicate]

1. Do the explanatory variables need to have normal distribution in linear regression?

2. Why are there z-tests rather than t-tests in logistic regression?

## 1 Answer

Why are t-tests rather than z-tests used in linear regression?

Because the variance of the error must be estimated from the residuals. This is then used to calculate the standard error of the regression coefficients and predictions.

Do the explanatory variables need to have normal distribution in linear regression?

No, explanatory variables are considered "fixed by design". They can come from any distribution. You would have to derive a whole different type of regression routine to incorporate variance in the $$X$$ variables.

Why are there z-tests rather than t-tests in logistic regression?

Because for a binomial outcome the variance depends on the mean and not the residuals, so you don't have to estimate any extra parameters.

• The final answer makes sense, but I don't think it's the real reason. Consider that logistic regression is a GLM, that GLMs include Gaussian responses (thus implementing exactly the same model as OLS regression), but in this context Z-tests are used. This indicates the choice of test is a function of the procedure as well as of the model. – whuber Dec 27 '18 at 16:07
• @whuber The Gaussian GLM is actually a quasilikelihood because of the nuisance parameter, also called the dispersion parameter (or error variance), that must be estimated. This is why when you specify, say, "quasibinomial" as the family in R's GLMs, inference on regression parameters is based on the T-statistics rather than the Z-statistics. – AdamO Dec 27 '18 at 16:24