The string formula in the loop throws an error with standardize(), whereas the non-loop versions do not. Environment issue?
standardize()
library(arm) set.seed(1)
It is important that the formula is actually substituted in the lm object:
lm
for (i in list(quote(x1), quote(x2))) { f <- bquote(y ~ .(i)) m0 <- eval(bquote(lm(.(f), data=df))) m0z <- arm::standardize(m0) }