Announcement

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

  • Package: Statapackagesearch returns maxvar error

    I wanted to try out the package statapackagesearch by the Labor Dynamics Institute.
    I have followed the instructions in the Github repo, installed the package using and ran:
    Code:
    net install packagesearch, from("https://labordynamicsinstitute.github.io/Statapackagesearch/")
    packagesearch, codedir("C:/Users/fkays/Desktop/scripts") filesave
    However, Stata returns:
    Code:
    maxvar must be between 2,048 and 32,767
        maxvar specifies the maximum number of variables allowed in your data; see help memory.  maxvar is currently set to 32,767.
        When Stata ships from the factory, maxvar is set to 5,000.  Increasing maxvar allows you to have more variables, but increases
        Stata's memory usage slightly.
    r(198);
    and the problem persists after setting maxvar to 32767.

    Has anyone else encountered this problem?

    Crossposted on Github package site.
    Cheers,
    Felix
    Stata Version: MP 18.0
    OS: Windows 11

  • #2
    The problem is on line 32 of this file. I guess they developed this package with Stata MP in mind. You can just go into the ado file on your file system and change the line, but I have no idea why you might need to set the maxvar for this package in the first place, so I don't know what the consequences might be. Maybe they need that much space to store all of the package data? (if so, they may benefit from another data storage scheme.)

    This looks like well written code, but I personally don't love that they manipulate the environment the way they do. They -clear all- when they should use a frame or other encapsulated object, -set more off- every time you run the package seems really bad for anyone looking to debug some complicated code that uses this, and of course there is the issue you've found with -set maxvar-.

    Comment


    • #3
      Thank you, Daniel Schaefer! I might just try your solution out.
      Cheers,
      Felix
      Stata Version: MP 18.0
      OS: Windows 11

      Comment

      Working...
      X