I have a question that is and R question and a statistical question:
I am analysing sales of a retailer. These sales are related to some vars: var1, var2, var3.., varN
Most of the vars are continuos.
I want to analyze the relationship between sales and the vars. I have made a linear regression with R:
Now I want to know which is the most important variable in sales, and to know the percent of importance of each var. I am doing this (caret package):
Is this a good method to obtain variables importance??, is good way in R?
Thanks in advance. Any advice will be greatly apreciated.
Juan
I am analysing sales of a retailer. These sales are related to some vars: var1, var2, var3.., varN
Most of the vars are continuos.
I want to analyze the relationship between sales and the vars. I have made a linear regression with R:
Code:
rg<-lm(sales ~ var1 + var2 + var3 + var4, data=sales_2017)
summary(rg)
Code:
varImp(rg, scale = FALSE)
rsimp <- varImp(rg, scale = FALSE)
plot(rsimp)
Thanks in advance. Any advice will be greatly apreciated.
Juan