Program Statements
This section lists the program statements used to code the log
likelihood function in PROC NLMIXED. It also documents the
differences between program statements in PROC NLMIXED and program
statements in the DATA step. The syntax of program statements used in
PROC NLMIXED is identical to that used in the CALIS and GENMOD
procedures
(refer to the
SAS/STAT User's Guide), and the MODEL procedure
(refer to the SAS/ETS User's Guide).
Most of the program statements that can be used in the SAS DATA step
can also be used in the NLMIXED procedure. Refer to SAS
Language: Reference for a description of SAS program statements. The
following are valid statements:
- 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 program statements work the same as they do
in the SAS DATA step, as documented in SAS Language: Reference;
however, there are several differences:
- 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, the following statement is not supported.
do i = 'A','B','C';
- The PUT statement, used mostly for program debugging in PROC NLMIXED,
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.
- The PROC NLMIXED PUT statement does not support line pointers,
factored lists, iteration factors, overprinting, _INFILE_,
the colon (:) format modifier, or "$".
- The PROC NLMIXED PUT statement does support expressions, but
the expression must be enclosed in parentheses. For
example, the following statement displays the square root of x:
put (sqrt(x));
- The PROC NLMIXED PUT statement supports the 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 enable you to specify
more than one target
statement. That is, DO/END groups are not necessary for multiple
statement WHENs. For example, the following syntax is valid:
select;
when ( exp1 ) stmt1;
stmt2;
when ( exp2 ) stmt3;
stmt4;
end;
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.