I am building a linear regression model to predict 2015 values. I have data from 2013 and 2014. My question is, how can I use both the data from 2013 and 2014 to train my linear regression model in R? I have:
model1 = lm(x ~ y, data = data2013)
model2 = lm(x ~ y, data = data2014)
predictions1 = predict(model1, testdata)
predictions2 = predict(model2, testdata)
I was wondering if I could build a more accurate model using all the data I have. It would be something like this:
model1&2 = lm(x ~ y, data = data2013 & 2014)
Thank you in advance,
If the columns are exactly the same, you should be able to do something like this:
Lookup
?rbind
for more details.