# Linear Regression with multiple categorical values

I am trying to build a regression model using R where,

reponse variable:

• price (continuous)

explanatory variables:

• Age,accumulated kilometers,weight,horsepower,cylinder volume, tax (continuous)

• Metallic color,ABS,Airbag,CD_Player,Power steering, Metallic_Rim (categorical - binary)

• Color (Categorical - 5 levels)

• Fuel Type (Categorical - 3 levels)

How can I detect the variables that should be used in my linear model in one step. I know that binary variables influence on response variable can be checked using T-test. How can I check which all of these variables(continous, categorigal-binary, categorical-multiple levels) influnece my response variable price in one step ??

• If by one step your implying a shortcut to identifying significant variables automatically it would not be advised. – Arun Jose Nov 20 '15 at 12:03

The statistical value that you obtain is the univariate significance test. You may want to check the joint significance of your variables. Say that you have a binary variables for each color. You want to test the joint significance of the four variables color (you omit one color because it becomes your referent class) via a F-test.
Related to the previous point, you definitely should use binary variables for each color and Fuel type because colors will be coded as 1, 2, 3, 4, 5 = Red, Green, Blue, Black, White. If you include the variable color as it is, the statistical software will not understand that you use a label, but rather an actual value. In other words, the program will understand it as: "going from Red(1) to Blue(2) increases the price of the car by USDxx." To understand my point, if you code the colors differently: Red=3, Blue=1, Green=4, Black=2, White=5, the coefficient in front of color will change, indicating that the information contained in color has changed, which should not be the case.