# Regression technique for data comprised of categorical explanatory variables & a continuous response variable

i suppose one way to characterize data is by a combination of the variable types that comprises it:

```` Continuous/Continuous  |  Continuous/Discrete
 -----------------------|---------------------
 Discrete/Discrete      |  Discrete/Continuous
````

Each of the four cells comprising the 2x2 table just above is comprised of two descriptors, one for the Explanatory Variables (EV), which we'll assume are all of the same type, and one for the Response Variable (RV):

````Explanatory Variable Type / Response Variable Type
````

The columns represent the EV type; the rows, the CV type.

Nearly all of the data i see can be placed in either of the two cells that comprise the first row.

So for instance, OLS Regression is a suitable model type for data in row1/col1; and for data in row1/col2, Logistic Regression is an appropriate model choice.

It's the second row, and in particular row2/col2, that my Question is directed to.

I'm aware of a few regression techniques like ordinal regression which handle a particular type of discrete variables (ordinary or rank, 1st, 2nd, 3rd,....) but i am interested in techniques for handling discrete data more generally, given that most categorical variables do not have an implicit ordinal relationship among the values that comprise them.

For instance:

````Sex | City_of_Residence | Car_Make&Model | Married? | DUI? | Prior_3P_Claims?
 F  |   Cleveland       |  Chevy Camaro  |   No     |  No  |   Yes
````

And the Response Variable is continuous--e.g., building a model to predict the quotes offered by major auto insurers--a price.

-

3
– whuber♦ May 24 '12 at 21:38

## 1 Answer

The type of regression is related to the dependent variable only. When the dependent variable is continuous, you can consider OLS regresssion, regardless of whether the independent variables are categorical or continuous or both. Ordinal independent variables are a bit tricky - sometimes they are treated as continuous sometimes as categorical.

If the independent variables are categorical, there are a variety of methods including effect coding and dummy coding to deal with them.

Of course, OLS makes assumptions beyond the idea that the dependent variable is continuous (or nearly so). e.g. it assumes that the residuals are independent and $\sim{N(0,1)}$

-

3
I might be misreading the question, but it seems that in spirit it is asking for more than how to code a purely nominal explanatory variable. (The clue for that comes from the reference to ordinal regression.) Perhaps the best answer is "use some kind of dummy coding," but maybe, on the other hand, the question that's really lurking here concerns the choices one makes for modeling data that appear to be categorical but might have some structure: perhaps not an order, but something that would allow one to use many fewer parameters than categories. But maybe I'm being too imaginative ... – whuber♦ May 24 '12 at 22:00
Except that the last line says the response variable is continuous. I'm not sure what he wants. – Peter Flom May 24 '12 at 22:09

1
Well, now we're making real progress! We have identified a possible point of misunderstanding in the question (which, as an expert consultant, you know is a key step towards developing a truly useful and correct answer). Let's ask the OP: @Doug, could you expand on this issue so we can create a common unambiguous understanding of what you are asking? – whuber♦ May 24 '12 at 22:13
Indeed! And @doug has been here a while, so an answer should be forthcoming. – Peter Flom May 24 '12 at 22:17

1
@macro is right I mean $N(0,\sigma^2)$ and also about the errors, not the residuals, but we don't know the errors, only the residuals. – Peter Flom May 25 '12 at 14:42
show 1 more comment
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9266181588172913, "perplexity_flag": "middle"}