Skip to content

How to force regression coeffs for some values in a categorical variable

4 messages · sr danda, David Winsemius

#
On Nov 29, 2009, at 11:23 AM, sr danda wrote:

            
It's a bit unclear from your description what you are trying to do  
(and it might help to hear the justification for doing it). If you do  
not want the cases with particular factor levels used in the  
prediction, then subset them out. If you want a group of factor levels  
grouped and and then used as the reference level, then perhaps:

?relevel

That will of course result in the intercept term becoming the adjusted  
mean for those levels, but I'm sure you already knew that.
#
I worry whether you understand what is happening when you lump all the  
"unwanted levels" into a reference level. Be sure to watch the  
intercept as you compare models. It will be some sort of adjusted mean  
for whatever cases are in the reference levels of that and teh  
reference levels of any other factor. It will change as you add or  
remove levels from that status. Just because you get no coefficient  
does not mean those data points are not affecting the predictions you  
will make from the model. The prediction for cases in those reference  
levels will NOT be 0. Nor will the predicted differences between that  
group and others be zero.