# Linear regression | is it wise to convert all categorical variable to numerical variable to perform linear regression?

I would like to know whether if it is recommended to convert the categorical variable into a numerical variable to perform linear regression or to rather perform a logit regression instead.

• Dependent variable: A categorical variable w/ 2 levels
• Independent variable: Numerical variable
• How would you convert the categorical variable to a number?
– Dave
Jun 13, 2020 at 14:26
• Can you describe what are the two levels of your dependent categorical variables? What does that variable represent? Jun 13, 2020 at 14:35
• Given that the inputs to a regression model need to be numeric, it would be difficult to imagine what you're trying to do in the logit regression case. What are you envisioning in the logit regression case? Jun 14, 2020 at 7:13

## 1 Answer

Since your dependent variable is dichotomous, you should do logistic regression. This is what it is designed for.

You don't say what your DV is, but let's suppose it's lived/died. If you treat this as numeric (somehow) then you are saying that there is a continuum between living and dead and also states beyond living and dead. Suppose you make living = 1 and dead = 0. Then you will get predicted values such as 0.82 or -1.23. What do they mean?

(NOTE: I know that I am making this simple; I'm trying to give a useful answer to the question, as posed, rather than a formal mathematical statement or something)