I'm trying to do a stepwise regression on a data frame using StepReg, like this:
library(StepReg)
stepwise(BR_Click34_Crowd_pos[,c(10:45)],
y = BR_Click34_Crowd_pos[,c(10)],
exclude = BR_Click34_Crowd_pos[,c(15,17,23:25,31,32)],
selection = "bidirection",
select = 'adjRsq',
0.01,
0.05)
The data frame holds 45 columns of numeric data, with columns 10 - 45 passed in with column 10 as the output variable and columns 11 - 45 as the input variables, but with some columns excluded. The error message is " 'y' should be numeric or character vector " which refers to column 10 and using as.numeric on column 10 gives a different error ('list' object cannot be coerced to type 'double') and as.vector on column 10 gives the error ('y' should be numeric or character vector). Any thoughts, please?