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.