I have a dataset with 7 factor levels none of which are a reasonable reference group, so I've chosen to set up my GLM (negative binomial) analysis using deviation coding. I've studied this question along with this very helpful post to figure out how to calculate the coefficient of the 'left out' factor, the number 7 by default using R contr.sum. This calculation is useful as sign and magnitude will be useful for my discussion on the relationships suggested with the model.

My question is how to find the z or t value, depending on the type of test, for the 'left out' factor? I assume it has to be related to the statistic calculated for the (Intercept) because the intercept is the grand mean and the test is for difference against the grand mean it wouldn't make sense that my models are finding a significant test statistic here. I also need to get a SE for the 'left out' factor, I'm not sure how to proceed on that calculation, I could use the same method for finding the coefficient but I haven't seen a discussion on this and would like some supporting evidence.

Here is an example of a set of models that perform the calculation that I'd like to get at. The first model is with the default contrast settings for deviation coding, in the second model I've re-arranged the contrasts to make a different factor 'left out'. I'm reassured that the intercept and common factors to both models do not change; for brevity sake I didn't include other model metrics but deviance, and AIC were exactly the same for both models (as expected).

Surely there is a more elegant way to do the calculations for the 'left out' factor of any single model.

enter image description here


The simplest way without resorting to statistics is simply to refit your model with a different category as the "left out" category. All the other coefficients, including the intercept, should remain the same. Note that whether you compute the effect estimate and standard error manually using contrast matrices or by just refitting the model, the additional test is not orthogonal to the others and is subject to an elevated type I error rate, though with 7 comparisons you should be correcting for that anyway.

| cite | improve this answer | |

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.