Announcement

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

  • Lassologit error

    Hello everyone,

    I am having the following error when running lassologit

    Code:
    lassologit loan_close `all' `fe', postlogit
    predict double prob_loan_close if e(sample), pr postlogit  lic(ebic)
    Error:
    Code:
    . predict double prob_loan_close if e(sample), pr postlogit  lic(ebic)
    Use lambda=118.077676822632 (selected by EBIC).
        st_matrixcolstripe():  3300  argument out of range
              ereturn_beta():     -  function returned error
               PostResults():     -  function returned error
                     <istmt>:     -  function returned error
    Has anyone encountered this error before? If so, what should I do? I tried installing, updating stata as suggested before on statalist. Also, I have installed the lassopack and still got this error
    Thank you for your time.

  • #2
    No experience here, but in looking into lassologit I notice some differences between your syntax and that described in the output of the help lassologit command.
    Code:
        Prediction
    
        After selecting a model, we can use predict to obtain predicted
        probabilities or linear predictions.
    
        First, we select a model using lic() in combination with
        postresults as above:
            . lassologit v58 v1-v57
            . lassologit, lic(ebic) postresults
    
        Then, we use predict:
            . predict double phat, pr
            . predict double xbhat, xb
    
        pr saves the predicted probability of success, and xb saves the
        linear predicted values.
    
        Note that the use of postresults is required.  Without
        postresults, the results of the estimation with the selected
        penalty level are not stored.
    I also note that Stata 16 has built in lasso commands which may accomplish the same thing as the lassopack routines.

    Comment


    • #3
      Originally posted by William Lisowski View Post
      No experience here, but in looking into lassologit I notice some differences between your syntax and that described in the output of the help lassologit command.
      Code:
      Prediction
      
      After selecting a model, we can use predict to obtain predicted
      probabilities or linear predictions.
      
      First, we select a model using lic() in combination with
      postresults as above:
      . lassologit v58 v1-v57
      . lassologit, lic(ebic) postresults
      
      Then, we use predict:
      . predict double phat, pr
      . predict double xbhat, xb
      
      pr saves the predicted probability of success, and xb saves the
      linear predicted values.
      
      Note that the use of postresults is required. Without
      postresults, the results of the estimation with the selected
      penalty level are not stored.
      I also note that Stata 16 has built in lasso commands which may accomplish the same thing as the lassopack routines.


      Thank you Professor William. I believe that both are correct.

      I used the command that you provided me with and I got the same exact error.

      Code:
      . lassologit, lic(ebic) postresults
      Use lambda=118.077676822632 (selected by EBIC).
          st_matrixcolstripe():  3300  argument out of range
                ereturn_beta():     -  function returned error
                 PostResults():     -  function returned error
                       <istmt>:     -  function returned error
      Thank you again for your fast response

      Comment


      • #4
        Update: I found missing values (they equaled to ".") in one of my variables. I removed the missing values and the code ran normally.

        Comment


        • #5
          This has been fixed with Said's help. Many thanks to him for pointing this out.

          If you encounter this error, please update lassologit using

          Code:
          net install lassopack, from("https://raw.githubusercontent.com/statalasso/lassopack/master/") replace
          to version 1.4.2 (or above).
          --
          Tag me or email me for ddml/pdslasso/lassopack/pystacked related questions. I don't check Statalist.

          Comment


          • #6
            Dears,

            a silly question probably.

            I am running one logit lasso for each year of a panel.

            I am not interested in the post-estimation logit, but rather on the variables the lasso selects for each year (i.e., whether the post logit converges or not is not an issue now).

            From the help file I do not see any macro containing the selected variables (i.e., the macro e(selected) available for rlassologit and lassologit for instance).

            A second option is to use the Stata18 lasso command (selected variables are stored into the macro e(allvars_sel)), but there the issue is that when the post estimation does not converge the loop I wrote stops working (see below the code I used, maybe there's something missing or incorrect).

            Code:
            forvalues i=2004(1)2020 {
            lasso logit dep_var var1 var2 varN if year==`i', selection(cv, folds(5)) nolog 
            estimate store logit`i'
            g sel_probit`i'=e(allvars_sel)
            di e(allvars_sel)
            if _rc == 0 {
            continue
            }
            }

            Many thanks,

            Federico



            Comment


            • #7
              Dears,

              I would like to apply lasso for my model. Unforturnately, my dependent variable has zero inflated distribution. I wonder whether anyone of you experienced such issue and share code with me? Thank you in advance. An Dao

              Comment

              Working...
              X