Menu
  • HOME
  • TAGS

Multiple regression in R using CVlm

r,multiple-regression

In fact you have to just add a . to include all variable in the dataset. CVlm(dataset, form.lm(V1 ~ .)) ...

Map function in R for multiple regression

r,multiple-regression

The y needs to be collapsed with + and then pasted to the x and y needs to be passed as a vector to each value of x models <- lapply(dep, function(x, y) step(lm(as.formula(paste(x, paste(y, collapse="+"))), data=mtcars), direction="backward"), y = indep) ...