0

I am using R to predict company net income using compustat data. I am utilizing Lasso regression.

I got the code for the Lasso regression working, however I am getting very low R^2 values.

I think this is because in the model I need to use a matrix so the gvkey and fyear are input as a double type (the regression sees these as an input not a unique identifier) so it cannot match/use that firms prior years net income as input to estimate the next year since it is not matching each firms prior years to their future years.

Sorry, I hope that makes sense - let me know if there is any other information needed.

  • 1
    Welcome on stack Ian. When making posts it is always good to include your code otherwise we can't really help you and understand what's going on. – Ansjovis86 Feb 22 '20 at 23:28
  • https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – massisenergy Feb 23 '20 at 10:51

0 Answers0