Announcement

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

  • how do I find all possible models that can be fitted based on a combination of a set of variables?

    Hi all,

    I have the following code

    webuse nhefs, clear
    stset age_lung_cancer, fail(lung_cancer)
    stcox former_smoker smoker male urban1 rural
    estat ic
    I want to find the model with the smallest IC.

    I want to fit all possible models that can be fitted with 1 variable at a time, 2 variables at a time, 3 variables at a time and so on.

    How do I do this? This seems a simple thing to do but I'm struggling to figure this out.

    Thanks

    Andre

  • #2
    For a moderate list if variables, say, 10, see tuples from SSC.

    Comment


    • #3
      Duplicate post. See also https://www.statalist.org/forums/for...e-combinations

      Comment

      Working...
      X