Announcement

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

  • Categorical Variable in Mata: factor() not found * r(3499);

    I am trying to define two categorical variables (factors) in mata. My command is as follows:

    mata: F_c = factor("c")
    mata: F_c.panelsetup()
    mata: F_csgroup = factor("c sgroup")
    mata: F_csgroup.panelsetup()


    The above code used to work until last week before I got Windows 11 updated on my work computer. I had to reinstall stata and all important ssc packages after the update.

    Now however the above command refuses to work and I get the error:

    mata: F_c = factor("c")
    <istmt>: 3499 factor() not found
    r(3499);


    The code works on my personal laptop's stata and I tried matching all the ssc packages installed and ado files saved. The error still persists. Grateful for advice on this.
    Last edited by Akanksha IHEID; 14 Oct 2023, 21:31.

  • #2
    I don't think there has ever been a factor() function in Mata. There is a factor() function in Sergio Correia's ftools (https://github.com/sergiocorreia/ftools); perhaps you did not download this from SSC but from some place else?

    Comment


    • #3
      Hi Daniel. Thanks for your response. I managed to solve the error by comparing "C\ado\plus" folder from my personal laptop (where the code worked) to the same folder in my work laptop. I pasted the ado files that were missing in my newly installed stata and ran the 'update all' command. This solved the issue.

      Comment

      Working...
      X