14.03.2014 Views

Download Jmp User Guide

Download Jmp User Guide

Download Jmp User Guide

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.

Chapter 9 Formula Editor 289<br />

Using Local Variables<br />

Using Local Variables<br />

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

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

evaluation 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. (See “Using Assignment Functions,” p. 309, for details.)<br />

This technique can sometimes simplify building an equation and improve the efficiency of its<br />

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 grid 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<br />

element 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<br />

have 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<br />

term.<br />

9Formulas<br />

Note: Another way to create local variables is to use the button on the formula editor keypad,<br />

which automatically creates and displays local variables and places a semicolon after it. See “Adding<br />

Operators,” p. 291, for details.<br />

See “Using Local Variables in a Formula,” p. 323, for an example of referencing local variables in a<br />

formula.<br />

Incorporating Parameters<br />

Parameters are special types of local variables that are recognized as model parameters in some<br />

platforms, like Nonlinear fitting. They can be used in formulas just as ordinary local variables can.<br />

To view examples of parameters<br />

1 In the Sample Data folder that was installed when you installed JMP, open the Nonlinear Examples<br />

folder and then US Population.jmp.

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

Saved successfully!

Ooh no, something went wrong!