Syntax Diagrams
Syntax diagrams specify the syntax
of IBM® SPSS® Statistics commands, such as the
allowed subcommands, keywords, and keyword values. Although not required
for an extension command, it is recommended to create a syntax diagram
for users of your extension command. You may even want to make
it available from the submitted syntax itself, perhaps with a HELP
subcommand. Creating the syntax diagram
will also simplify the task of creating the XML specification file
for the extension command.
The rasch
function from the R ltm
package
has the following specification:
rasch(data, constraint = NULL, IRT.param = TRUE, start.val = NULL,
na.action = NULL, control = list())
We will wrap this function in an
extension command named SPSSINC RASCH DEMO
and allow the user to specify the data and na.action arguments, but
keep the default values for all of the other arguments. The argument data is a data frame whose columns contain
the variables to analyze and na.action specifies the handling of missing values.
SPSSINC RASCH DEMO
/VARIABLES ITEMS=variable list
[/OPTIONS MISSING={LISTWISE** } ]
{ALLAVAILABLE}
The syntax diagram starts with
the command name. Subcommands are specified with a forward slash (/),
followed by the name of the subcommand, followed by the specifications
of keywords belonging to the subcommand. In this example, the VARIABLES
subcommand specifies the variables
for the Rasch analysis. The keyword ITEMS
specifies the variable list, which will be used to populate the
argument data to the rasch
function.
Optional subcommands and keywords
are enclosed in square brackets ([ ]). In this example, the OPTIONS
subcommand is optional.
Braces ({ }) indicate a choice between
elements. In this example, the keyword MISSING
can be set to LISTWISE
or ALLAVAILABLE
.
A double asterisk (**) indicates the
default value of a keyword if the associated keyword is omitted. In
this example, the value LISTWISE
will be used if the MISSING
keyword is omitted.
Note that the square brackets ([ ]), braces ({ }), and double asterisks (**) are not part of the actual syntax.