Grouping Terms into One New Coefficient (AnalyseGE form) If you are analysing some aspect of the data or analysing an equation, you may wish to group the results of calculating several parts of this into one coefficient. The examples below make this clear. We are grateful to Tom Hertel for suggesting this. You can set up the values of the new coefficient by entering statements into the memo on the AnalyseGE form. Example Suppose you are investigating household consumption in ORANIG and wish to see how much tax is levied on the different commodities. Then you may wish to define a new coefficient which can show basic values, purchasers’ values (these include the tax) and the tax all at the same time. The relevant Coefficients in the TAB file for ORANIG are: V3BAS(c,s) - basic values of commodity c from source s (domestic or imported), V3PUR(c,s) - purchasers’ values of commodity c from source s. The amount of tax is the difference between these two. You might like to define a new Coefficient which shows all three values (for each c and s). Such a coefficient would have arguments c and s (for commodity and source) and an extra argument, say "v", to indicate value type (basic, purchasers or tax). You will need a new set, perhaps called ValueTypes with three elements (basic, purchase, tax) for the 3 different values. This can all be set up and the values of the new Coefficient written to the ViewHAR form if you enter the following statements into the AnalyseGE form. Xset ValueTypes (basic, purchase, tax) ; Coefficient (All,c,COM)(All,s,SOURCE)(All,v,ValueTypes) COEFF1(c,s,v) ; Formula (All,c,COM)(All,s,SOURCE) coeff1(c,s,"basic") = V3BAS(c,s) ; Formula (All,c,COM)(All,s,SOURCE) coeff1(c,s,"purchase") = V3PUR(c,s) ; Formula (All,c,COM)(All,s,SOURCE) coeff1(c,s,"tax") = V3PUR(c,s) - V3BAS(c,s) ; Write ; The "XSET" statement defines a new set to be used. The "COEFFICIENT" statement defines the new coefficient to be used to store the results of the different calculations. The "FORMULA" statements set the values for the various parts. The "WRITE" statement causes the values of the new coefficient Coeff1 to be written to the output Header Array file. Note that coefficients defined via "COEFFICIENT" statements are only available until the next "WRITE" statement (or until a formula not beginning with "FORMULA" is inserted). [This is why we have used the uninformative name "Coeff1".] "FORMULA" statements are only allowed after an "COEFFICIENT" statement. These must have the coefficient defined via the previous "COEFFICIENT" statement on the left-hand side, followed by an equals sign. [Contrast "FORMULA" statements with the formulas entered into the memo on the AnalyseGE form in which the left-hand side is not included.] After a "COEFFICIENT" statement and one or more "FORMULA" statements, you should always add a "WRITE" statement to write the value of the new coefficient to the output Header Array file. This "WRITE" statement always writes the values of the most recent coefficient defined in an "COEFFICIENT" statement to the output file. Second Example This is an example in which a new coefficient is set up (in the memo on the AnalyseGE form) in order to analyse an equation. URL of this topic: www.copsmodels.com/webhelp/analysege/hc_newcoefficient.htm Link to full GEMPACK Manual Link to GEMPACK homepage |