Announcement

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

  • Forced variables dropped when using lasso

    Dear Stata Users,

    I am running a regression through the lasso command in Stata 16. My aim is to use a data-driven approach to find a more parsimonious model.

    This is the command

    . lasso logit event1 (ib1.ukborn ib1.sex c.agen ib1.educ2) i.tenure3 i.save i.contr2 i.finnow2 i.finfut i.tercile i.means_ben
    > efits22 [iw=weightres4] if agen>29&agen<36&tercile<6&jbstat!=7&evunion==2&ten ure3<4&save<2&finfut<4&finnow2<4&mach2!=., selectio
    > n(adaptive)

    These are the two first lines of the output.

    Lasso step 1 of 2:
    note: 2.ukborn dropped because it is constant
    note: 2.educ2 dropped because it is constant


    I do not understand why the levels of these variables, which should be forced to be in the model,are dropped.

    They are generally estimated by logit regressions (without lasso).

    Thank you in advance.
    Lydia

  • #2
    Dear Lydia,

    -lasso- standardizes the variables in computation, so all the constant-only variables cannot be identified. That's why you see these two notes.

    By the way, if you want to use -lasso- for model selection purpose and do inference on some variables of interest, you may be interested in -dslogit-, -pologit-, and -xpologit- commands.

    Thanks,

    Di

    Comment


    • #3
      Thank you very much for your answer.

      I read carefully about inference by using lasso. The reason why I was not using these methods concerned the impossibility of using weights.
      Do you think that this drawback could be overcome somehow?

      Thanks again,
      Lydia

      Comment


      • #4
        So far, all the inferential lasso commands do not support any type of weights. We may think about adding this feature in the future. Now, if you have frequency weights, you can expand the data before running the command. However, if you have iweights, I do not see a workaround right now.

        Thank you.

        Di

        Comment

        Working...
        X