Greetings.
I've written a convenience function for multicollinearity diagnosis.
I'd like to report to the user the formula that is used in a
regression. I get output like this:
mcDiagnose(m1)
[1] The following auxiliary models are being estimated and returned in a list:
[1] `x1` ~ .
Does applying formula() to the output of lm() (or terms())
do what you want?
d - data.frame(y=1:10, x1=log(1:10), x2=sqrt(1:10), x3=1/(1:10))
formula(lm(formula(y~.), data=d)) # dot expanded
y ~ x1 + x2 + x3
lm(formula(y~.), data=d)$call[[2]] # your original
formula(y~.)
2 matches
Mail list logo