0

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
Erwin R
  • 1
  • 2
  • 1
    Welcome to Stackoverflow!, could you go through [this](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and try to make your example reproducible. – Silence Dogood Apr 21 '17 at 10:22
  • thanks for editing, but that's not actually a *reproducible* example ... – Ben Bolker Apr 21 '17 at 12:22
  • I added a sample of my data – Erwin R Apr 21 '17 at 12:25
  • a sample of your data is unfortunately **not good enough**. Unless we can replicate your error on our own computers, we probably won't be able to diagnose the problem. – Ben Bolker Apr 21 '17 at 21:13

0 Answers0