Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • stepwise, pr(.05): reg Question: How to keep certain variables from being removed during the selection process

    I am doing the following:

    Code:
    stepwise, pr(.05): reg Yvariable Xvariable1 Xvariable2 Xvariable3 Xvariable4 Xvariable5 ..... XvariableN

    If I think moderators 2 - 6 (Xvariable2 - Xvariable6) are theoretically important and should always remain in the model regardless of statistical significance, is there a way to make those stay in the model throughout the selection process?

    Thanks!

  • #2
    Use the command -help stepwise- and then study these two examples on lockterm1:

    Code:
        Backward selection; force weight to be included in model
            . stepwise, pr(.2) lockterm1: regress mpg weight displ gear turn headroom i.foreign price
    
        Backward selection; force weight and c.weight#c.weight to be included in model
            . stepwise, pr(.2) lockterm1: regress mpg (c.weight##c.weight) displ gear turn headroom
                i.foreign price

    Comment


    • #3
      Joe:
      the usual cautionary tale applies
      https://www.stata.com/support/faqs/statistics/stepwise-regression-problems
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment

      Working...
      X