Announcement

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

  • Sergiy Radyakin
    started a topic outreg error

    outreg error

    Has anyone encountered this error with outreg?

    Code:
    . outreg using c:\tmp\regressions1.doc, merge
                    MergeL():  3499  selectindex() not found
                     Merge():     -  function returned error
                  FrmtFill():     -  function returned error
                     <istmt>:     -  function returned error
    r(3499);
    Outreg is a user-written module, installed from:
    outreg from http://fmwww.bc.edu/RePEc/bocode/o

    Code:
    . which outreg
    c:\ado\plus\o\outreg.ado
    *! Write formatted regression output to a text file
    *! version 4.31  12jul2015 by John Luke Gallup ([email protected])
    Click image for larger version

Name:	outreg.png
Views:	1
Size:	24.9 KB
ID:	1305771

  • Nick Cox
    replied
    I don't have a solution to #16 but there seems no reason to mention the issue in this thread when it is being aired directly.

    Leave a comment:


  • Daniel Gomez
    replied
    It seems that my problem with the ppmlhdfe comand is that my version of Stata 11.2 that does not have the selectindex() command built in.
    I dont know what to do.

    Leave a comment:


  • Nick Cox
    replied
    You did that earlier -- https://www.statalist.org/forums/for...ppmlhdfe-error -- but you'd increase your chance of a good answer by adding there some details of what you tried by way of code.

    Leave a comment:


  • Nick Cox
    replied
    On the face of it, that error is nothing to with outreg and in any case is hard to diagnose without any other details. Please read the FAQ Advice and start a new thread mentioning ppmlhdfe in the title.

    Leave a comment:


  • Daniel Gomez
    replied
    I am using Stata 11.
    I am testing the ppmlhdfe comand but I have this error:

    GLM::init_variables(): - function returned error
    <istmt>: - function returned error
    r(3499);

    Leave a comment:


  • Nick Cox
    replied
    The same problem as that in which post?

    outreg on SSC states that it should work in Stata 10.1 (upwards). So, what error do you get?

    Leave a comment:


  • Daniel Gomez
    replied
    What can I do if I have Stata 11 to fix the same problem?

    Leave a comment:


  • Nick Cox
    replied
    The program author John Gallup is a member here but posts intermittently. If you don't get a quick answer from him, or anybody else, I would advise using direct email.

    Richard knows this but to prevent confusion it may help others to know that outreg is now not at all the same as outreg2.

    Leave a comment:


  • Richard Palmer-Jones
    replied
    I have a similar problem with outreg (Stata 16.1 5/1/2021; outreg 4.32):

    Code:
    . outreg
                  MakeSmat():  3499  _CColJoin() not found
                 CalcStats():     -  function returned error
                     <istmt>:     -  function returned error
    r(3499);

    Leave a comment:


  • John Gallup
    replied
    The outreg code should now run in Stata 10 or higher. I used Hua's suggestion to replace the selectindex() function. Several months ago I rewrote the code to merge two outreg tables to address an unusual way that users might want to merge tables, but did not notice that selectindex() is a post-Stata 10 function. Thanks for tracking down the problem and suggesting a solution. The corrected version is outreg 4.32.

    Leave a comment:


  • Sergiy Radyakin
    replied
    Thank you, Hua, for demonstrating how the function can be implemented in an earlier version of Stata. Yesterday, I have contacted the author of outreg John Luke Gallup off the list and he confirmed he intends to correct this issue in a future release. Best, Sergiy

    Leave a comment:


  • Hua Peng (StataCorp)
    replied
    For this particular issue, there is an "easy" workaround since the missing Mata function selectindex() is fairly trivial. We can implement our own version of selectindex(v) in Stata 12. According to documentation, selectindex(v) returns

    HTML Code:
    1. a row vector of column indices j for which v[j]!=0 (v a row vector) or
    2. a column vector of row indices i for which v[i]!=0 (v a column vector)

    Code:
    *! version 1.0.0  11aug2015
    version 12.0
    
    mata:
    
    real vector selectindex(real vector v)
    {
        real scalar row, col, cnt, i
        vector res
        
        row = rows(v)
        col = cols(v)
        
        cnt = 1
        res = J(1, row*col, 0)
        for(i=1; i<=row*col; i++) {
            if(v[i] != 0) {
                res[cnt] = i ;
                cnt++ ;
            }
        }
        
        if(cnt>1) {
            res = res[1, 1..cnt-1]
        }
        else {
            res = J(1, 0, 0)
        }
        
        if(row>1) {
            res = res'
        }
        
        return(res)
    }
    
    end
    We save the code to a file named select.mata. Then we create a Mata library lmyselect.mlib and add our version of selectindex() to the library


    Code:
    do select.mata
    mata: mata mlib create lmyselect
    mata: mata mlib add lmyselect selectindex()
    In order for Stata to be able to find and use the function, we need move the lmyselect.mlib to somewhere in Stata's ado path. I choose to put it under my Stata's PLUS directory c:\ado\plus\l\. Now -outreg, merge- works in Stata 12 using our version of selectindex().

    Code:
    . sysuse auto
    (1978 Automobile Data)
    
    . qui reg mpg price
    
    . outreg using test.doc
    
                                  --------------------
                                              mpg    
                                  --------------------
                                   price    -0.001   
                                           (4.50)**  
                                   _cons    26.964   
                                           (19.34)**
                                   R2        0.22    
                                   N          74     
                                  --------------------
                                  * p<0.05; ** p<0.01
    
    
    . qui reg mpg price weight
    
    . outreg using test.doc, merge
    
                            --------------------------------
                                         mpg        mpg    
                            --------------------------------
                             price     -0.001     -0.000   
                                      (4.50)**    (0.57)   
                             weight               -0.006   
                                                 (9.42)**  
                             _cons     26.964     39.440   
                                      (19.34)**  (24.32)**
                             R2         0.22       0.65    
                             N           74         74     
                            --------------------------------
                                  * p<0.05; ** p<0.01

    Leave a comment:


  • Nick Cox
    replied
    That claim is thus incorrect, or at least out-of-date. This problem has been much discussed on the forum. The only sure-fire way to test that a program runs with Stata X is to run it in Stata X.

    Leave a comment:


  • Sergiy Radyakin
    replied
    Dear Hua and Nick, thank you very much for your answers.
    Indeed the error was observed in version 12. However the outreg package declares compatibility with v10.1 and I recall using it with older Stata versions, so I assumed it was my problem only.

    Code:
    type http://fmwww.bc.edu/RePEc/bocode/o/outreg.pkg
    ...
    d Requires: Stata version 10.1
    ...
    Thank you very much, Sergiy Radyakin

    Leave a comment:

Working...
X