StatTransfer problem?

Dear forum,

I am wondering if there's a problem with datasets generated in STATA that are subsequently transferred to GAUSS using StatTransfer. I get the message

"G0071: Type mismatch".

Which suggests that my dataset contains strings. All my variable are, however, float or float with double precision. I hence wonder if there may be a GAUSS/StatTransfer compatability problem.

Helpful comments are very welcome!

4 Answers



0



Which GAUSS function is giving you the G0071: Type mismatch error? What happens if you try to load your dataset into a GAUSS matrix with loadd like this:

x = loadd("mydataset.dat");

aptech

1,773


0



The command is

varx = ((ones(rows(years),1).*"T")$+sst[1+lagl:rows(years)+lagl])|varx;

it's in line 983 of the file.



0



I think the problem is with the old style of using multiplication to reshape a character vector. It would be best to convert to string arrays. They do not have a limit on the number of characters, etc. However, the simplest fix is to replace the line:

varx = ((ones(rows(years),1).*"T")$+sst[1+lagl:rows(years)+lagl])|varx;

with this:

varx = ((reshape(satocv("T"), rows(years), 1)) $+sst[1+lagl:rows(years)+lagl])|varx;

aptech

1,773


0



That worked, thanks a lot!!

I do, however, now get yet another error message that relates to the new matrix "varx". It says:

G0058: Index out of range [expend.prg, line 1362]

The corresponding lines are ("if lx[jj]==0;" is the line where the program stops):

jj = 1;
do until j>rows(varx);
   format /ldn;
   if lx[jj]==0;
   format 12,0;
else;

Would it be less difficult to run my old programs if I downconverted GAUSS to version 10 or so?

Your Answer

4 Answers

0

Which GAUSS function is giving you the G0071: Type mismatch error? What happens if you try to load your dataset into a GAUSS matrix with loadd like this:

x = loadd("mydataset.dat");
0

The command is

varx = ((ones(rows(years),1).*"T")$+sst[1+lagl:rows(years)+lagl])|varx;

it's in line 983 of the file.

0

I think the problem is with the old style of using multiplication to reshape a character vector. It would be best to convert to string arrays. They do not have a limit on the number of characters, etc. However, the simplest fix is to replace the line:

varx = ((ones(rows(years),1).*"T")$+sst[1+lagl:rows(years)+lagl])|varx;

with this:

varx = ((reshape(satocv("T"), rows(years), 1)) $+sst[1+lagl:rows(years)+lagl])|varx;
0

That worked, thanks a lot!!

I do, however, now get yet another error message that relates to the new matrix "varx". It says:

G0058: Index out of range [expend.prg, line 1362]

The corresponding lines are ("if lx[jj]==0;" is the line where the program stops):

jj = 1;
do until j>rows(varx);
   format /ldn;
   if lx[jj]==0;
   format 12,0;
else;

Would it be less difficult to run my old programs if I downconverted GAUSS to version 10 or so?


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.