# Discrete values ( enum ) in dataset

I have a data set where some columns have discrete values like $x_2=('cat','dog','penguin')$, $x_3=( 'high', 'low')$ etc... how do I handle these values before to run a regression?

Do I have to convert them into integers like $x_2=(0,1,2)$, $x_3=(0,1)$?

Do I have to add more columns $x_{cat}, x_{dog}, x_{penguin}, x_{high}, x_{low}$ and assign them a value 0 or 1 ?

• Most modern software does this for you. It does something similar to what you outline in your last sentence for some meaning of similar. I would recommend letting your software do the heavy lifting here and if it does not offer this facility then choose a different software. – mdewey Nov 21 '16 at 11:57
• Do you have any web links where I can get more info ? – ozw1z5rd Nov 21 '16 at 13:03
• There are some hints in this Q&A stats.stackexchange.com/questions/239427/… which is for logistic regression but applies to linear and Poisson as well. – mdewey Nov 21 '16 at 13:50
• @mdewey I think you could easily turn your two comments into an answer. Or someone else could, if you don't want to. – Peter Flom Aug 14 '18 at 12:36

Note that your option $x_2$ may work as long as you tell the software these are categories not numerical values. Internally the software will do something like you last suggestion ($x_{cat}$) and so on.