-3

With different limits for adding or deleting variables. It would the best if the anwser is with code or name of the package containing this function. Thanks!

AkiyamaYukari
  • 39
  • 1
  • 5

1 Answers1

0

Check the "add1()" (or "drop1()") and "update()" functions in the stats package. With the function add1() you get the p-value for the partial F-test for each variable which you can use to do the forward stepwise regression. Use update() to add the variable which is most significant. Then do add1() again. proceed with this procedure until there are no variables with a significant (previously defined threshold) p-value anymore.