14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

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

group. All the BY groups appear in the same window when the report is re-run, because Save Script<br />

For All Objects wraps all By-variable analyses in a New Window() command. For example, a<br />

bivariate fit of height by weight grouped by males and females would result in the following script.<br />

New Window("Big Class.jmp: Bivariate",<br />

Bivariate(Y( :height), X( :weight), Fit Line, Where( :sex == "F"));<br />

Bivariate(Y( :height), X( :weight), Fit Line, Where( :sex == "M")));<br />

Save Script to Project<br />

Creates a script to reproduce the report and saves it as a JSL file in a JMP project.<br />

Data Table Window Displays a data table window with the BY group data associated with the analysis<br />

when it has By groups, and brings the data table window forward otherwise.<br />

Make Some Changes<br />

Now, continue working in the Oneway report window.<br />

1. From the red triangle menu for Oneway Analysis of height by age, select Means/Anova.<br />

2. From the same menu, select Compare Means > Each Pair, Student’s t.<br />

3. From the same menu, select Script > Save Script to Script Window.<br />

The resulting script is as follows:<br />

Oneway(<br />

Y( :height ),<br />

X( :age ),<br />

Each Pair( 1 ),<br />

Name( "Means/Anova" )(1),<br />

Mean Diamonds( 1 ),<br />

Comparison Circles( 1 )<br />

);<br />

The script records the choices that you made in the menu. Since these are all Boolean (on or off) options,<br />

they have an argument of 1 to turn them on. In addition to the options selected, three additional display<br />

options have been implied from the other commands given. Choices that you make in menus and their<br />

corresponding JSL commands have exactly the same effects.<br />

You could submit this script to get exactly this report quickly, without all the interactive steps. To run a<br />

script from a script window, select the text and then either select Edit > Run Script, or type CONTROL-R<br />

(Windows) or COMMAND-R (Macintosh). If you select no text, the entire window is run.<br />

Syntax for Platform <strong>Scripting</strong><br />

Look at the script in more detail.<br />

Oneway(<br />

Y( :height ),<br />

X( :age ),<br />

Each Pair( 1 ),<br />

Name( "Means/Anova" )(1),<br />

Mean Diamonds( 1 ),

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

Saved successfully!

Ooh no, something went wrong!