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.

456 Formula Functions Reference Appendix C<br />

Row Functions<br />

Lag<br />

Returns the value of the first argument in the row defined by the current row less the second argument.<br />

The default Lag is one, which you can change to any number. The value returned for any lag that<br />

identifies a row number less than one is missing. Note that Lag(X, n) gives the same result as the<br />

subscripted notation, X Row( )–n .<br />

Dif<br />

Returns the difference between the value of the first argument in the current row and its value in the<br />

row defined by the current row less the second argument. The default Dif is one, which you can change<br />

to any number. Note that Dif(X, n) gives the same result as X Row() –X Row()-n , or as<br />

X Row() –Lag(X, n).<br />

Subscript<br />

Enables you to use a column’s value from a row other than the current row. After choosing Subscript<br />

from the list, enter a numeric expression into the subscript argument. Subscripts that evaluate to<br />

nonexistent row numbers produce missing values. Column names with no subscript refers to the<br />

current row. To remove a subscript, select the subscript and delete it. Then delete the missing box.<br />

The formula Count Row() – Count Row()–1 , where Row() is the row number as described below, uses<br />

subscripts to calculate the difference between each pair of values from the column named Count. This<br />

result is the same as that given by the Dif() function. When Row() is 1, the computation produces a<br />

missing value.<br />

The formula below calculates a column called Fib, which contains the terms of the Fibonacci series<br />

(each value is the sum of the two preceding values in the calculated column).<br />

It shows the use of subscripts to do recursive calculations. A recursive formula includes the name of the<br />

calculated column, subscripted such that it references only previously evaluated rows (rows 1 through<br />

(i–1)). The calculation of the Fibonacci series shown includes a conditional expression and a<br />

comparison. See the sections “Using Conditional Clauses,” p. 302, and “Comparing Values,” p. 301, for<br />

details.<br />

Row<br />

Returns the current row number when an expression is evaluated for that row. You can use Row() in any<br />

expression, including column name subscripts. The default subscript of a column name is Row() unless<br />

otherwise specified.<br />

NRow<br />

Returns the total number of rows in the active data table.

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

Saved successfully!

Ooh no, something went wrong!