Thanks Jos for the comments,
I will mention in the next release help the range of the coefficient.
Also, I'll switch the default behaviour to sample correction (statistically speaking the probability that somebody will apply this fcn to a sample than to the population is higher...)
The scalar input issue is tricky.
The formula with the sample correction yields NaN, without correction 0
I suppose it's better to write off this case somehow...
I think I'll extend the IDXneg behavior to include the one element case too, making a more general warning....
Nicely coded, with copious internal comments! As a suggestion for improvement, you could mention in the help that the coefficient can range from 0 (no dispersion, complete equality) to 1 (total inequality), as you do on the fex page. By the way, ginicoeff(ScalarValue) is now 0, but I think it should be 1, as it is total inequality since one gets all, but it is also equal ... I got confused.
And why is the correction not the default, so it truly ranges from 0 to 1?