Variable Initialized Error: Bhat MDCEV(2008)

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?

aptech

1,773

Your Answer

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?


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.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy