191k views
2 votes
Whenever a categorical variable such as season has k levels, the number of dummy variables required is _______?

User ShirleyCC
by
8.5k points

1 Answer

3 votes

Final answer:

To represent a categorical variable with k levels using dummy variables, we need k-1 dummy variables.

Step-by-step explanation:

To represent a categorical variable with k levels using dummy variables, we need k-1 dummy variables. In this case, since the variable has 4 levels (k=4), we would need 4-1=3 dummy variables. These dummy variables are used to code each level of the categorical variable as a binary variable: 1 if the observation is in that level, and 0 if it is not. For example, for a variable 'season' with levels 'spring', 'summer', 'fall', and 'winter', we could use 3 dummy variables 'spring', 'summer', and 'fall', with 'winter' as the reference level.

User Mark Good
by
8.0k points