0

How to create Data frame with Step wise regression outputs? And how to rank variables in order of ranking in Stepwise Regression

Tried this, not working:

y.data.frame=data.frame(y=rnorm(20),foo=rnorm(20), bar=rnorm(20),baz=rnorm(20))

min.model = lm(A$Y~A$X2+A$X4+A$X3+A$X1+A$X5, data=my.data.frame) 
biggest <- formula(lm(A$Y~A$X2+A$X4+A$X3+A$X1+A$X5, data=my.data.frame)) 

summary(biggest)

A$Y ~ foo + bar + baz fwd.model = step(min.model, direction='forward', scope=biggest)
K= lm(A$Y~A$X1+A$X2+A$X3+A$X4+A$X5) 

summary(K) 

View(K)
zx8754
  • 52,746
  • 12
  • 114
  • 209
  • 2
    Hello, welcome to SO. Please have a look at [this link](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Sotos Apr 06 '16 at 06:41
  • 1
    Please see [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) and [How do I ask a good question](http://stackoverflow.com/help/how-to-ask). – steveb Apr 06 '16 at 06:50
  • Have a look at [broom](https://cran.r-project.org/web/packages/broom/vignettes/broom.html). – zx8754 Apr 06 '16 at 07:01
  • What is `A`? See how formula interface works in R. In short, you should refer to variable names, without specifying where that variable comes from. This is reserved for `data` argument. – Roman Luštrik Apr 06 '16 at 07:10

0 Answers0