Previous Page | Next Page

The CALIS Procedure

SAS Programming Statements

This section lists the programming statements used to express the linear and nonlinear constraints on the parameters and documents the differences between programming statements in PROC CALIS and program statements in the DATA step. The very different use of the ARRAY statement by PROC CALIS is also discussed. Most of the programming statements that can be used in the SAS DATA step also can be used in PROC CALIS. Refer to SAS Language Reference: Dictionary for a description of the SAS programming statements. You can specify the following SAS programming statements to compute parameter constraints with the CALIS procedure:

ABORT;

CALL name < ( expression <, expression ...> ) >;

DELETE;

DO < variable = expression

<TO expression> <BY expression>

<, expression < TO expression> < BY expression > ...>

>

< WHILE expression > < UNTIL expression >;

END;

GOTO statement-label;

IF expression;

IF expression THEN program-statement;

ELSE program-statement;

variable = expression;

variable + expression;

LINK statement-label;

PUT < variable > <=> <...>;

RETURN;

SELECT <( expression )>;

STOP;

SUBSTR( variable, index, length )= expression;

WHEN ( expression ) program-statement;

OTHERWISE program-statement;

For the most part, the SAS programming statements work the same as they do in the SAS DATA step as documented in SAS Language Reference: Concepts. However, there are several differences that should be noted.

  • The ABORT statement does not allow any arguments.

  • The DO statement does not allow a character index variable. Thus,

       do I=1,2,3;
        

    is supported; however,

       do I='A','B','C';
        

    is not valid in PROC CALIS, although it is supported in the DATA step.

  • The PUT statement, used mostly for program debugging in PROC CALIS, supports only some of the features of the DATA step PUT statement, and it has some new features that the DATA step PUT statement does not have:

    • The CALIS procedure PUT statement does not support line pointers, factored lists, iteration factors, overprinting, _INFILE_, the colon (:) format modifier, or $.

    • The CALIS procedure PUT statement does support expressions enclosed in parentheses. For example, the following statement displays the square root of x:

         put (sqrt(x));
                
    • The CALIS procedure PUT statement supports the print item _PDV_ to display a formatted listing of all variables in the program. For example, the following statement displays a much more readable listing of the variables than the _ALL_ print item:

         put _pdv_ ;
                
  • The WHEN and OTHERWISE statements allow more than one target statement. That is, DO/END groups are not necessary for multiple WHEN statements. For example, the following syntax is valid:

       select;
          when ( expression1 ) statement1;
                               statement2;
          when ( expression2 ) statement3;
                               statement4;
       end;
         

You can specify one or more PARMS statements to define parameters used in the programming statements that are not defined in the model matrices (MATRIX, RAM, LINEQS, STD, or COV statement).

Parameters that are used only on the right-hand side of your programming statements are called independent, and parameters that are used at least once on the left-hand side of an equation in the program code are called dependent parameters. The dependent parameters are used only indirectly in the minimization process. They should be fully defined as functions of the independent parameters. The independent parameters are included in the set of parameters used in the minimization. Be sure that all independent parameters used in your programming statements are somehow connected to elements of the model matrices. Otherwise the minimization function does not depend on those independent parameters, and the parameters vary without control (since the corresponding derivative is the constant 0). You also can specify the PARMS statement to set the initial values of all independent parameters used in the programming statements that are not defined as elements of model matrices.

ARRAY Statement

ARRAY arrayname <dimensions><><variables and constants> ;

The ARRAY statement is similar to, but not the same as, the ARRAY statement in the DATA step. The ARRAY statement is used to associate a name with a list of variables and constants. The array name can then be used with subscripts in the program to refer to the items in the list.

The ARRAY statement supported by PROC CALIS does not support all the features of the DATA step ARRAY statement. With PROC CALIS, the ARRAY statement cannot be used to give initial values to array elements. Implicit indexing variables cannot be used; all array references must have explicit subscript expressions. Only exact array dimensions are allowed; lower-bound specifications are not supported. A maximum of six dimensions is allowed.

On the other hand, the ARRAY statement supported by PROC CALIS does allow both variables and constants to be used as array elements. Constant array elements cannot be changed. Both the dimension specification and the list of elements are optional, but at least one must be given. When the list of elements is not given or fewer elements than the size of the array are listed, array variables are created by suffixing element numbers to the array name to complete the element list.

Previous Page | Next Page | Top of Page