14.03.2014 Views

Using JMP - SAS

Using JMP - SAS

Using JMP - 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 7 Formula Editor 207<br />

Use Local Variables<br />

3. Click the menu on the formula element browser and select either Table Columns or Table Variables.<br />

Highlight an element from that category’s list. The element is added to the selected box in the formula<br />

editing area.<br />

For an example of referencing a column in a formula, see “Use Basic Formula Editor Features” on page 222.<br />

Note: In a formula, when you reference a column using value labels, hover your mouse over the value label<br />

to see the actual data value.<br />

Use Local Variables<br />

You can create and use temporary numeric variables in expressions. You can use ordinary local variables or<br />

you can use parameters, which are special types of local variables. Local variables exist only for the evaluation<br />

of the formula in which they are defined. They appear in formulas as bold italic terms.<br />

Local variables are most often used with Assignment functions, which can assign expressions to local<br />

variables that are used in a complex equation. (For details, see “Assignment Functions” on page 441 in the<br />

“Formula Functions Reference” chapter.) This technique can sometimes simplify building an equation and<br />

improve the efficiency of its evaluation.<br />

To build a formula that references values found in local variables:<br />

Step 1: Create the Local Variable<br />

1. Open the Formula Editor by right-clicking a column name in the data table and selecting Formula.<br />

2. Select a box in the formula editing area by clicking it. (It is selected when there is a red outline<br />

around it.)<br />

3. Click the menu on the formula element browser and select Local Variables from the formula element<br />

browser menu.<br />

4. Click New Local Variable.<br />

5. Type a name for the local variable. By default, local variables have the names t0, t1, and so on, and have<br />

missing values.<br />

6. Assign a starting value, and click OK.<br />

7. (Optional) To copy, edit, or delete a local variable, right-click (Ctrl-click on the Macintosh) its name<br />

and select Copy, Edit, or Delete.<br />

Step 2: Insert a Local Variable into a Formula<br />

1. Select a term in the formula editing area by clicking it. (It is selected when there is a red outline<br />

around it.)<br />

2. Click the local variable name in the Local Variables list. It appears in the formula as a bold italic term.

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

Saved successfully!

Ooh no, something went wrong!