From the course: Machine Learning & AI Foundations: Linear Regression

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating dummy codes

Creating dummy codes - SPSS Tutorial

From the course: Machine Learning & AI Foundations: Linear Regression

Start my 1-month free trial

Creating dummy codes

- [Instructor] Okay, well now we're gonna talk about an issue that's gonna come up in almost every regression that you do. Certainly well more than half, certainly the majority of the ones that I've done over the years. Whenever you have a categorical variable, you're gonna have to prepare the data by performing what we call dummy coding. So if you have a categorical variable, you simply cannot feed this directly into your regression. And in a couple of moments, I'll be showing you a dataset example that will explain this. So what you have to do, is if you have original variable with four categories in it, you have to create four new variables. So if a particular case belongs to category one, then what you have to do is make that true, just simply coded one, for the category one variable, but then false, coded zero, for the others. And this is the most common way to do this. Again, it's gonna happen all the time on your regression projects. So with all those cases that belong to…

Contents