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.
Best Answer
Levene's test is one of several tests that is essentially an ANOVA but using a response that converts the spread of the values into locations. In the case of Levene, the observations put into the ANOVA are:
$$Z_{ij} = |Y_{ij} – bar{Y}_{icdot}|, text{ where } bar{Y}_{icdot} 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.