189k views
0 votes
You are using ""state"" a categorical variable in your linear regression model with 50 possible values. How many variables will this variable ""state"" should be expanded for your model?

User TSR
by
5.3k points

1 Answer

5 votes

Answer:

49

Step-by-step explanation:

Categorical variables are variables that take on values that are names or labels. They are not numerical, they contain a finite number of categories.

In this exercise, i will first convert "state" into a dummy variable, and use one hot encoding that uses one column for each value to compare all other values and produce estimates for n-1 states which in this case is 50-1 = 49.

User Usman Zafer
by
5.2k points