Munich Personal RePEc Archive

SAS® Macros for Constraining Arrays of Numbers

Coleman, Charles (2015): SAS® Macros for Constraining Arrays of Numbers. Published in: Southeast SAS Users Group 2015 Proceedings

This is the latest version of this item.

[img]
Preview
PDF
MPRA_paper_77843.pdf

Download (4MB) | Preview

Abstract

Many applications require constraining arrays of numbers to controls in one or two dimensions. Example applications include survey estimates, disclosure avoidance, input-output tables, and population and other estimates and projections. If the results are allowed to take on any nonnegative values, raking (a.k.a. scaling) solves the problem in one dimension and two-way iterative raking solves it in two dimensions. Each of these raking macros has an option for the user to output a dataset containing the rakes. The problem is more complicated in one dimension if the data can be of any sign, the so-called “plus-minus” problem, as simple raking may produce unacceptable results. This problem is addressed by generalized raking, which preserves the structure of the data at the cost of a nonunique solution. Often, results are required to be rounded so as to preserve the original totals. The Cox-Ernst algorithm accomplishes an optimal controlled rounding in two dimensions. In one dimension, the Greatest Mantissa algorithm is a simplified version of the Cox-Ernst algorithm.

Each macro contains error control code. The macro variable &errorcode is made available to the programmer to enable error trapping.

Available Versions of this Item

UB_LMU-Logo
MPRA is a RePEc service hosted by
the Munich University Library in Germany.