14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10 <strong>Scripting</strong> Platforms 313<br />

Launching Platforms Interactively and Obtaining the Equivalent Script<br />

Comparison Circles( 1 )<br />

);<br />

All platform scripts start with a command to call the platform, in this case Oneway. Inside the Oneway<br />

command are two types of arguments: arguments like the Y and X column role lists are required at launch,<br />

and options like Each Pair(1) are sent to the platform after it is launched.<br />

Most options are simple on/off choices with check marks (or not). The scripting equivalent of a check box is<br />

a Boolean argument 1 or 0.<br />

Other commands lead to dialog boxes where you specify values or make choices. In scripts, such<br />

specifications are given inside parentheses and separated by commas, usually in the same order as they<br />

appear in the window (top to bottom, left to right).<br />

BY Group Reports<br />

In most platforms, you can run the platform repeatedly across subgroups of the rows as defined by one or<br />

more by columns. To do this in scripts, include a By argument in the launch command, listing each column<br />

as the argument to By.<br />

Example<br />

1. Open the Big Class sample data table.<br />

2. Run this script to produce a bivariate report by sex:<br />

biv = Bivariate(Y(weight), X(height), By(sex));<br />

This launch message produces a report window with two nodes in the outline, one for the rows of the data<br />

table where sex is “F” and a second for rows where sex is “M.” Rather than returning a reference to a<br />

platform, Bivariate[], the platform object returns a list of references {Bivariate[], Bivariate[]}:<br />

show(biv);<br />

biv = {Bivariate[], Bivariate[]}<br />

You can direct messages either to each reference individually or to the list of references, depending on<br />

whether you want to change selected nodes individually or all nodes simultaneously.<br />

3. Run this line to add a regression fit to both nodes:<br />

biv

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!