I'm a beginner and I'm trying to write a function that fits a model (univariate) one variable at a time. I want to able to enter all the dependent variables when calling the function and then make the function to fit one variable at a time. Something like:
f <-function(y, x1,x2,x3) {(as.formula(print()))...}
I tried to make a list of x1, x2, x3 inside the function but it didn't work.
Maybe someone here could help me with this or point me in the right direction.