Announcement

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

  • Function not found from .mlib or .mo file

    Dear all,

    I am currently using two SSC packages—ivreg2 and fuzzydid—in an offline environment running Stata 14. Since the system does not have internet access, I was unable to install these packages via ssc install ivreg2 or ssc install fuzzydid. Instead, I manually moved the necessary files to a local folder and used adopath+ to link to that folder.

    However, some .mlib or .mo functions do not seem to be recognized. Specifically, when I use findfile, Stata correctly shows the file locations (inside the adopath+-linked folder):

    Code:
    // ivreg2
    findfile livreg2.mlib
    
    // fuzzydid
    findfile qq_transfo.mo  
    findfile my_sort.mo  
    findfile createYvalues.mo
    But when I run the following code, Stata fails to recognize some functions (only createYvalues() from fuzzydid is recognized):

    Code:
    // ivreg2
    mata: mata describe using livreg2    // ---> .mlib from a more recent version of Stata  
    mata: mata which ms_vcvorthog()      // ---> function not found
    
    // fuzzydid
    mata: mata which qq_transfo()        // ---> function not found  
    mata: mata which my_sort()           // ---> function not found  
    mata: mata which createYvalues()
    I’m not very familiar with .mo or .mlib in Stata, so I’m not entirely sure whether the problem is version-related. According to ssc describe, ivreg2 should be compatible with Stata 11.2 and fuzzydid with Stata 13.1 or later, so it seems they should work in Stata 14. (ssc describe ivreg2 or ssc describe fuzzydid)

    If this is a version issue, is there a way to determine which version of Stata is required to run these functions, or any workaround to make them work in Stata 14?

  • #2
    I think you need to tell Stata to index the mata libraries again after setting the adopath. Try adding
    Code:
    mata: mata mlib index
    after you add the local folder to the adopath. Hope it works.

    Comment

    Working...
    X