I want to create a regression model using the LASSO technique described by Tibshirani (1996), using the package "lars". I have 28 financial independent variables all in USD or % such as profit and profit margin and 1 dependent variables (goodwill), and none of them contains missing values; i.e. all values are positive, negative or 0. The first column contains case IDs and should not be included in the model.
I want to create a regression model that can calculate the value of goodwill as reported on the balance sheet.
Now, I have the following code:
install.packages("lars")
library(lars)
Independent <- data.matrix(Data[, 2:29])
Dependent <- data.matrix(Data[,30])
RegModel<-lars(Independent, Dependent, type = c("lasso"), trace = FALSE,
normalize = TRUE, intercept = TRUE, eps = .Machine$double.eps)
When I execute lars() I get the following error message: Error in if (Cmax < eps * 100) { : missing value where TRUE/FALSE needed
Can someone explain what this message means and how I can solve this?
I expect that the error occurs somewhere here: eps = .Machine$double.eps, since the error message indicates eps as well, but to be honest, I have no idea.
A sample of my data:
Age (years) Share value ($) Profit ($) Profitmargin(%) Goodwill ($)
8 50.28 -160049730 -26.1 13800000
14 36.51 85740000 1.1 7100000
15 1.10 -4008306 -0.3 380000
12 2.87 1382870000 48.0 18000
23 22.75 -45234000 -17.3 25600000