Announcement

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

  • telasso does not work with mi estimate

    Dear all,
    I am fully aware of the fact that mi estimate does not officially support telasso, yet I think this seems to me like a programming bug and not a question of statistical validity. The setup is as follows:
    Code:
    clear all
    version 18.0
    sysuse nlsw88
    
    * Imputation
    mi set flong
    mi register imputed union wage hours tenure south
    mi impute chained (pmm, knn(4)) union wage hours tenure south ///
        , add(3) rseed(123) dots
        
    * Estimation
    mi estimate, cmdok dots: ///
        telasso (wage tenure south hours, linear) (union tenure south, logit)
    The output is this:
    Code:
    . clear all
    
    . version 18.0
    
    . sysuse nlsw88
    (NLSW, 1988 extract)
    
    . 
    . * Imputation
    . mi set flong
    
    . mi register imputed union wage hours tenure south
    (379 m=0 obs now marked as incomplete)
    
    . mi impute chained (pmm, knn(4)) union wage hours tenure south ///
    >         , add(3) rseed(123) dots
    note: variables wage south contain no soft missing (.) values; imputing nothing
    
    Conditional models:
                 hours: pmm hours wage south tenure union , knn(4)
                tenure: pmm tenure wage south hours union , knn(4)
                 union: pmm union wage south hours tenure , knn(4)
    
    Performing chained iterations:
      imputing m=1 through m=3 ... done
    
    Multivariate imputation                     Imputations =        3
    Chained equations                                 added =        3
    Imputed: m=1 through m=3                        updated =        0
    
    Initialization: monotone                     Iterations =       30
                                                    burn-in =       10
    
                 union: predictive mean matching
                  wage: predictive mean matching
                 hours: predictive mean matching
                tenure: predictive mean matching
                 south: predictive mean matching
    
    ------------------------------------------------------------------
                       |               Observations per m             
                       |----------------------------------------------
              Variable |   Complete   Incomplete   Imputed |     Total
    -------------------+-----------------------------------+----------
                 union |       1878          368       368 |      2246
                  wage |       2246            0         0 |      2246
                 hours |       2242            4         4 |      2246
                tenure |       2231           15        15 |      2246
                 south |       2246            0         0 |      2246
    ------------------------------------------------------------------
    (Complete + Incomplete = Total; Imputed is the minimum across m
     of the number of filled-in observations.)
    
    .         
    . * Estimation
    . mi estimate, cmdok dots: ///
    >         telasso (wage tenure south hours, linear) (union tenure south, logit)
    
    Imputations (3):
      .invalid syntax
    r(198);
    Apparently, the process fails after the first imputation. I then used the nois option to check what is going on. The concrete error:
    Code:
    file /tmp/St02964.000001.stxer already exists
    Of course, deleting this file manually does not solve the issue as a new one is created in the estimation loop over all imputed samples every time. I wonder what happens here, as mi estimate only collects the results over the various samples, I don't understand why telasso needs to keep some file in memory once the statistics of interest have been generated. What one can do is to estimate telasso separately for each imputed sample, collect the statistics of interest manually and apply Rubin's rules. But this should work in the automated way as well.
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

  • #2
    Because the asymptotic arguments underlying LASSO are pretty intricate even when using complete cases, perhaps there are statistical reasons for not allowing multiple imputation with telasso. If it is more of a coding bug then I'd be curious as to how the uncertainly from imputation is being handled.

    Comment


    • #3
      Dear Felix and Jeff,

      The command is not supported with -mi estimate-. The issue in the code above, is that Felix used the option -cmdok- which bypasses the checks we put in place. -cmdok- is used to bless an unsupported command, a blessing that should be bestowed carefully and that we did not provide originally. If you run the code without the option -cmdok-, it will error out telling you that -telasso- is not supported.

      Comment

      Working...
      X