all.
This is the first question I make in this forum. I'am a beginner, as you all will immediately tell.
I´m doing a small task in which I must compare a training model with a test model. The point is that the training model has much more rows than the test one.
Through a linear regression model, I wish to compare both models, but when I use the predict() function I get the following error:
"newdata" had 3456 rows but variables found fave 7689 rows.
This is what I did:
regression = lm(train$students~train$subjects, train)
(train is the trining database)
prediction = predict(regression, test)
(test is the testing database)
I don´t know if I´m using the predict() function correctly. Could someone tell me what I did wrong?
Thank you so much in advance your your help and kindness!