Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • varlist not allowed

    Dear Statalist,

    I am trying to estimate a 7 goods QUAIDS model with 5 household demographics characteristics. I am getting this error message: varlist not allowed

    Here is first step:

    program nlsurquaids13;
    version 13.1;
    syntax varlist(min=20 max=20) if, at(name);
    tokenize `varlist';
    args w1 w2 w3 w4 w5 w6 w7 wp1 wp2 wp3 wp4 wp5 wp6 wp7 lnexp x1 x2 x3 x4 x5;

    Thank you in advance for help and advices

    Thank you,
    Rais

  • #2
    Your code is part of a program. What did you type immediately before getting that error message?

    Comment


    • #3
      Hi Nick,

      Here is my code:

      ******************************************
      ************Estimation *************
      set trace off
      program nlsurquaids13;
      version 13.1;
      syntax varlist(min=20 max=20) if, at(name);
      tokenize `varlist';
      args w1 w2 w3 w4 w5 w6 w7 wp1 wp2 wp3 wp4 wp5 wp6 wp7 lnexp x1 x2 x3 x4 x5;

      ************************************************
      ***parameters are best viewed as a single vector
      ***********************************************
      ********first 7 alphas*************************
      tempname a1 a2 a3 a4 a5 a6 a7;
      scalar `a1' = `at'[1,1];
      scalar `a2' = `at'[1,2];
      scalar `a3' = `at'[1,3];
      scalar `a4' = `at'[1,4];
      scalar `a5' = `at'[1,5];
      scalar `a6' = `at'[1,6];
      scalar `a7' = 1 - `a1' - `a2' - `a3'- `a4' - `a5'- `a6';

      ******first 7 betas****************************
      tempname b1 b2 b3 b4 b5 b6 b7;
      scalar `b1' = `at'[1,7];
      scalar `b2' = `at'[1,8];
      scalar `b3' = `at'[1,9];
      scalar `b4' = `at'[1,10];
      scalar `b5' = `at'[1,11];
      scalar `b6' = `at'[1,12];
      scalar `b7' = -`b1' - `b2' - `b3' - `b4'- `b5' - `b6';

      ****vector gamma star k rows and columns of gamma***

      tempname g11 g12 g13 g14 g15 g16 g17;
      tempname g21 g22 g23 g24 g25 g26 g27;
      tempname g31 g32 g33 g34 g35 g36 g37;
      tempname g41 g42 g43 g44 g45 g46 g47;
      tempname g51 g52 g53 g54 g55 g56 g57;
      tempname g61 g62 g63 g64 g65 g66 g67;
      tempname g71 g72 g73 g74 g75 g76 g77;

      scalar `g11' = `at'[1,13];
      scalar `g12' = `at'[1,14];
      scalar `g13' = `at'[1,15];
      scalar `g14' = `at'[1,16];
      scalar `g15' = `at'[1,17];
      scalar `g16' = `at'[1,18];
      scalar `g17' = -`g11' - `g12' - `g13' - `g14'- `g15' - `g16';

      scalar `g21' = `g12';
      scalar `g22' = `at'[1,19];
      scalar `g23' = `at'[1,20];
      scalar `g24' = `at'[1,21];
      scalar `g25' = `at'[1,22];
      scalar `g26' = `at'[1,23];
      scalar `g27' = -`g21' - `g22' - `g23' - `g24'- `g25' - `g26';

      scalar `g31' = `g13';
      scalar `g32' = `g23';
      scalar `g33' = `at'[1,24];
      scalar `g34' = `at'[1,25];
      scalar `g35' = `at'[1,26];
      scalar `g36' = `at'[1,27];
      scalar `g37' = -`g31' - `g32' - `g33' - `g34'- `g35' - `g36';

      scalar `g41' = `g14';
      scalar `g42' = `g24';
      scalar `g43' = `g34';
      scalar `g44' = `at'[1,28];
      scalar `g45' = `at'[1,29];
      scalar `g46' = `at'[1,30];
      scalar `g47' = -`g41' - `g42' - `g43' - `g44'- `g45' - `g46';

      scalar `g51' = `g15';
      scalar `g52' = `g25';
      scalar `g53' = `g35';
      scalar `g54' = `g45';
      scalar `g55' = `at'[1,31];
      scalar `g56' = `at'[1,32];
      scalar `g57' = -`g51' - `g52' - `g53' - `g54'- `g55' - `g56'

      scalar `g61' = `g16'
      scalar `g62' = `g26'
      scalar `g63' = `g36'
      scalar `g64' = `g46'
      scalar `g65' = `g56'
      scalar `g66' = `at'[1,33]
      scalar `g67' = -`g61' - `g62' - `g63' - `g64'- `g65' - `g66';

      scalar `g71' = `g17';
      scalar `g72' = `g27';
      scalar `g73' = `g37';
      scalar `g74' = `g47';
      scalar `g75' = `g57';
      scalar `g76' = `g67';
      scalar `g77' = -`g71' - `g72' - `g73' - `g74'- `g75' - `g76';

      ******first 7 lambdas***************************
      tempname l1 l2 l3 l4 l5 l6 l7;
      scalar `l1' = `at'[1,34];
      scalar `l2' = `at'[1,35];
      scalar `l3' = `at'[1,36];
      scalar `l4' = `at'[1,37];
      scalar `l5' = `at'[1,38];
      scalar `l6' = `at'[1,39];
      scalar `l7' = - `l1' - `l2' - `l3' - `l4'- `l5' - `l6';

      *******constant and household demographics**************

      tempname r11 r12 r13 r14 r15;
      tempname r21 r22 r23 r24 r25;
      tempname r31 r32 r33 r34 r35;
      tempname r41 r42 r43 r44 r45;
      tempname r51 r52 r53 r54 r55;
      tempname r61 r62 r63 r64 r65;
      tempname r71 r72 r73 r74 r75;

      scalar `r11' = `at'[1,40];
      scalar `r12' = `at'[1,41];
      scalar `r13' = `at'[1,42];
      scalar `r14' = `at'[1,43];
      scalar `r15' = `at'[1,44];


      scalar `r21' = `at'[1,45];
      scalar `r22' = `at'[1,46];
      scalar `r23' = `at'[1,47];
      scalar `r24' = `at'[1,48];
      scalar `r25' = `at'[1,49];

      scalar `r31' = `at'[1,50];
      scalar `r32' = `at'[1,51];
      scalar `r33' = `at'[1,52];
      scalar `r34' = `at'[1,53];
      scalar `r35' = `at'[1,54];

      scalar `r41' = `at'[1,55];
      scalar `r42' = `at'[1,56];
      scalar `r43' = `at'[1,57];
      scalar `r44' = `at'[1,58];
      scalar `r45' = `at'[1,59];

      scalar `r51' = `at'[1,60];
      scalar `r52' = `at'[1,61];
      scalar `r53' = `at'[1,62];
      scalar `r54' = `at'[1,63];
      scalar `r55' = `at'[1,64];

      scalar `r61' = `at'[1,65];
      scalar `r62' = `at'[1,66];
      scalar `r63' = `at'[1,67];
      scalar `r64' = `at'[1,68];
      scalar `r65' = `at'[1,69];

      scalar `r71' = `at'[1,70];
      scalar `r72' = `at'[1,71];
      scalar `r73' = `at'[1,72];
      scalar `r74' = `at'[1,73];
      scalar `r75' = `at'[1,74];



      // calculate the expenditure shares.
      quietly {;
      // price index
      // with set a_0 = 5
      tempvar lnpindex;
      gen double `lnpindex' = 5 + `a1'*`wp1' + `a2'*`wp2' + `a3'*`wp3' + `a4'*`wp4'+ `a5'*`wp5' + `a6'*`wp6' + `a7'*`wp7';
      forvalues i = 1/7 {;
      forvalues j = 1/7 {;
      replace `lnpindex' = `lnpindex' + 0.5*`g`i'`j''*`wp`i''*`wp`j'';
      };
      };
      // The b(p) term in the QUAIDS model:
      tempvar bofp;
      gen double `bofp' = 0;
      forvalues i = 1/7 {;
      replace `bofp' = `bofp' + `lnp`i''*`b`i'';
      };
      replace `bofp' = exp(`bofp');

      // Finally, the expenditure shares for 6 of the 7
      // goods (the fourth is dropped to avoid singularity)
      replace `w1' = (`a1' + `g11'*`wp1' + `g12'*`wp2' + `g13'*`wp3' + `g14'*`wp4' + `g15'*`wp5' + `g16'*`wp6' + `g17'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l1'/`bofp'*(`lnexp' - `lnpindex')^2 + `r11'*`x1' +`r12'*`x2' +`r13'*`x3' +`r14'*`x4'+`r15'*`x5');

      replace `w2' = (`a2' + `g21'*`wp1' + `g22'*`wp2' + `g23'*`wp3' + `g24'*`wp4' + `25'*`wp5' + `g26'*`wp6' + `g27'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l2'/`bofp'*(`lnexp' - `lnpindex')^2 + `r21'*`x1' +`r22'*`x2' +`r23'*`x3' +`r24'*`x4'+`r25'*`x5');

      replace `w3' = (`a3' + `g31'*`wp1' + `g32'*`wp2' + `g33'*`wp3' + `g34'*`wp4' + `35'*`wp5' + `g36'*`wp6' + `g37'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l3'/`bofp'*(`lnexp' - `lnpindex')^2 + `r31'*`x1' +`r32'*`x2' +`r33'*`x3' +`r34'*`x4'+`r35'*`x5');

      replace `w4' = (`a4' + `g41'*`wp1' + `g42'*`wp2' + `g43'*`wp3' + `g44'*`wp4' + `45'*`wp5' + `g46'*`wp6' + `g47'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l4'/`bofp'*(`lnexp' - `lnpindex')^2 + `r41'*`x1' +`r42'*`x2' +`r43'*`x3' +`r44'*`x4'+`r45'*`x5');

      replace `w5' = (`a5' + `g51'*`wp1' + `g52'*`wp2' + `g53'*`wp3' + `g54'*`wp4' + `55'*`wp5' + `g56'*`wp6' + `g57'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l5'/`bofp'*(`lnexp' - `lnpindex')^2 + `r51'*`x1' +`r52'*`x2' +`r53'*`x3' +`r54'*`x4'+`r55'*`x5');

      replace `w6' = (`a6' + `g61'*`wp1' + `g62'*`wp2' + `g63'*`wp3' + `g64'*`wp4' + `65'*`wp5' + `g66'*`wp6' + `g67'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l6'/`bofp'*(`lnexp' - `lnpindex')^2 + `r61'*`x1' +`r62'*`x2' +`r63'*`x3' +`r64'*`x4'+`r65'*`x5');

      replace `w7' = (`a7' + `g71'*`wp1' + `g72'*`wp2' + `g73'*`wp3' + `g74'*`wp4' + `75'*`wp5' + `g76'*`wp6' + `g77'*`wp7' + `b1'*(`lnexp' - `lnpindex') + ///
      `l7'/`bofp'*(`lnexp' - `lnpindex')^2 + `r71'*`x1' +`r72'*`x2' +`r73'*`x3' +`r74'*`x4'+`r75'*`x5');
      };
      end;

      nlsur aids13 @ w1 w2 w3 w4 w5 w6 w7 wp1-wp7 lnexp x1 x2 x3 x4 x5, parameters(a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7 g11 g12 g13 g14 g15 g16 g17
      g22 g23 g24 g25 g26 g27 g33 g34 g35 g36 g37 g44 g45 g46 g47 g55 g56 g57 g66 g67 g77 l1 l2 l3 l4 l5 l6 l7 r11 r12 r13 r14 r15
      r21 r22 r23 r24 r25 r31 r32 r33 r34 r35 r36 r37 r41 r42 r43 r44 r45 r46 r47 r51 r52 r53 r54 r55) neq(2) ifgnls;

      Comment


      • #4
        Why did you set trace off ? It's precisely the tool you need here.

        Also I see no #delimit ; as you if you wish to use semi-colons as delimiters you must tell Stata first.

        Comment


        • #5
          I am not a user of the nlsur command, but from a review of the syntax, it seems to me your problem lies there. With the syntax you have used, nlsur expects the first argument to be the name of a function evaluator program. Thus it is looking for a program named aids13, which it is not finding, and assumes you have instead supplied a variable list, and informs you that is not allowed.

          If the program you wrote is what you intend for nlsur to use, then your command needs to start
          Code:
          nlsur nlsurquaids13 @ w1 w2 ...

          Comment


          • #6
            Dear William Lisowski and Nick Cox

            After changed :

            #delimit;
            program nlsurquaids13;
            version 13.1;
            syntax varlist(min=20 max=20) if, at(name);
            tokenize `varlist';
            args w1 w2 w3 w4 w5 w6 w7 wp1 wp2 wp3 wp4 wp5 wp6 wp7 lnexp x1 x2 x3 x4 x5;


            and

            nlsur nlsurquaids13@ w1 w2 w3 w4 w5 w6 w7 wp1-wp7 lnexp x1 x2 x3 x4 x5, parameters(a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7 g11 g12 g13 g14 g15 g16 g17
            g22 g23 g24 g25 g26 g27 g33 g34 g35 g36 g37 g44 g45 g46 g47 g55 g56 g57 g66 g67 g77 l1 l2 l3 l4 l5 l6 l7 r11 r12 r13 r14 r15
            r21 r22 r23 r24 r25 r31 r32 r33 r34 r35 r36 r37 r41 r42 r43 r44 r45 r46 r47 r51 r52 r53 r54 r55) neq(2) ifgnls;


            the following error message:
            delimiter now ;
            . program nlsurquaids13;
            nlsurquaids13 already defined
            r(110);


            Thank you,

            Comment


            • #7
              I have tried in this way :

              cap program drop nlsurquaids13
              #delimit;
              program nlsurquaidsNPS;
              version 13.1;
              syntax varlist(min=20 max=20) if, at(name);
              tokenize `varlist';
              args w1 w2 w3 w4 w5 w6 w7 wp1 wp2 wp3 wp4 wp5 wp6 wp7 lnexp x1 x2 x3 x4 x5;

              and

              nlsur nlsurquaidsNPS@ w1 w2 w3 w4 w5 w6 w7 wp1-wp7 lnexp x1 x2 x3 x4 x5, parameters(a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7 g11 g12 g13 g14 g15 g16 g17
              g22 g23 g24 g25 g26 g27 g33 g34 g35 g36 g37 g44 g45 g46 g47 g55 g56 g57 g66 g67 g77 l1 l2 l3 l4 l5 l6 l7 r11 r12 r13 r14 r15
              r21 r22 r23 r24 r25 r31 r32 r33 r34 r35 r36 r37 r41 r42 r43 r44 r45 r46 r47 r51 r52 r53 r54 r55) neq(2) ifgnls;


              the next error message:

              nlsurnlsurquaidsNPS@ returned 199
              verify that nlsurnlsurquaidsNPS@ is a function evaluator program
              r(199);



              Thank you for helping

              Comment


              • #8
                Leave a space before and after the @ .

                Comment


                • #9
                  Dear William

                  Thank you for helping but

                  there is a space before and after the @,,,


                  but don't know what is the reason



                  Best regards,

                  Comment


                  • #10
                    This discussion continues on a new thread started by the author

                    http://www.statalist.org/forums/foru...luator-program

                    Comment


                    • #11
                      Dear William Lisowski

                      Thank you and in this post the error message was: varlist not allowed , from this point of view, I thought may be to changed discussion on new thread due to new up coming error as:
                      nlsurnlsurquaidsNPS@ returned 199
                      verify that nlsurnlsurquaidsNPS@ is a function evaluator program
                      r(199);

                      if there is wrong decision by my side we can to delete one of this post and continue our discussion in this main one....


                      About the error message I still didn't find the solution and I highly appreciate any help and advices

                      Thank you

                      Comment


                      • #12
                        Dear Colleagues,


                        Please might be someone can see if there is any mistakes in my codes, while I checked I could not find:

                        Code:
                        #delimit;
                        program nlsurquaidsNPS;
                        version 13.1;
                        syntax varlist(min=20 max=20) if, at(name);
                        tokenize `varlist';
                        args w1 w2 w3 w4 w5 w6 w7 wp1 wp2 wp3 wp4 wp5 wp6 wp7 lnexp x1 x2 x3 x4 x5;

                        ************************************************
                        ***parameters are best viewed as a single vector
                        ***********************************************
                        ********first 7 alphas*************************
                        tempname a1 a2 a3 a4 a5 a6 a7;
                        scalar `a1' = `at'[1,1];
                        scalar `a2' = `at'[1,2];
                        scalar `a3' = `at'[1,3];
                        scalar `a4' = `at'[1,4];
                        scalar `a5' = `at'[1,5];
                        scalar `a6' = `at'[1,6];
                        scalar `a7' = 1 - `a1' - `a2' - `a3'- `a4' - `a5'- `a6';

                        ******first 7 betas****************************
                        tempname b1 b2 b3 b4 b5 b6 b7;
                        scalar `b1' = `at'[1,7];
                        scalar `b2' = `at'[1,8];
                        scalar `b3' = `at'[1,9];
                        scalar `b4' = `at'[1,10];
                        scalar `b5' = `at'[1,11];
                        scalar `b6' = `at'[1,12];
                        scalar `b7' = -`b1' - `b2' - `b3' - `b4'- `b5' - `b6';

                        ****vector gamma star k rows and columns of gamma***

                        tempname g11 g12 g13 g14 g15 g16 g17;
                        tempname g21 g22 g23 g24 g25 g26 g27;
                        tempname g31 g32 g33 g34 g35 g36 g37;
                        tempname g41 g42 g43 g44 g45 g46 g47;
                        tempname g51 g52 g53 g54 g55 g56 g57;
                        tempname g61 g62 g63 g64 g65 g66 g67;
                        tempname g71 g72 g73 g74 g75 g76 g77;

                        scalar `g11' = `at'[1,13];
                        scalar `g12' = `at'[1,14];
                        scalar `g13' = `at'[1,15];
                        scalar `g14' = `at'[1,16];
                        scalar `g15' = `at'[1,17];
                        scalar `g16' = `at'[1,18];
                        scalar `g17' = -`g11' - `g12' - `g13' - `g14'- `g15' - `g16';

                        scalar `g21' = `g12';
                        scalar `g22' = `at'[1,19];
                        scalar `g23' = `at'[1,20];
                        scalar `g24' = `at'[1,21];
                        scalar `g25' = `at'[1,22];
                        scalar `g26' = `at'[1,23];
                        scalar `g27' = -`g21' - `g22' - `g23' - `g24'- `g25' - `g26';

                        scalar `g31' = `g13';
                        scalar `g32' = `g23';
                        scalar `g33' = `at'[1,24];
                        scalar `g34' = `at'[1,25];
                        scalar `g35' = `at'[1,26];
                        scalar `g36' = `at'[1,27];
                        scalar `g37' = -`g31' - `g32' - `g33' - `g34'- `g35' - `g36';

                        scalar `g41' = `g14';
                        scalar `g42' = `g24';
                        scalar `g43' = `g34';
                        scalar `g44' = `at'[1,28];
                        scalar `g45' = `at'[1,29];
                        scalar `g46' = `at'[1,30];
                        scalar `g47' = -`g41' - `g42' - `g43' - `g44'- `g45' - `g46';

                        scalar `g51' = `g15';
                        scalar `g52' = `g25';
                        scalar `g53' = `g35';
                        scalar `g54' = `g45';
                        scalar `g55' = `at'[1,31];
                        scalar `g56' = `at'[1,32];
                        scalar `g57' = -`g51' - `g52' - `g53' - `g54'- `g55' - `g56';

                        scalar `g61' = `g16';
                        scalar `g62' = `g26';
                        scalar `g63' = `g36';
                        scalar `g64' = `g46';
                        scalar `g65' = `g56';
                        scalar `g66' = `at'[1,33];
                        scalar `g67' = -`g61' - `g62' - `g63' - `g64'- `g65' - `g66';

                        scalar `g71' = `g17';
                        scalar `g72' = `g27';
                        scalar `g73' = `g37';
                        scalar `g74' = `g47';
                        scalar `g75' = `g57';
                        scalar `g76' = `g67';
                        scalar `g77' = -`g71' - `g72' - `g73' - `g74'- `g75' - `g76';

                        ******first 7 lambdas***************************
                        tempname l1 l2 l3 l4 l5 l6 l7;
                        scalar `l1' = `at'[1,34];
                        scalar `l2' = `at'[1,35];
                        scalar `l3' = `at'[1,36];
                        scalar `l4' = `at'[1,37];
                        scalar `l5' = `at'[1,38];
                        scalar `l6' = `at'[1,39];
                        scalar `l7' = - `l1' - `l2' - `l3' - `l4'- `l5' - `l6';

                        *******constant and household demographics**************

                        tempname r11 r12 r13 r14 r15;
                        tempname r21 r22 r23 r24 r25;
                        tempname r31 r32 r33 r34 r35;
                        tempname r41 r42 r43 r44 r45;
                        tempname r51 r52 r53 r54 r55;
                        tempname r61 r62 r63 r64 r65;
                        tempname r71 r72 r73 r74 r75;

                        scalar `r11' = `at'[1,40];
                        scalar `r12' = `at'[1,41];
                        scalar `r13' = `at'[1,42];
                        scalar `r14' = `at'[1,43];
                        scalar `r15' = `at'[1,44];


                        scalar `r21' = `at'[1,45];
                        scalar `r22' = `at'[1,46];
                        scalar `r23' = `at'[1,47];
                        scalar `r24' = `at'[1,48];
                        scalar `r25' = `at'[1,49];

                        scalar `r31' = `at'[1,50];
                        scalar `r32' = `at'[1,51];
                        scalar `r33' = `at'[1,52];
                        scalar `r34' = `at'[1,53];
                        scalar `r35' = `at'[1,54];

                        scalar `r41' = `at'[1,55];
                        scalar `r42' = `at'[1,56];
                        scalar `r43' = `at'[1,57];
                        scalar `r44' = `at'[1,58];
                        scalar `r45' = `at'[1,59];

                        scalar `r51' = `at'[1,60];
                        scalar `r52' = `at'[1,61];
                        scalar `r53' = `at'[1,62];
                        scalar `r54' = `at'[1,63];
                        scalar `r55' = `at'[1,64];

                        scalar `r61' = `at'[1,65];
                        scalar `r62' = `at'[1,66];
                        scalar `r63' = `at'[1,67];
                        scalar `r64' = `at'[1,68];
                        scalar `r65' = `at'[1,69];

                        scalar `r71' = `at'[1,70];
                        scalar `r72' = `at'[1,71];
                        scalar `r73' = `at'[1,72];
                        scalar `r74' = `at'[1,73];
                        scalar `r75' = `at'[1,74];

                        // calculate the expenditure shares.
                        quietly {;
                        // price index
                        // with set a_0 = 5
                        tempvar lnpindex;
                        gen double `lnpindex' = 5 + `a1'*`wp1' + `a2'*`wp2' + `a3'*`wp3' + `a4'*`wp4'+ `a5'*`wp5' + `a6'*`wp6' + `a7'*`wp7';
                        forvalues i = 1/7 {;
                        forvalues j = 1/7 {;
                        replace `lnpindex' = `lnpindex' + 0.5*`g`i'`j''*`wp`i''*`wp`j'';
                        };
                        };
                        // The b(p) term in the QUAIDS model:
                        tempvar bofp;
                        gen double `bofp' = 0;
                        forvalues i = 1/7 {;
                        replace `bofp' = `bofp' + `lnp`i''*`b`i'';
                        };
                        replace `bofp' = exp(`bofp');

                        // Finally, the expenditure shares for 6 of the 7
                        // goods (the fourth is dropped to avoid singularity)
                        replace `w1' = (`a1' + `g11'*`wp1' + `g12'*`wp2' + `g13'*`wp3' + `g14'*`wp4' + `g15'*`wp5' + `g16'*`wp6' + `g17'*`wp7' + `b1'*(`lnexp' - `lnpindex') +`l1'/`bofp'*(`lnexp' - `lnpindex')^2 + `r11'*`x1' +`r12'*`x2' +`r13'*`x3' +`r14'*`x4'+`r15'*`x5');

                        replace `w2' = (`a2' + `g21'*`wp1' + `g22'*`wp2' + `g23'*`wp3' + `g24'*`wp4' + `25'*`wp5' + `g26'*`wp6' + `g27'*`wp7' + `b1'*(`lnexp' - `lnpindex') + `l2'/`bofp'*(`lnexp' - `lnpindex')^2 + `r21'*`x1' +`r22'*`x2' +`r23'*`x3' +`r24'*`x4'+`r25'*`x5');

                        replace `w3' = (`a3' + `g31'*`wp1' + `g32'*`wp2' + `g33'*`wp3' + `g34'*`wp4' + `35'*`wp5' + `g36'*`wp6' + `g37'*`wp7' + `b1'*(`lnexp' - `lnpindex') + `l3'/`bofp'*(`lnexp' - `lnpindex')^2 + `r31'*`x1' +`r32'*`x2' +`r33'*`x3' +`r34'*`x4'+`r35'*`x5');

                        replace `w4' = (`a4' + `g41'*`wp1' + `g42'*`wp2' + `g43'*`wp3' + `g44'*`wp4' + `45'*`wp5' + `g46'*`wp6' + `g47'*`wp7' + `b1'*(`lnexp' - `lnpindex') + `l4'/`bofp'*(`lnexp' - `lnpindex')^2 + `r41'*`x1' +`r42'*`x2' +`r43'*`x3' +`r44'*`x4'+`r45'*`x5');

                        replace `w5' = (`a5' + `g51'*`wp1' + `g52'*`wp2' + `g53'*`wp3' + `g54'*`wp4' + `55'*`wp5' + `g56'*`wp6' + `g57'*`wp7' + `b1'*(`lnexp' - `lnpindex') + `l5'/`bofp'*(`lnexp' - `lnpindex')^2 + `r51'*`x1' +`r52'*`x2' +`r53'*`x3' +`r54'*`x4'+`r55'*`x5');

                        replace `w6' = (`a6' + `g61'*`wp1' + `g62'*`wp2' + `g63'*`wp3' + `g64'*`wp4' + `65'*`wp5' + `g66'*`wp6' + `g67'*`wp7' + `b1'*(`lnexp' - `lnpindex') + `l6'/`bofp'*(`lnexp' - `lnpindex')^2 + `r61'*`x1' +`r62'*`x2' +`r63'*`x3' +`r64'*`x4'+`r65'*`x5');

                        replace `w7' = (`a7' + `g71'*`wp1' + `g72'*`wp2' + `g73'*`wp3' + `g74'*`wp4' + `75'*`wp5' + `g76'*`wp6' + `g77'*`wp7' + `b1'*(`lnexp' - `lnpindex') + `l7'/`bofp'*(`lnexp' - `lnpindex')^2 + `r71'*`x1' +`r72'*`x2' +`r73'*`x3' +`r74'*`x4'+`r75'*`x5');
                        };
                        end;

                        nlsur nlsurquaidsNPS @ w1 w2 w3 w4 w5 w6 w7 wp1 wp1 wp2 wp3 wp4 wp5 wp6 wp7 lnexp x1 x2 x3 x4 x5, ifgnls neq(7) parameters(a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7 g11 g12 g13 g14 g15 g16 g17 g22 g23 g24 g25 g26 g27 g33 g34 g35 g36 g37 g44 g45 g46 g47 g55 g56 g57 g66 g67 g77 l1 l2 l3 l4 l5 l6 l7 r11 r12 r13 r14 r15 r21 r22 r23 r24 r25 r31 r32 r33 r34 r35 r36 r37 r41 r42 r43 r44 r45 r46 r47 r51 r52 r53 r54 r55 r61 r62 r63 r64 r65 r71 r72 r73 r74 r75) nolog;


                        Thank you in advance for helping

                        Best regards

                        Comment


                        • #13
                          I would follow Nick's earlier advice and set trace on. There is an awful lot of code here and we can't tell where the error is occurring. Also use code tags to make the code and output more legible. See pt 12 of the FAQ. Also there seem to be a very large number of variables here. Can you start with a few and gradually add more? That might help to identify where the problem is occurring.

                          Finally I don't use nlsur either but I notice you went from things like `w1' to plain old w1. Is that correct?
                          -------------------------------------------
                          Richard Williams, Notre Dame Dept of Sociology
                          Stata Version: 17.0 MP (2 processor)

                          EMAIL: [email protected]
                          WWW: https://www3.nd.edu/~rwilliam

                          Comment


                          • #14
                            Dear Mr. Richard Williams,

                            Thank you for writing and about " `w1' to plain old w1 " you are right.

                            Following 12 of the FAQ, Sorry for missing some information,

                            w -expenditure share of goods
                            wp -prices
                            x -demographics characteristics
                            lnexp--log of total expenditure

                            I am using STATA 13.1

                            Best regards

                            Comment


                            • #15
                              Dear Colleagues,

                              I highly thankful for any of your suggestion and helping while I could not fixed the problem yet

                              Best regards,

                              Comment

                              Working...
                              X