# Function evaluation with discrete independent variables

Suppose that an dependent variable y depends on a number of dependent variables which take discrete values in their domains. Given a set of input-output data, how can such relations be found out ? Do regression models work in such cases as well or are there dedicated methods to handle such cases?

I'm explaining for linear regression.

Call $Y$ the dependent variable. Consider a discrete independent variable $X$. There are basically two cases:

• even if $X$ is discrete, the influence of $X$ on $Y$ is expected to be proportional to $X$, thus it works like a continuous variable. Example: disease severity represented by integer numbers from 1 to 5
• $X$ represents categories whose numbering is purely artificial and does not represent a quantity. Example: 1:student, 2:unemployed, 3:employed

In the proportional case, the standard method is to use usual linear regression $Y=\alpha+\beta X$. In the categorical case, the standard method is to use dummy coding: https://en.wikipedia.org/wiki/Dummy_variable_(statistics)

There are refined methods but these two are the most common and enough for a lot of studies. Most stat softwares handle dummy coding automatically is you ask them.

You can combine them of course. If there are two independent variables $X_1,X_2$ you can choose either method for each of them.

The same ideas hold for other regressions such as logistic regression. It's just the same.