Does it make sense to include ZIP code as a covariate in regression model? Background
I have a dataset representing a large group of people that I'm using to specify a Cox proportional hazards model of a binary outcome on some explanatory variables. My outcome variable is a health condition of interest (coded 1/0), and, my "focal" explanatory variable -- the one I'm most interested in -- is a binary indication of whether a person has been given a certain treatment or not. The other explanatory variables are the usual sociodemographic suspects: age, sex, and a couple others.
In planning my model, I'd like, if possible, so find some way to also control for subjects' geography in the estimation of my exposure variable (I have a reason to think it could matter). At first glance I've got a handy way to do this: a variable 3_digit_zip_code representing -- you guessed it -- the first 3 digits of a subject's US postal code.
Question / problem
The immediate objection to including ZIP in the model, of course, is that a hazard ratio (HR) for ZIP code would be uninterpretable: what could "a one digit increase" in ZIP code mean in practical terms?
But then I think of an objection to the objection: wouldn't there be some utility of including ZIP in the interpretability of the other covariates in the model, above all the main one, treatment? In other words, the HR for treatment would be saying something useful about the hazard of the outcome between the treated and untreated, given the same levels of the other covariates -- right?
I suppose I have two questions, then:

*

*Is it worth it to include ZIP in such a Cox model, even if its HR is uninterpretable, if it adds to "control" in other HRs?


*Is there a better way of controlling for geography, e.g. matching of some kind?
 A: US ZIP codes contain a lot of information. You can map the leading three digits of a (valid) ZIP code to the state where the ZIP is located. Here is official documentation from the IRS (see Publication 5594); it's also easy to find implementations of this mapping online so you don't have to do it yourself.
A "US state" variable is quite interpretable and will reduce the cardinality of "geography" to 50 states + the district of Columbia.
As @AdamO suggests, you can then link the state with a state-level socio-economic variables.
Whether to include this information in your model or not could depend in part on the actual treatment, focal explanatory variable and the outcome. People move and sometimes they move across states. If the variables of interest are "short-term", this may not be a concern. If they are long-term and you include geography-related variables, you'll have to think carefully how to interpret the geography effects (whether they are random or fixed).
I googled a bit for statistics about how often Americans move. The best I came across is this from the US Census Bureau but you can probably find more detailed information.
A: Modeling outcome-relevant geographic and demographic covariates directly, as @AdamO suggests, is the best way to go. Another answer suggests ways to start getting such information.
The 3-digit ZIP code poses two problems.
First, without care the numbers might be interpreted as a numeric variable and, as you state, "a one digit increase" in ZIP code would be meaningless. If you are to go with ZIP code as a predictor, you must ensure that it is encoded as a multi-level categorical predictor. That could allow you to use ZIP codes as fixed effects, or as cluster() or frailty/random-effect terms to account for correlations within ZIP codes.
Second, as @AdamO notes in a comment, "The first 3 digits of a zip code doesn't mean anything." The first 3 digits of a ZIP code near where I live includes both wide-open suburban and dense urban localities, areas with some of the highest and lowest average wealth in the state, widely different education levels, and differences in access to transportation and to health-care facilities. If you can't get more detailed geographic and demographic data (e.g., from "ZIP +4" values combined with Census data), at least use the full 5-digit ZIP code.
