0
$\begingroup$

I am trying to select the best model with the library broom in R. The script is something like this:

X = names(out_comp2[,-6])
out_lg <- unlist(lapply(1:length(X), function(n) combn(X, n, FUN=function(row) paste0("out_comp2$TM_Accuracy ~ ", paste0(row, collapse = "+")))))

library(broom)                                                                  
library(dplyr)

tmp = bind_rows(lapply(out_lg, function(frml) {
  a = glance(glm(frml, data=out_comp2, family = "gaussian")) #glance = extract all the variables from the function , frml = all combinations 
  a$frml = frml
  return(a)
}))

head(tmp)

I obtained a list of negative BIC, but I don't know which model is the best. The highest or the lowest? For example, if I have a BIC of -15 and a BIC of -4, which one is the best?

$\endgroup$
0

0

Browse other questions tagged or ask your own question.