14.03.2014 Views

Download Jmp User Guide

Download Jmp User Guide

Download Jmp User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

470 Formula Functions Reference Appendix C<br />

Conditional Functions<br />

Choose<br />

Choose is a special case of Match in which the arguments of the condition are a sequence of integers<br />

starting at one. The value of clause replaces the match condition. An example of a Choose condition<br />

is shown in Figure C.4. With Choose, the formula editor goes directly to the correct choice clause and<br />

evaluates the result expression.<br />

Figure C.4 Example of a Choose Condition<br />

When you highlight an expression and click Choose, the formula editor creates a new conditional<br />

expression with one clause. Use the insert ( ) and delete ( ) buttons on the keypad to add new<br />

clauses or remove unwanted clauses, as described previously for the If conditional.<br />

Choose evaluates the choose expression and goes immediately to the corresponding result expression<br />

to generate the returned value. With Choose, you provide a choosing expression that yields sequential<br />

integers starting at 1 only once, and then you give a choice for each integer in the sequence.<br />

And &<br />

Evaluates as 1 when both of its arguments are true. Otherwise it evaluates as 0. (See Figure C.7.) The<br />

formula in Figure C.5 labels Group 1 as drivers only if both comparisons are true.<br />

Figure C.5 Creating an And Function<br />

Or |<br />

Evaluates as 1 when either of its arguments is true. If both of its arguments are false, then the Or<br />

expression evaluates as 0. (See Figure C.7.) The formula in Figure C.6 assigns males and all participants<br />

over 13 to Group 1.<br />

Figure C.6 Creating an Or Function<br />

The truth tables on the left in Figure C.7 illustrate the results of the And (&) and Or (|) functions<br />

when both arguments have nonmissing values that evaluate to true or false. The table on the right<br />

illustrates the result when either the left or right expression (call them a and b) or both have missing<br />

values.

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

Saved successfully!

Ooh no, something went wrong!