I'm trying my best but I can't find out how to loop on different laws, to find the best glm model!
famille = paste0(fam,'(link=',sprintf(" '%s'",lien),')')
famille
[1] "poisson(link= 'log')"
I got two variables fam and lien I want to loop on two fam (poisson and binomial) and two links (logit and log).
And I don't know how to put my variable famille
in the argument family of glm function.
I'm doing this
glm_model = glm(as.formula(paste(gar,"~."),family=famille,data=train)
and I got this error:
Error in get(family, mode = "function", envir = parent.frame()) :
objet 'poisson(link= 'log')' de mode 'function' introuvable
I wish you could help me please?