1. In linear regression, we can keep categorical variables since those variables will be treated as numeric ones. Say if we have a nominal variable, then it needs to be converted into a numeric variable in order to incorporate that into regression model. So we need dummy variable for these cases. Dummy variables will take only integer values.
2. If we have a categorical variable with k categories, then we need to have (k-1) dummy variables. If an observation belongs to the first category, then the first dummy variable will have the value 1 and other dummy variables will have value 0 corresponding to the first observation and similarly others. If an observation belongs to the k-th catrgory, then all the (k-1) dummy variables will have value 0 corresponding to that observation.
Get Answers For Free
Most questions answered within 1 hours.