Change in uniqindxsa?

Hi,

I ran a program several years ago (using Gauss 11) in which I applied uniqindxsa to a vector of characters (product names) extracted from a matrix using makevars.

Am now running the same program but now get an error message stating

Incorrect input: uniqIndxSA accepts only Nx1 or 1xN string arrays [uniquesa.src, line 122]

Has there been a change to the way this routine works (and is there a quick fix to converting the vector of product names so this command can still be used?)

cheers

David Prentice

1 Answer



0



Quick fix
If you have a matrix of strings that you want to pass to uniqueIndxSA, then you can convert the string matrix to a string array with the vecr function. vecr is very fast since it does not have to actually change the layout of the string data, it just has to change some internal bookkeeping about the dimensions of the string array. For example:

string vnames = {    "gdp"     "inflation",
                  "t-bill"           "gdp",
                  "exports"          "gdp" };

vnames = vecr(vnames);
u_idx = uniqIndxSA(vnames);

print "unique variable names include: " vnames[u_idx];

Behavior change
The behavior has stayed consistent with the documentation, however, stronger error checking for inputs was added. This change was added in version 12 or 13.

aptech

1,773

Your Answer

1 Answer

0

Quick fix
If you have a matrix of strings that you want to pass to uniqueIndxSA, then you can convert the string matrix to a string array with the vecr function. vecr is very fast since it does not have to actually change the layout of the string data, it just has to change some internal bookkeeping about the dimensions of the string array. For example:

string vnames = {    "gdp"     "inflation",
                  "t-bill"           "gdp",
                  "exports"          "gdp" };

vnames = vecr(vnames);
u_idx = uniqIndxSA(vnames);

print "unique variable names include: " vnames[u_idx];

Behavior change
The behavior has stayed consistent with the documentation, however, stronger error checking for inputs was added. This change was added in version 12 or 13.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.