PERCENT procedure

Expresses the body of a table as percentages of one of its margins (R.W. Payne).


Options

CLASSIFICATION = factors
Factors classifying the margin over which the percentages are to be calculated; if this is not set, the percentages are over the final margin (grand mean or grand total etc.)

METHOD = string
Method to use to calculate the margin if not already present (totals, means, minima, maxima, variances, medians); default tota

HUNDRED = string
Whether to put 100% values into the margin instead of the original values (no, yes); default no


Parameters

OLDTABLE = tables
Tables containing the original values

NEWTABLE = tables
Tables to store the percentage values; if any of these is unset, the new values replace those in the original table


Description

PERCENT allows you to express the body of a table as percentages of the values in one of its margins. The table is specified using the OLDTABLE parameter. A table to store the new values can be specified using the NEWTABLES parameter, otherwise these replace the values of the original table. The margin is indicated by listing the factors that define it using the CLASSIFICATION option; the default is the final margin (the grand total, or grand mean etc). If the original table has no margins, option METHOD defines how these are to be calculated; the default is to form margins of totals. The values originally in the margin will be left unchanged. If you would prefer these to be replaced by values of 100%, you should set option HUNDRED=yes.


Options: CLASSIFICATION, METHOD, HUNDRED. Parameters: OLDTABLE, NEWTABLE.


Method

If the OLDTABLE has no margins and contains no missing values, these are formed by the MARGIN directive. Alternatively, if there are missing values, margins other than variances can be formed using TABULATE. CALCULATE is then used to put the required margin into a table classified just by the factors that define the margin. The original table is divided by the marginal table and multiplied by 100 to give the required percentages. If option HUNDRED=no, the same operations are done on a dummy table that originally contains random numbers; for this table, values of 100 should occur only in the margin. Thus by using a logical test in which the values of the dummy table are compared with 100, the marginal values of the original table can be put back into the margin of the final table. The random numbers are generated using a specially written procedure URANDOM in case the GenStat random number generator is already in use in the program that called PERCENT.