'Error in eval(predvars, data, env) : object 'gb' not found

I want to loop through glm with multiple dependent variables.

for (y in DV){
 form <- formula(paste(y, "~", IV))
 models_CARD_no0[[y]] <- glm(form, data=CARD_2017_table_no0_log2_glm,) 
              }

However, it fails with Error in eval(predvars, data, env) : object 'gb' not found

Same is true when I try to run lme4::glmer() instead of glm()



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source