I am studying the GAUSS code to run the MDCEV model(Bhat, 2008).
While running the code, I got the error message "G0152: Variable not initialized" with the following contents
if _ranms==0 and _errms==1;
EQMATMSS = eye(cols(rrms));
elseif _ranms==1 .and _errms==0;
EQMATMSS = eye(rows(posms));
elseif _ranms==1 .and _errms==1;
EQMATMSS = eye(rows(posms)+cols(rrms));
endif;
Please let me know how to revise the code.
Thanks for everyone's help.
1 Answer
0
The error "G0152: Variable not initialized" indicates that the program is trying to use the value of a variable that has not been yet created. For example, if this was your entire program:
// Clear all data from GAUSS
new;
_errms = 1;
rrms = { 1 2,
3 4 };
posms = { 5 6,
7 8 };
if _ranms==0 and _errms==1;
EQMATMSS = eye(cols(rrms));
elseif _ranms==1 .and _errms==0;
EQMATMSS = eye(rows(posms));
elseif _ranms==1 .and _errms==1;
EQMATMSS = eye(rows(posms)+cols(rrms));
endif;
we would get an error from the line if _ranms==0 and _errms==1;
, because _ranms
has not be assigned a value yet, but the program is trying to use it.
Which link did you download the code from?
Your Answer
1 Answer
The error "G0152: Variable not initialized" indicates that the program is trying to use the value of a variable that has not been yet created. For example, if this was your entire program:
// Clear all data from GAUSS
new;
_errms = 1;
rrms = { 1 2,
3 4 };
posms = { 5 6,
7 8 };
if _ranms==0 and _errms==1;
EQMATMSS = eye(cols(rrms));
elseif _ranms==1 .and _errms==0;
EQMATMSS = eye(rows(posms));
elseif _ranms==1 .and _errms==1;
EQMATMSS = eye(rows(posms)+cols(rrms));
endif;
we would get an error from the line if _ranms==0 and _errms==1;
, because _ranms
has not be assigned a value yet, but the program is trying to use it.
Which link did you download the code from?