Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Res: st: quaids model


From   Cristiana Rodrigues <cristianatr@yahoo.com.br>
To   statalist@hsphsun2.harvard.edu
Subject   Res: st: quaids model
Date   Tue, 8 Dec 2009 03:15:23 -0800 (PST)

Hi,

Brian Poi, thank you again for your help.

I corrected my -syntax- statement, but the error message continues.
The
routine “nlsur” available in Poi (2008) is for three equations, when I
run the model with my data, putting only three equations, there are no
problems. But if I put one more equation in my model, for example four,
I receive one error message, that has many variables, the same happens
when I put all my variables in the model:
nlsurquaids returned 103
verify that nlsurquaids is a function evaluator program
r(103);
 
On the other hand, if I put only two equations, I receive one error message that has few variables:
nlsurquaids returned 102
verify that nlsurquaids is a function evaluator program
r(102);
 
In other words, I can only run the model with three equations, in the way how it is in the article Poi (2008).
 
Another problem happens when I go run the routine "nlsurquaids. When I give the first command -syntax varlist(min=48 max=48) if, at(name)-  I receive this error message:
varlist required
r(100);
 
Please, I need a help. I am sending my routines.

Thank you.


***nlsur

nlsur
quaids @ w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17
lnp1-lnp18 lnexp /// anosestudo estudomulher adolescented adultod
idosod totalpes sexo norte nordeste sul sudeste  ///
renda [aw=peso], ifgnls nequations(17) param(a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 ///
a16 a17 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 g11
g12 g13 g14 g15 g16 g17 /// g18 g19 g110 g111 g112 g113 g114 g115 g116
g117 g22 g23 g24 g25 g26 g27 g28 g29 g210 g211  ///
g212 g213 g214 g215 g216 g217 g33 g34 g35 g36 g37 g38 g39 g310 g311 g312 g313 g314 g315 ///
g316 g317 g44 g45 g46 g47 g48 g49 g410 g411 g412 g413 g414 g415 g416 g417 g55 g56 g57 g58 ///
g59 g510 g511 g512 g513 g514 g515 g516 g517 g66 g67 g68 g69 g610 g611
g612 g613 g614 g615 /// g616 g617 g77 g78 g79 g710 g711 g712 g713 g714
g715 g716 g717 g88 g89 g810 g811 g812 g813 ///
g814 g815 g816 g817 g99 g910 g911 g912 g913 g914 g915 g916 g917 g1010 g1011 g1012 g1013  ///
g1014 g1015 g1016 g1017 g1111 g1112 g1113 g1114 g1115 g1116 g1117 g1212
g1213 g1214 g1215 /// g1216 g1217 g1313 g1314 g1315 g1316 g1317 g1414
g1415 g1416 g1417 g1515 g1516 g1517 g1616 /// g1617 g1717 l1 l2 l3 l4
l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17) nolog



***nlsurquaids

