I have this code
# [1] "X6" "X5" "X7" "X4" "X3" "X8" "X19" "X9" "X10" "X16"
formula = result ~ X3+X4+X5+X6+X7+X8+X9+X10+X16+X19
full_magnetude_model = glm.fit <- glm(formula, data = train)
full_magnetude_predict = predict(full_magnetude_model, newdata=test)
# Comparing results
full_magnetude_results <- ifelse(full_magnetude_predict > 0.5, 1, 0)
true_results = test$result
# results
table(full_magnetude_results,true_results)
It is working properly but the results are functuating for different formulas and I need do the same for:
# [1] "X6" "X5" "X7" "X4" "X3" "X8" "X19" "X9" "X10" "X16"
# [1] "X6" "X5" "X7" "X4" "X3" "X8" "X19" "X9" "X10"
# [1] "X6" "X5" "X7" "X4" "X3" "X8" "X19" "X9"
# [1] "X6" "X5" "X7" "X4" "X3" "X8" "X19"
# [1] "X6" "X5" "X7" "X4" "X3" "X8"
and so on, I can manualy do this but is there are smart way to do it?
Update
the idea is to make a list of formulas and apply my code for each element of the list