:exclamation: This is a read-only mirror of the CRAN R package repository. StepReg — Stepwise Regression Analysis Report bugs for this package: https://github.com/JunhuiLi1017/StepReg/issues
Other
5
stars
2
forks
source link
Error when combining strategy='subset' and include argument #3
Running stepwise with strategy="subset" and using the include argument (ex include=c(var1,var2)) returns an error.
Here is a reproducible example
data(mtcars)
formula <- mpg ~ .
# This is OK
res1 <- stepwise(formula = formula,
data = mtcars,
type = "linear",
include = c("disp", "cyl"),
strategy = "forward",
metric = "AIC")
# This returns an error
res1 <- stepwise(formula = formula,
data = mtcars,
type = "linear",
include = c("disp", "cyl"),
strategy = "subset",
metric = "AIC")
Please find below the error:
'names' attribute [2] must be the same length as the vector [1]
Running
stepwise
withstrategy="subset"
and using theinclude
argument (exinclude=c(var1,var2)
) returns an error.Here is a reproducible example
Please find below the error:
'names' attribute [2] must be the same length as the vector [1]