Announcement

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

  • A list of selected variables after stepwise

    Hi!

    The Stata command lasso saves a list of the selected variables in the macro e(allvars_sel). I would like the same feature after stepwise. Is it possible to extract a list of selected variables after stepwise? If so, how?

    /Pär-Ola Bendahl

  • #2
    There may be an easier way to do it, but here is one method after running stepwise which works with say regress:

    Code:
    local wanted : colnames e(b)
    local wanted : subinstr local wanted "_cons" "", all
    For other commands you may need to do more work.

    Comment


    • #3
      Thanks Nick! Nice solution which works for my purpose. Exactly what I wanted. /Pär-Ola Bendahl

      Comment

      Working...
      X