'Numlist limits in Stata lower than -help limits- suggests

I am using a Stata command, synth, that takes a numlist as an argument.

I need the numlist to take 2,000+ values. Note that forvalues is not a viable work-around in this context, unless I am mistaken. I am using Stata MP 13.1. In help limits it says that the size limit for a numlist is 2,500. However, when I run the following code, I receive error code "r(123) invalid numlist has too many elements."

foreach i of numlist 1/1601 {
   display `i'
}

This code runs without an error:

foreach i of numlist 1600{
    display `i'
}

Is there a way to allow a larger numlist than 1,600 elements? Also, why does help limits tell me I have 2,500 to work with, but not allow more than 1,600?

Edited to add: nlist, used to parse a numlist, specifies a maximum of 1,600. So perhaps 1,600 is the proper maximum? In that case, the help limits page seems to be incorrect.

Second edit to add: synth is a matching command, and you provide it with a numlist of control units to include in the matching procedure. So if you have a panel with 2000 units and 10 time periods, you might specify 1,999 units to be included as potential control units. It might be possible to use forvalues, but it would require editing the synth ado file somewhat significantly.



Solution 1:[1]

While I couldn't find the numlist error easily in the .ado file. I am getting around this issue by selecting a subsample of donors for the synthetic control, with the number of groups equal to the limit of numlist. In my case I want to keep most of the donors that are logically in the proximity (geographically or similar population or other characteristics) of the treated unit. I subsample those first and I fill up the limit with additional units selected randomly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1