How to deal with nominal variable with too many levels? currently I'm trying to model a response variable y, and I have zip code as my independent variable, my model is logistic regression. When it comes to nominal variable, the text book method is to create k-1 dummy variable (assuming the nominal variable have k different levels), but zip code's k is too big, I can't create that amount of dummy variables, is there any other ways to deal with this?
Or more generally, how to deal with nominal variables with too many levels (k>=100)?
 A: Instead of ZIP code use something else. Some options:
First 3 digits of ZIP code - this might work if you had data from a medium sized region; it would not work if you had data from the whole USA
County - not great but used often. Problem is counties vary greatly in population.
Congressional district - these are weird geographically, but have roughly equal populations
State - has some problems with population size (although at least all are large). 
Region or division, as defined by the Census . Other people have come up with other variations of regions. 
you might also be able to combine county, state, region or division with a variable for urban/suburban/rural
A: I'm not sure whether this is 100 percent valid, but one thing that strikes me is that you might convert all zip codes where the number of observations is too small to an 'other' zip code. So then your zip code column would contain zip codes where the number of observations, N is greater than some cutoff k.
If you're regression your dependent variable on zip and some additional regressors, then when the number of observations is sufficient to measure the effect of a zip code, then you should be fine. Otherwise, when the number of observations is too few, it will regress on the other category, which will probably have no relationship with the response, but will allow you to keep those observations in the model and consider other predictor variables.
A: use bit code to do this.
for example if a nominal variable have 1000 categories, then use variable 
u1,u2,u3... u10
then represent each category as binary number i.e.
level 10=1010 then use u4-u1 to represent them