program nlsurquaids

    version 10
    
    syntax varlist(min=48 max=48) if, at(name)
    tokenize `varlist'
    args w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17 lnp1 lnp2 lnp3 lnp4 lnp5 ///
    lnp6 lnp7 lnp8 lnp9 lnp10 lnp11 lnp12 lnp13 lnp14 lnp15 lnp16 lnp17
lnp18 lnexp anosestudo  ///         estudomulher adolescented adultod
idosod totalpes sexo norte nordeste sul sudeste renda  


      // With 18 goods, there are 204 parameters that can be 
    // estimated, after eliminating one of the goods and 
    // imposing adding up, symmetry, and homogeneity
    // constraints, in the QUAIDS model
    // Here, we extract those parameters from the `at'
    // vector, and impose constraints as we go along

      tempname a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 
      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' = `at'[1,7]
      scalar `a8' = `at'[1,8]
      scalar `a9' = `at'[1,9]
      scalar `a10' = `at'[1,10]
      scalar `a11' = `at'[1,11]
      scalar `a12' = `at'[1,12]
      scalar `a13' = `at'[1,13]
      scalar `a14' = `at'[1,14]
      scalar `a15' = `at'[1,15]
      scalar `a16' = `at'[1,16]
      scalar `a17' = `at'[1,17]
    scalar `a18' = 1 - `a1' - `a2' - `a3' - `a4' - `a5' - `a6' - `a7' - `a8' - `a9' - `a10' - `a11' - `a12' - `a13' ///
      - `a14' - `a15' - `a16' - `a17'  

tempname b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18 
      scalar `b1' = `at'[1,18]    
      scalar `b2' = `at'[1,19]    
      scalar `b3' = `at'[1,20]
      scalar `b4' = `at'[1,21]
      scalar `b5' = `at'[1,22]
      scalar `b6' = `at'[1,23]
      scalar `b7' = `at'[1,24]
      scalar `b8' = `at'[1,25]
      scalar `b9' = `at'[1,26]
      scalar `b10' = `at'[1,27]
      scalar `b11' = `at'[1,28]
      scalar `b12' = `at'[1,29]
      scalar `b13' = `at'[1,30]
      scalar `b14' = `at'[1,31]
      scalar `b15' = `at'[1,32]
      scalar `b16' = `at'[1,33]
      scalar `b17' = `at'[1,34]
      scalar `b18' = 1 - `b1' - `b2' - `b3' - `b4' - `b5' - `b6' - `b7' - `b8' - `b9' - `b10' - `b11' - `b12' - `b13' ///
      - `b14' - `b15' - `b16' - `b17'  


      tempname g11 g12 g13 g14 g15 g16 g17 g18 g19 g110 g111 g112 g113 g114 g115 g116 g117 g118 
      tempname g21 g22 g23 g24 g25 g26 g27 g28 g29 g210 g211 g212 g213 g214 g215 g216 g217 g218
      tempname g31 g32 g33 g34 g35 g36 g37 g38 g39 g310 g311 g312 g313 g314 g315 g316 g317 g318
      tempname g41 g42 g43 g44 g45 g46 g47 g48 g49 g410 g411 g412 g413 g414 g415 g416 g417 g418
      tempname g51 g52 g53 g54 g55 g56 g57 g58 g59 g510 g511 g512 g513 g514 g515 g516 g517 g518
      tempname g61 g62 g63 g64 g65 g66 g67 g68 g69 g610 g611 g612 g613 g614 g615 g616 g617 g618
      tempname g71 g72 g73 g74 g75 g76 g77 g78 g79 g710 g711 g712 g713 g714 g715 g716 g717 g718
      tempname g81 g82 g83 g84 g85 g86 g87 g88 g89 g810 g811 g812 g813 g814 g815 g816 g817 g818
      tempname g91 g92 g93 g94 g95 g96 g97 g98 g99 g910 g911 g912 g913 g914 g915 g916 g917 g918
      tempname g101 g102 g103 g104 g105 g106 g107 g108 g109 g1010 g1011 g1012 g1013 g1014  g1015 g1016 g1017 g1018
      tempname g111 g112 g113 g114 g115 g116 g117 g118 g119 g1110 g1111 g1112 g1113 g1114 g1115 g1116 g1117 g1118 
      tempname g121 g122 g123 g124 g125 g126 g127 g128 g129 g1210 g1211 g1212 g1213 g1214 g1215 g1216 g1217 g1218  
      tempname g131 g132 g133 g134 g135 g136 g137 g138 g139 1310 g1311 g1312 g1313 g1314 g1315 g1316 g1317 g1318 
      tempname g141 g142 g143 g144 g145 g146 g147 g148 g149 1410 g1411 g1412 g1413 g1414 g1415 g1416 g1417 g1418
      tempname g151 g152 g153 g154 g155 g156 g157 g158 g159 1510 g1511 g1512 g1513 g1514 g1515 g1516 g1517 g1518
      tempname g161 g162 g163 g164 g165 g166 g167 g168 g169 1610 g1611 g1612 g1613 g1614 g1615 g1616 g1617 g1618
      tempname g171 g172 g173 g174 g175 g176 g177 g178 g179 1710 g1711 g1712 g1713 g1714 g1715 g1716 g1717 g1718
      tempname g181 g182 g183 g184 g185 g186 g187 g188 g189 1810 g1811 g1812 g1813 g1814 g1815 g1816 g1817 g1818


      scalar `g11' = `at'[1,35]
      scalar `g12' = `at'[1,36]
      scalar `g13' = `at'[1,37]
      scalar `g14' = `at'[1,38]
      scalar `g15' = `at'[1,39]
      scalar `g16' = `at'[1,40]
      scalar `g17' = `at'[1,41]
      scalar `g18' = `at'[1,42]
      scalar `g19' = `at'[1,43]
      scalar `g110' = `at'[1,44]
      scalar `g111' = `at'[1,45]
      scalar `g112' = `at'[1,46]
      scalar `g113' = `at'[1,47]
      scalar `g114' = `at'[1,48]
      scalar `g115' = `at'[1,49]
      scalar `g116' = `at'[1,50]
      scalar `g117' = `at'[1,51]
    scalar `g118' = -`g11' - `g12' - `g13'- `g14'- `g15'- `g16'- `g17'- `g18'- `g19'- `g110'- `g111'- `g112' ///
    - `g113' - `g114'- `g115'- `g116'- `g117'

      scalar `g21' = `g12'
      scalar `g22' = `at'[1,52]
      scalar `g23' = `at'[1,53]
      scalar `g24' = `at'[1,54]
      scalar `g25' = `at'[1,55]
      scalar `g26' = `at'[1,56]
      scalar `g27' = `at'[1,57]
      scalar `g28' = `at'[1,58]
      scalar `g29' = `at'[1,59]
      scalar `g210' = `at'[1,60]
      scalar `g211' = `at'[1,61]
      scalar `g212' = `at'[1,62]
      scalar `g213' = `at'[1,63]
      scalar `g214' = `at'[1,64]
      scalar `g215' = `at'[1,65]
      scalar `g216' = `at'[1,66]
      scalar `g217' = `at'[1,67]
      scalar `g218' = -`g21' - `g22' - `g23'- `g24'- `g25'- `g26'- `g27'- `g28'- `g29'- `g210'- `g211'- `g212' ///
      - `g213' - `g214'- `g215'- `g216'- `g217'


      scalar `g31' = `g13'
      scalar `g32' = `g23'
      scalar `g33' = `at'[1,68]
      scalar `g34' = `at'[1,69]
      scalar `g35' = `at'[1,70]
      scalar `g36' = `at'[1,71]
      scalar `g37' = `at'[1,72]
      scalar `g38' = `at'[1,73]
      scalar `g39' = `at'[1,74]
      scalar `g310' = `at'[1,75]
      scalar `g311' = `at'[1,76]
      scalar `g312' = `at'[1,77]
      scalar `g313' = `at'[1,78]
      scalar `g314' = `at'[1,79]
      scalar `g315' = `at'[1,80]
      scalar `g316' = `at'[1,81]
      scalar `g317' = `at'[1,82]
     
