I am currently working on a prediction model from which the data is longitudinal data/panel data/cross sectional data. The data contains multiple companies for which I have a response variable and multiple explanatory variables for multiple years.
I would like to make a prediction of the response variable and would like to test the importance of each explanatory variable. I have made some predictions using the package plm()
in R, but I would like to make a prediction using machine learning algorithms. Does any of you know which models I could use and where I can find more material on this topic? Are there models available in the package caret
which could deal with this longitudinal data?
Many thanks in advance!
My data looks like this:
data <- read.table(header = TRUE,
stringsAsFactors = FALSE,
text="CompanyNumber ResponseVariable Year ExplanatoryVariable1 ExplanatoryVariable2
1 2.5 2000 1 2
1 4 2001 3 1
1 3 2002 5 7
2 1 2000 3 2
2 2.4 2001 0 4
2 6 2002 2 9
3 10 2000 8 3")