I perform an outlier test in the regression model using the outlierTest function (regression_model). The test finds three outliers. I want to execute the predict () function to find the desired values according to the regression model and indicate where the outlier 247 occurred - the line number where the first outburst occurred. Then I write:
SPb2016[247,] out = SPb2016[247,c('Comission', 'Turnout_percentage', 'Invalid_percentage', 'Home_percentage', 'United_Russia')] predict(regression_model, out)
An error pops up with the following words:
Error in model.frame.default (Terms, newdata, na.action = na.action, xlev = object $ xlevels): variable lengths differ (found in 'Invalid_percentage') In addition: Warning message: 'start' should have 1 lines but the variable found has 248 lines
Explain, please, what is wrong? All data in numeric format and one length.