scalar `g318' = -`g31' - `g32' - `g33'- `g34'- `g35'- `g36'- `g37'-
`g38'- `g39'- `g310'- `g311'- `g312' ///                 - `g313' -
`g314'- `g315'- `g316'- `g317'
    

      scalar `g41' = `g14'
      scalar `g42' = `g24'
      scalar `g43' = `g34'
      scalar `g44' = `at'[1,83]
      scalar `g45' = `at'[1,84]
      scalar `g46' = `at'[1,85]
      scalar `g47' = `at'[1,86]
      scalar `g48' = `at'[1,87]
      scalar `g49' = `at'[1,88]
      scalar `g410' = `at'[1,89]
      scalar `g411' = `at'[1,90]
      scalar `g412' = `at'[1,91]
      scalar `g413' = `at'[1,92]
      scalar `g414' = `at'[1,93]
      scalar `g415' = `at'[1,94]
      scalar `g416' = `at'[1,95]
      scalar `g417' = `at'[1,96]
      scalar `g418' = -`g41' - `g42' - `g43'- `g44'- `g45'- `g46'- `g47'- `g48'- `g49'- `g410'- `g411'- `g412'   ////
      - `g413' - `g414'- `g415'- `g416'- `g417'

      scalar `g51' = `g15'
      scalar `g52' = `g25'
      scalar `g53' = `g35'
      scalar `g54' = `g45'
      scalar `g55' = `at'[1,97]
      scalar `g56' = `at'[1,98]
      scalar `g57' = `at'[1,99]
      scalar `g58' = `at'[1,100]
      scalar `g59' = `at'[1,101]
      scalar `g510' = `at'[1,102]
      scalar `g511' = `at'[1,103]
      scalar `g512' = `at'[1,104]
      scalar `g513' = `at'[1,105]
      scalar `g514' = `at'[1,106]
      scalar `g515' = `at'[1,107]
      scalar `g516' = `at'[1,108]
      scalar `g517' = `at'[1,109]
      scalar `g518' = -`g51' - `g52' - `g53'- `g54'- `g55'- `g56'- `g57'- `g58'- `g59'- `g510'- `g511'- `g512'  /// 
      - `g513' - `g514'- `g515'- `g516'- `g517'

      scalar `g61' = `g16'
      scalar `g62' = `g26'
      scalar `g63' = `g36'
      scalar `g64' = `g46'
      scalar `g65' = `g56'
      scalar `g66' = `at'[1,110]
      scalar `g67' = `at'[1,111]
      scalar `g68' = `at'[1,112]
      scalar `g69' = `at'[1,113]
      scalar `g610' = `at'[1,114]
      scalar `g611' = `at'[1,115]
      scalar `g612' = `at'[1,116]
      scalar `g613' = `at'[1,117]
      scalar `g614' = `at'[1,118]
      scalar `g615' = `at'[1,119]
      scalar `g616' = `at'[1,120]
      scalar `g617' = `at'[1,121]
      scalar `g618' = -`g61' - `g62' - `g63'- `g64'- `g65'- `g66'- `g67'- `g68'- `g69'- `g610'- `g611'- `g612'  ///
      - `g613' - `g614'- `g615'- `g616'- `g617'

      scalar `g71' = `g17'
      scalar `g72' = `g27'
      scalar `g73' = `g37'
      scalar `g74' = `g47'
      scalar `g75' = `g57'
      scalar `g76' = `g67'
      scalar `g77' = `at'[1,122]
      scalar `g78' = `at'[1,123]
      scalar `g79' = `at'[1,124]
      scalar `g710' = `at'[1,125]
      scalar `g711' = `at'[1,126]
      scalar `g712' = `at'[1,127]
      scalar `g713' = `at'[1,128]
      scalar `g714' = `at'[1,129]
      scalar `g715' = `at'[1,130]
      scalar `g716' = `at'[1,131]
      scalar `g717' = `at'[1,132]
      scalar `g718' = -`g71' - `g72' - `g73'- `g74'- `g75'- `g76'- `g77'- `g78'- `g79'- `g710'- `g711'- `g712' ///
     - `g713' - `g714'- `g715'- `g716'- `g717'

      scalar `g81' = `g18'
      scalar `g82' = `g28'
      scalar `g83' = `g38'
      scalar `g84' = `g48'
      scalar `g85' = `g58'
      scalar `g86' = `g68'
      scalar `g87' = `g78'
      scalar `g88' = `at'[1,133]
      scalar `g89' = `at'[1,134]
      scalar `g810' = `at'[1,135]
      scalar `g811' = `at'[1,136]
      scalar `g812' = `at'[1,137]
      scalar `g813' = `at'[1,138]
      scalar `g814' = `at'[1,139]
      scalar `g815' = `at'[1,140]
      scalar `g816' = `at'[1,141]
      scalar `g817' = `at'[1,142]
      scalar `g818' = -`g81' - `g82' - `g83'- `g84'- `g85'- `g86'- `g87'- `g88'- `g89'- `g810'- `g811'- `g812'  ///
      - `g813' - `g814'- `g815'- `g816'- `g817'

      scalar `g91' = `g19'
      scalar `g92' = `g29'
      scalar `g93' = `g39'
      scalar `g94' = `g49'
      scalar `g95' = `g59'
      scalar `g96' = `g69'
      scalar `g97' = `g79'
      scalar `g98' = `g89'
      scalar `g99' = `at'[1,143]
      scalar `g910' = `at'[1,144]
      scalar `g911' = `at'[1,145]
      scalar `g912' = `at'[1,146]
      scalar `g913' = `at'[1,147]
      scalar `g914' = `at'[1,148]
      scalar `g915' = `at'[1,149]
      scalar `g916' = `at'[1,150]
      scalar `g917' = `at'[1,151]
      scalar `g918' = -`g91' - `g92' - `g93'- `g94'- `g95'- `g96'- `g97'- `g98'- `g99'- `g910'- `g911'- `g912' ///
      - `g913' - `g914'- `g915'- `g916'- `g917'


      scalar `g101' = `g110'
      scalar `g102' = `g210'
      scalar `g103' = `g310'
      scalar `g104' = `g410'
      scalar `g105' = `g510'
      scalar `g106' = `g610'
      scalar `g107' = `g710'
      scalar `g108' = `g810'
      scalar `g109' = `g910'
      scalar `g1010' = `at'[1,152]
      scalar `g1011' = `at'[1,153]
      scalar `g1012' = `at'[1,154]
      scalar `g1013' = `at'[1,155]
      scalar `g1014' = `at'[1,156]
      scalar `g1015' = `at'[1,157]
      scalar `g1016' = `at'[1,158]
      scalar `g1017' = `at'[1,159]
      scalar `g1018' = -`g101' - `g102' - `g103'- `g104'- `g105'- `g106'- `g107'- `g108'- `g109'- `g1010' ///
      - `g1011'- `g1012'- `g1013' - `g1014'- `g1015'- `g1016'- `g1017'


      scalar `g111' = `g111'
      scalar `g112' = `g211'
      scalar `g113' = `g311'
      scalar `g114' = `g411'
      scalar `g115' = `g511'
      scalar `g116' = `g611'
      scalar `g117' = `g711'
      scalar `g118' = `g811'
      scalar `g119' = `g911'
      scalar `g1110' = `g1011'
      scalar `g1111' = `at'[1,160]
      scalar `g1112' = `at'[1,161]
      scalar `g1113' = `at'[1,162]
      scalar `g1114' = `at'[1,163]
      scalar `g1115' = `at'[1,164]
      scalar `g1116' = `at'[1,165]
      scalar `g1117' = `at'[1,166]
      scalar `g1118' = -`g111' - `g112' - `g113'- `g114'- `g115'- `g116'- `g117'- `g118'- `g119'- `g1110' ///
      - `g1111' -`g1112'- `g1113' - `g1114'- `g1115'- `g1116'- `g1117'


      scalar `g121' = `g112'
      scalar `g122' = `g212'
      scalar `g123' = `g312'
      scalar `g124' = `g412'
      scalar `g125' = `g512'
      scalar `g126' = `g612'
      scalar `g127' = `g712'
      scalar `g128' = `g812'
      scalar `g129' = `g912'
      scalar `g1210' = `g1012'
      scalar `g1211' = `g1112'
      scalar `g1212' = `at'[1,167]
      scalar `g1213' = `at'[1,168]
      scalar `g1214' = `at'[1,169]
      scalar `g1215' = `at'[1,170]
      scalar `g1216' = `at'[1,171]
      scalar `g1217' = `at'[1,172]
      scalar `g1218' = -`g121' - `g122' - `g123'- `g124'- `g125'- `g126'- `g127'- `g128'- `g129'- `g1210' ///
      - `g1211'- `g1212'- `g1213'- `g1214'- `g1215'- `g1216'- `g1217'


      scalar `g131' = `g113'
      scalar `g132' = `g213'
      scalar `g133' = `g313'
      scalar `g134' = `g413'
      scalar `g135' = `g513'
      scalar `g136' = `g613'
      scalar `g137' = `g713'
      scalar `g138' = `g813'
      scalar `g139' = `g913'
      scalar `g1310' = `g1013'
      scalar `g1311' = `g1113'
      scalar `g1312' = `g1213'
      scalar `g1313' = `at'[1,173]
      scalar `g1314' = `at'[1,174]
      scalar `g1315' = `at'[1,175]
      scalar `g1316' = `at'[1,176]
      scalar `g1317' = `at'[1,177]
      scalar `g1318' = -`g131' - `g132' - `g133'- `g134'- `g135'- `g136'- `g137'- `g138'- `g139'- `g1310' ///
      - `g1311'- `g1312'- `g1313' - `g1314'- `g1315'- `g1316'- `g1317'


      scalar `g141' = `g114'
      scalar `g142' = `g214'
      scalar `g143' = `g314'
      scalar `g144' = `g414'
      scalar `g145' = `g514'
      scalar `g146' = `g614'
      scalar `g147' = `g714'
      scalar `g148' = `g814'
      scalar `g149' = `g914'
      scalar `g1410' = `g1014'
      scalar `g1411' = `g1114'
      scalar `g1412' = `g1214'
      scalar `g1413' = `g1314'
      scalar `g1414' = `at'[1,178]
      scalar `g1415' = `at'[1,179]
      scalar `g1416' = `at'[1,180]
      scalar `g1417' = `at'[1,181]
      scalar `g1418' = -`g141' - `g142' - `g143'- `g144'- `g145'- `g146'- `g147'- `g148'- `g149'- `g1410' ///
     - `g1411'- `g1412'- `g1413' - `g1414'- `g1415'- `g1416'- `g1417'


      scalar `g151' = `g115'
    scalar `g152' = `g215'
    scalar `g153' = `g315'
      scalar `g154' = `g415'
      scalar `g155' = `g515'
      scalar `g156' = `g615'
      scalar `g157' = `g715'
      scalar `g158' = `g815'
      scalar `g159' = `g915'
      scalar `g1510' = `g1015'
      scalar `g1511' = `g1115'
      scalar `g1512' = `g1215'
      scalar `g1513' = `g1315'
      scalar `g1514' = `g1415'
      scalar `g1515' = `at'[1,182]
      scalar `g1516' = `at'[1,183]
      scalar `g1517' = `at'[1,184]
      scalar `g1518' = -`g151' - `g152' - `g153'- `g154'- `g155'- `g156'- `g157'- `g158'- `g159'- `g1510' ///
      - `g1511'- `g1512'- `g1513' - `g1514'- `g1515'- `g1516'- `g1517'


      scalar `g161' = `g116'
      scalar `g162' = `g216'
       scalar `g163' = `g316'
      scalar `g164' = `g416'
      scalar `g165' = `g516'
      scalar `g166' = `g616'
      scalar `g167' = `g716'
      scalar `g168' = `g816'
      scalar `g169' = `g916'
      scalar `g1610' = `g1016'
      scalar `g1611' = `g1116'
      scalar `g1612' = `g1216'
      scalar `g1613' = `g1316'
      scalar `g1614' = `g1416'
      scalar `g1615' = `g1516'
      scalar `g1616' = `at'[1,185]
      scalar `g1617' = `at'[1,186]
      scalar `g1618' = -`g161' - `g162' - `g163'- `g164'- `g165'- `g166'- `g167'- `g168'- `g169'- `g1610' ///
      - `g1611'- `g1612'- `g1613' - `g1614'- `g1615'- `g1616'- `g1617'

      scalar `g171' = `g117'
      scalar `g172' = `g217'
      scalar `g173' = `g317'
      scalar `g174' = `g417'
      scalar `g175' = `g517'
      scalar `g176' = `g617'
      scalar `g177' = `g717'
      scalar `g178' = `g817'
      scalar `g179' = `g917'
      scalar `g1710' = `g1017'
      scalar `g1711' = `g1117'
      scalar `g1712' = `g1217'
      scalar `g1713' = `g1317'
      scalar `g1714' = `g1417'
      scalar `g1715' = `g1517'
      scalar `g1716' = `g1617'
      scalar `g1717' = `at'[1,187]
      scalar `g1718' = -`g171' - `g172' - `g173'- `g174'- `g175'- `g176'- `g177'- `g178'- `g179'- `g1710'  ///
      - `g1711'- `g1712'- `g1713' - `g1714'- `g1715'- `g1716'- `g1717'

      scalar `g181' = `g118'
      scalar `g182' = `g218'
      scalar `g183' = `g318'
      scalar `g184' = `g418'
      scalar `g185' = `g518'
      scalar `g186' = `g618'
      scalar `g187' = `g718'
      scalar `g188' = `g818'
      scalar `g189' = `g918'
      scalar `g1810' = `g1018'
      scalar `g1811' = `g1118'
      scalar `g1812' = `g1218'
      scalar `g1813' = `g1318'
      scalar `g1814' = `g1418'
      scalar `g1815' = `g1518'
      scalar `g1816' = `g1618'
      scalar `g1817' = `g1718'
      scalar `g1818' = -`g181' - `g182' - `g183'- `g184'- `g185'- `g186'- `g187'- `g188'- `g189'- `g1810'  ///
      - `g1811'- `g1812'- `g1813' - `g1814'- `g1815'- `g1816'- `g1817'

      tempname l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17 l18
      scalar `l1' = `at'[1,188]
      scalar `l2' = `at'[1,189]
      scalar `l3' = `at'[1,190]
      scalar `l4' = `at'[1,191]
      scalar `l5' = `at'[1,192]
      scalar `l6' = `at'[1,193]
      scalar `l7' = `at'[1,194]
      scalar `l8' = `at'[1,195]
      scalar `l9' = `at'[1,196]
      scalar `l10' = `at'[1,197]
      scalar `l11' = `at'[1,198]
      scalar `l12' = `at'[1,199]
      scalar `l13' = `at'[1,200]
      scalar `l14' = `at'[1,201]
      scalar `l15' = `at'[1,202]
      scalar `l16' = `at'[1,203]
      scalar `l17' = `at'[1,204]
     
