CSTATS: Compute Means and Standard Deviations

Last updated 18 Nov 97

CSTATS computes the mean and standard deviation of selected variables for members of a specified group. The output may be organized either as a list of variables within group or as a list of groups for a given variable. Either of these lists may optionally be sorted.

CSTATS collects the membership masks and variables requested from a Case Data file, and computes mean and standard deviation values for all variable/group combinations. The computed values will be saved on an output file if one is given on the program invocation line. If an output file is specified, a maximum of 5000 variable/group combinations can be saved. The number of variable/group combinations generated is equal to the number of value selection cards multiplied by the number of membership selection masks requested.

Program Invocation

The specific syntax for program invocation varies between operating systems. This document diplays the code for the AIX version.


@codap cstats <opt> <ssss> <CDf> <TFf> [<TT>] [<VTf>] [<GSf>]

opt:  E   Expand report, print each table on a new page
      N   NOGO option, perform control card check
      R   Compute task values using raw ratings
ssss:     The study number 
CDf:      Input Case Data file
TFf:      Input Task Factor file
TT:       Input Task Title file, required  only if one or more tasks are
          requested in the value selection cards.
VTf:      Input Variable Title file, required only if one or more computed or
          background variables are requested in the value selection cards
GSf:      Output Group Statistics file, used only if the computed values are to
          be saved.

CSTATS Control Card


CSTATS <stdy> <title>

CSTATS:   cc 01-06  The literal 'CSTATS'
stdy:     cc 08-11  The study number for this run
title:    cc 13-72  Any report title information desired

Report Note Cards (optional)

The cards in this section are textual notes that are to be printed on the report. There is no limit on the number of note cards which may be used. All cards found between the 'NOTE' card and the '@EOF' card will be treated as notes and will not be scanned as control cards.


NOTE
.
...text...
.
@EOF

Membership Selection Cards

These cards identify the group membership masks to be used in performing computations. They assign a memory name which is used on the report request cards to select groups to print. A maximum of 200 groups may be specified.

MEMBERSHIP Card


MEM

MEM:    cc 01-03  The literal 'MEM'

Selection Cards


<name> = <group-id> [<title>]

name:     cc 01-04  Any name desired, must be unique
=:        cc 05     The literal '='
group-id: cc 06-11  The Group ID for the desired group
title:    cc 13-72  The group title to be used for this run, default =
                    title from the Task Factor file

These cards are terminated by an '@eof' image.

(a) Value Selection Cards

The value selection cards define the variables to be used in the computations. These cards also attach a user specified working storage name to each variable defined. All working storage names must be unique for the run or errors will result. The working storage names are used on the report request cards to specify the variables which are to be reported. Any task, or numeric background variable may be used in the computations. All computed variables other than C0001 through C0006 may also be used.

VALUE Card


VALUE

VALUE:    cc 01-03  The literal 'VAL'

Value Selection Cards


<name> = <var-id> <min> <max>

name:     cc 01-04  Any name desired, must be unique
=:        cc 05     The literal '='
var-id:   cc 06-11  The  variable identifier for the desired computed,
                    background or task variable (e.g. C0007, V0020, T0001)       
min:      cc 13-24  The minimum acceptable value to use for this variable,
                    if blank the actual minimum found will be used
max:      cc 26-37  The maximum acceptable value to use for this variable,
                    if blank the actual maximum found will be used

These cards are terminated by an '@eof' image.

Report Request Cards

These cards are used to specify what is to be printed. Each request card causes one or more tables to be printed on the output report. The tables which are printed can be either variables listed under a group or groups listed under a variable by changing the order of the field specifiers. In the form pictured below, the primary field (leftmost) determines the type of table to be reported. The secondary field (rightmost) specifies the items to be listed for that table type. This means that if a table is desired that lists all the variables and their values for GP0001, then the working storage name for GP0001 should be used as the primary specifier and the working storage names for the range of variables should be used as the secondary specifier. The tables may optionally be sorted descending on the mean values.

The fields on the report request card are floating format. Any embedded spaces following the REP will be ignored. The fields must be given in the order specified and columns 1-4 must contain the literal 'REP '.


REP <prim1>[-<prim2>] / <sec1>[-<sec2>][,SORT]

REP:      cc 01-04  The literal 'REP '
prim1:    The primary report specifier. This can be the working storage name
          of either a group or a variable.
-prim2:   Specifies a range of tables to report.  Must be a working storage
          name of the same type as prim1.  One table is reported for each
          item in the range.
/:        The literal '/'
sec1:     The secondary specifier.  Must be of type opposite the primary
          specifier, e.g. if the primary specifier was a group then this
          must be a variable.  It must be a working storage name defined 
          in the selection cards above. The item is listed on any tables
          produced by the primary specifier.
-sec2:    Causes a range of items to belisted for each table.  The type
          must be identical to the type for sec1 and the name must have 
          been defined on the selection cards above.
,SORT:    Used to indicate that any tables produced by this request are
          sorted descending on mean values.

These cards are terminated by an end-of-file or an '@eof' image.

Example

@codap cstats - ssss cd100 tf100 tt001 vt100 gs100
CSTATS ssss Statistics report for contract XYZ
NOTE
Now the note cards for
this layout can be entered...
@eof
MEMBERS
M001=GP0002 
M002=GP0002
M003=GP0010
@EOF
VALUES
V001=C0010
V002=C0007
V003=T0008
V004=T0020
V005=T0100
V006=V0006
V007=V0003
V008=V0002
V009=V0023
V010=V0017
@EOF
REP M001-M003/V001-V005,SORTED
REP V006-V010/M001-M003
@EOF

Back to document index