# What's the rationale behind the degrees of freedom in Levene's test?

I've been reading the Wikipedia page for Levene's test, and it cites the degrees of freedom as (k - 1, N - k), where k is the number of different groups to which the sampled cases belong, and N is the total number of cases in all groups. However, it does not explain why this is so. There is a very thorough answer here which would suffice to answer this question in relation to the chi square goodness of fit. However, I have not been able to find a satisfactory answer to the question in relation to Levene's test.

-

$$Z_{ij} = |Y_{ij} - \bar{Y}_{i\cdot}|, \text{ where } \bar{Y}_{i\cdot} \mbox{ is the mean of the }i^\text{th} \text{ group }$$
which are the absolute deviations from their own sample means, for which larger spread on the $Y_{ij}$ would give typically larger $Z_{ij}$. Consequently, a difference in mean $Z$s implies a difference in spread on the $Y$s.
In ANOVA, if you have $k$ groups and $N$ observations, the d.f. for the overall F-test for differences in mean has $(k-1,N-k)$ df.
Levene's test simply uses the df of the ANOVA it applies to the $Z$ values.