.. index:: single: G7 Command; ras single: G7 Command; psras single: G7 Command; rdras single: Preconditions (Part of RAS Command) single: Balancing of Matrices single: Sums of Matrix Columns or Rows Matrix Balancing by the Ordinary RAS Method =========================================== .. _G7UGordinaryras: In work with input-output analysis, one frequently needs to balance a table to known row and column totals. Three methods of scaling are offered in *G7*: ordinary RAS, proportional scaling RAS (*psras*), and right-direction RAS (*rdras*). In additional, outside information may be imposed using the "precondition" features described below. The RAS commands are: **ras|psras|rdras [<-f|c>] [(r rgroup)][(c cgroup)] [yr][r|c][-maxiter][-precon] [-tolerance]** where: :-f|c: specifies the flow (default) or the coefficient mode, :ras|psras|rdras: specifies the method of scaling to be used, :matrix: is the name of the matrix whose elements are to be balanced, :(r rgroup): :(c cgroup): are options that determine which rows and columns are included, :rowctrl: :colctrl: are vectors that contain the row and column totals, :yr: optionally specifies the year for which the matrix is to be balanced. If a year is not specified, the matrix is balanced over the period specified by the current *fdates*. :r|c: optionally specifies whether the sum of the row totals or the sum of the column totals controls the calculations if the two are not the same. :-maxiter: optionally determines maximum number of iterations. The default is 100. :-precon: optionally specifies that name of a file containing the preconditions that are to be imposed. :-tolerance: optionally specifies the tolerance for the convergence test. The default value is 0.000002. If one or more of row and/or column totals are questionable, the matrix still may be balanced by a special use of proportional scaling RAS, which is explained in Balancing Matrices with Uncertain Totals. Related Topics: :ref:`coef `, :ref:`flow `, :ref:`psras `, :ref:`rdras `