scalar `l18' = -`l1' - `l2' - `l3'- `l4'- `l5'- `l6'- `l7'- `l8'- `l9'-
`l10'- `l11'- `l12'- `l13'- `l14'- `l15 - `l6'- `l7'


// Okay, now that we have all the parameters, we can 
    // calculate the expenditure shares.    
    quietly {
        // First get the price index
        // I set a_0 = 5
        tempvar lnpindex
        gen double `lnpindex' = 5 + `a1'*`lnp1' + `a2'*`lnp2'+ `a3'*`lnp3' + `a4'*`lnp4'+ `a5'*`lnp5' ///
        + `a6'*`lnp6'+ `a7'*`lnp7'+ `a8'*`lnp8'+ `a9'*`lnp9'+
`a10'*`lnp10'+ `a11'*`lnp11'+ `a12'*`lnp12' ///        +`a13'*`lnp13'+
`a14'*`lnp14' + `a15'*`lnp15'+ `a16'*`lnp16'+ `a17'*`lnp17'+
`a18'*`lnp18'
        



            forvalues i = 1/18 {
            forvalues j = 1/18 {
                replace `lnpindex' = `lnpindex' +     ///
                    0.5*`g`i'`j''*`lnp`i''*`lnp`j''
            }
        }
        // The b(p) term in the QUAIDS model:
        tempvar bofp
        gen double `bofp' = 0
        forvalues i = 1/18 {
            replace `bofp' = `bofp' + `lnp`i''*`b`i''
        }
        replace `bofp' = exp(`bofp')
        // Finally, the expenditure shares for 17 of the 18
        // nutrients (the equation 18 is dropped to avoid singularity)
        replace `w1' = `a1' + `g11'*`lnp1' + `g12'*`lnp2' +`g13'*`lnp3' + `g14'*`lnp4' + `g15'*`lnp5' ///
        + `g16'*`lnp6' + `g17'*`lnp7' + `g18'*`lnp8' + `g19'*`lnp9' + `g110'*`lnp10' + `g111'*`lnp11' ///
            + `g112'*`lnp12' + `g113'*`lnp13' + `g114'*`lnp14' + `g115'*`lnp15' + `g116'*`lnp16'  ///
            + `g117'*`lnp17' + `g118'*`lnp18' + `b1'*(`lnexp' - `lnpindex') + `l1'/`bofp'*(`lnexp' - `lnpindex')^2
        

            replace `w2' = `a2' + `g21'*`lnp1' + `g22'*`lnp2' +`g23'*`lnp3' + `g24'*`lnp4' + `g25'*`lnp5' ///
        + `g26'*`lnp6' + `g27'*`lnp7' + `g28'*`lnp8' + `g29'*`lnp9' + `g210'*`lnp10' + `g211'*`lnp11' ///
            + `g212'*`lnp12' + `g213'*`lnp13' + `g214'*`lnp14' + `g215'*`lnp15' + `g216'*`lnp16'  ///
            + `g217'*`lnp17' + `g218'*`lnp18' + `b2'*(`lnexp' - `lnpindex') + `l2'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w3' = `a3' + `g31'*`lnp1' + `g32'*`lnp2' +`g33'*`lnp3' + `g34'*`lnp4' + `g35'*`lnp5' ///
        + `g36'*`lnp6' + `g37'*`lnp7' + `g38'*`lnp8' + `g39'*`lnp9' + `g310'*`lnp10' + `g311'*`lnp11' ///
            + `g312'*`lnp12' + `g313'*`lnp13' + `g314'*`lnp14' + `g315'*`lnp15' + `g316'*`lnp16'  ///
            + `g317'*`lnp17' + `g318'*`lnp18' + `b3'*(`lnexp' - `lnpindex') + `l3'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w4' = `a4' + `g41'*`lnp1' + `g42'*`lnp2' +`g43'*`lnp3' + `g44'*`lnp4' + `g45'*`lnp5' ///
        + `g46'*`lnp6' + `g47'*`lnp7' + `g48'*`lnp8' + `g49'*`lnp9' + `g410'*`lnp10' + `g411'*`lnp11' ///
            + `g412'*`lnp12' + `g413'*`lnp13' + `g414'*`lnp14' + `g415'*`lnp15' + `g416'*`lnp16'  ///
            + `g417'*`lnp17' + `g418'*`lnp18' + `b4'*(`lnexp' - `lnpindex') + `l4'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w5' = `a5' + `g51'*`lnp1' + `g52'*`lnp2' +`g53'*`lnp3' + `g54'*`lnp4' + `g55'*`lnp5' ///
        + `g56'*`lnp6' + `g57'*`lnp7' + `g58'*`lnp8' + `g59'*`lnp9' + `g510'*`lnp10' + `g511'*`lnp11' ///
            + `g512'*`lnp12' + `g513'*`lnp13' + `g514'*`lnp14' + `g515'*`lnp15' + `g516'*`lnp16'  ///
            + `g517'*`lnp17' + `g517'*`lnp18' + `b5'*(`lnexp' - `lnpindex') + `l5'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w6' = `a6' + `g61'*`lnp1' + `g62'*`lnp2' +`g63'*`lnp3' + `g64'*`lnp4' + `g65'*`lnp5' ///
        + `g66'*`lnp6' + `g67'*`lnp7' + `g68'*`lnp8' + `g69'*`lnp9' + `g610'*`lnp10' + `g611'*`lnp11' ///
            + `g612'*`lnp12' + `g613'*`lnp13' + `g614'*`lnp14' + `g615'*`lnp15' + `g616'*`lnp16'  ///
            + `g617'*`lnp17' + `g618'*`lnp18' + `b6'*(`lnexp' - `lnpindex') + `l6'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w7' = `a7' + `g71'*`lnp1' + `g72'*`lnp2' +`g73'*`lnp3' + `g74'*`lnp4' + `g75'*`lnp5' ///
        + `g76'*`lnp6' + `g77'*`lnp7' + `g78'*`lnp8' + `g79'*`lnp9' + `g710'*`lnp10' + `g711'*`lnp11' ///
            + `g712'*`lnp12' + `g713'*`lnp13' + `g714'*`lnp14' + `g715'*`lnp15' + `g716'*`lnp16'  ///
            + `g717'*`lnp17' + `g718'*`lnp18' + `b7'*(`lnexp' - `lnpindex') + `l7'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w8' = `a8' + `g81'*`lnp1' + `g82'*`lnp2' +`g83'*`lnp3' + `g84'*`lnp4' + `g85'*`lnp5' ///
        + `g86'*`lnp6' + `g87'*`lnp7' + `g88'*`lnp8' + `g89'*`lnp9' + `g810'*`lnp10' + `g811'*`lnp11' ///
            + `g812'*`lnp12' + `g813'*`lnp13' + `g814'*`lnp14' + `g815'*`lnp15' + `g816'*`lnp16'  ///
            + `g817'*`lnp17' + `g818'*`lnp18' + `b8'*(`lnexp' - `lnpindex') + `l8'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w9' = `a9' + `g91'*`lnp1' + `g92'*`lnp2' +`g93'*`lnp3' + `g94'*`lnp4' + `g95'*`lnp5' ///
        + `g96'*`lnp6' + `g97'*`lnp7' + `g98'*`lnp8' + `g99'*`lnp9' + `g910'*`lnp10' + `g911'*`lnp11' ///
            + `g912'*`lnp12' + `g913'*`lnp13' + `g914'*`lnp14' + `g915'*`lnp15' + `g916'*`lnp16'  ///
            + `g917'*`lnp17' + `g918'*`lnp18' + `b9'*(`lnexp' - `lnpindex') + `l9'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w10' = `a10' + `g101'*`lnp1' + `g102'*`lnp2' +`g103'*`lnp3' + `g104'*`lnp4' + `g105'*`lnp5' ///
        + `g106'*`lnp6' + `g107'*`lnp7' + `g108'*`lnp8' + `g109'*`lnp9' + `g1010'*`lnp10' + `g1011'*`lnp11' ///
            + `g1012'*`lnp12' + `g1013'*`lnp13' + `g1014'*`lnp14' + `g1015'*`lnp15' + `g1016'*`lnp16'  ///
            + `g1017'*`lnp17' + `g1018'*`lnp18' + `b10'*(`lnexp' - `lnpindex') + `l10'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w11' = `a11' + `g111'*`lnp1' + `g112'*`lnp2' +`g113'*`lnp3' + `g114'*`lnp4' + `g115'*`lnp5' ///
        + `g116'*`lnp6' + `g117'*`lnp7' + `g118'*`lnp8' + `g119'*`lnp9' + `g1110'*`lnp10' + `g1111'*`lnp11' ///
            + `g1112'*`lnp12' + `g1113'*`lnp13' + `g1114'*`lnp14' + `g1115'*`lnp15' + `g1116'*`lnp16'  ///
            + `g1117'*`lnp17' + `g1118'*`lnp18' + `b11'*(`lnexp' - `lnpindex') + `l11'/`bofp'*(`lnexp' - `lnpindex')^2


            replace `w12' = `a12' + `g121'*`lnp1' + `g122'*`lnp2' +`g123'*`lnp3' + `g124'*`lnp4' + `g125'*`lnp5' ///
        + `g126'*`lnp6' + `g127'*`lnp7' + `g128'*`lnp8' + `g129'*`lnp9' + `g1210'*`lnp10' + `g1211'*`lnp11' ///
            + `g1212'*`lnp12' + `g1213'*`lnp13' + `g1214'*`lnp14' + `g1215'*`lnp15' + `g1216'*`lnp16'  ///
            + `g1217'*`lnp17' + `g1218'*`lnp18' + `b12'*(`lnexp' - `lnpindex') + `l12'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w13' = `a13' + `g131'*`lnp1' + `g132'*`lnp2' +`g133'*`lnp3' + `g134'*`lnp4' + `g135'*`lnp5' ///
        + `g136'*`lnp6' + `g137'*`lnp7' + `g138'*`lnp8' + `g139'*`lnp9' + `g1310'*`lnp10' + `g1311'*`lnp11' ///
            + `g1312'*`lnp12' + `g1313'*`lnp13' + `g1314'*`lnp14' + `g1315'*`lnp15' + `g1316'*`lnp16'  ///
            + `g1317'*`lnp17' + `g1318'*`lnp18' + `b13'*(`lnexp' - `lnpindex') + `l13'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w14' = `a14' + `g141'*`lnp1' + `g142'*`lnp2' +`g143'*`lnp3' + `g144'*`lnp4' + `g145'*`lnp5' ///
        + `g146'*`lnp6' + `g147'*`lnp7' + `g148'*`lnp8' + `g149'*`lnp9' + `g1410'*`lnp10' + `g1411'*`lnp11' ///
            + `g1412'*`lnp12' + `g1413'*`lnp13' + `g1414'*`lnp14' + `g1415'*`lnp15' + `g1416'*`lnp16'  ///
            + `g1417'*`lnp17' + `g1418'*`lnp18' + `b14'*(`lnexp' - `lnpindex') + `l14'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w15' = `a15' + `g151'*`lnp1' + `g152'*`lnp2' +`g153'*`lnp3' + `g154'*`lnp4' + `g155'*`lnp5' ///
        + `g156'*`lnp6' + `g157'*`lnp7' + `g158'*`lnp8' + `g159'*`lnp9' + `g1510'*`lnp10' + `g1511'*`lnp11' ///
            + `g1512'*`lnp12' + `g1513'*`lnp13' + `g1514'*`lnp14' + `g1515'*`lnp15' + `g1516'*`lnp16'  ///
            + `g1517'*`lnp17' + `g1518'*`lnp18' + `b15'*(`lnexp' - `lnpindex') + `l15'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w16' = `a16' + `g161'*`lnp1' + `g162'*`lnp2' +`g163'*`lnp3' + `g164'*`lnp4' + `g165'*`lnp5' ///
        + `g166'*`lnp6' + `g167'*`lnp7' + `g168'*`lnp8' + `g169'*`lnp9' + `g1610'*`lnp10' + `g1611'*`lnp11' ///
            + `g1612'*`lnp12' + `g1613'*`lnp13' + `g1614'*`lnp14' + `g1615'*`lnp15' + `g1616'*`lnp16'  ///
            + `g1617'*`lnp17' + `g1618'*`lnp18' + `b16'*(`lnexp' - `lnpindex') + `l16'/`bofp'*(`lnexp' - `lnpindex')^2

            replace `w17' = `a17' + `g171'*`lnp1' + `g172'*`lnp2' +`g173'*`lnp3' + `g174'*`lnp4' + `g175'*`lnp5' ///
        + `g176'*`lnp6' + `g177'*`lnp7' + `g178'*`lnp8' + `g179'*`lnp9' + `g1710'*`lnp10' + `g1711'*`lnp11' ///
            + `g1712'*`lnp12' + `g1713'*`lnp13' + `g1714'*`lnp14' + `g1715'*`lnp15' + `g1716'*`lnp16'  ///
            + `g1717'*`lnp17' + `g1718'*`lnp18' + `b17'*(`lnexp' - `lnpindex') + `l17'/`bofp'*(`lnexp' - `lnpindex')^2


}
    
end


----- Mensagem original ----
De: Brian P. Poi <bpoi@stata.com>
Para: statalist@hsphsun2.harvard.edu
Enviadas: Segunda-feira, 7 de Dezembro de 2009 15:25:39
Assunto: Re: st: quaids model

On Mon, 7 Dec 2009, Cristiana Rodrigues wrote:

> Dear,
> 
> I am trying specify one Quaids Model to estimate 18 demand equations, but the - nlsur - model accepts only three equations, if I specify one more or one less, I receive the following error message:
> 
> nlsurquaids returned 102
> verify that nlsurquaids is a function evaluator program
> r(102)
> 

> My model have the form:
> 
> nlsur quaids @ w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17 lnp1-lnp18 lnexp anosestudo estudomulher /// adolescented  adultod idosod totalpes sexo norte nordeste sul sudeste renda [aw=peso], ifgnls nequations(17) param(a1 a2 a3 a4 a5   ///
> a6 a7 a8  a9 a10 a11 a12 a13 a14 a15 a16 a17 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 g11 g12 g13        ///
> g14 g15 g16 g17 g18 g19 g110 g111 g112 g113 g114 g115 g116 g117 g22 g23 g24 g25 g26 g27 g28 g29 g210 g211 g212 g213   ///
> g214 g215 g216 g217 g33 g34 g35 g36 g37 g38 g39 g310 g311 g312 g313 g314 g315 g316 g317 g44 g45 g46 g47 g48 g49 g410  ///
> g411 g412 g413 g414 g415 g416 g417 g55 g56 g57 g58 g59 g510 g511 g512 g513 g514 g515 g516 g517 g66 g67 g68 g69 g610  ///
> g611 g612 g613 g614 g615 g616 g617 g77 g78 g79 g710 g711 g712 g713 g714 g715 g716 g717 g88 g89 g810 g811 g812 g813   ///
> g814 g815 g816 g817 g99 g910 g911 g912 g913 g914 g915 g916 g917 g1010 g1011 g1012 g1013 g1014 g1015 g1016 g1017    ///
> g1111 g1112 g1113 g1114 g1115 g1116 g1117 g1212 g1213 g1214 g1215 g1216 g1217 g1313 g1314 g1315 g1316 g1317     ///
> g1414 g1415 g1416 g1417 g1515 g1516 g1517 g1616 g1617 g1717 l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17) nolog
> 

Return code 102 means that "too few variables specified"  Without seeing the "nlsurquaids" program itself, my strong guess is that the -syntax- statement is incorrect.

In your specification you have 17 dependent variables and (18 + 13 =) 31 independent variables, for a total of 48 variables.  Therefore, your -syntax- statement should be

   syntax varlist(min=48 max=48) if, at(name)


  -- Brian Poi
  -- bpoi@stata.com

*
*   For searches and help try:
*  http://www.stata.com/help.cgi?search
*  http://www.stata.com/support/statalist/faq
*  http://www.ats.ucla.edu/stat/stata/



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index