14.03.2014 Views

Using JMP - SAS

Using JMP - SAS

Using JMP - 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.

398 Formula Functions Reference Appendix B<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. The<br />

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

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

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

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

number. Note that Dif(X, n) gives the same result as X Row() –X Row()-n , or as 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 from<br />

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

numbers produce missing values. Column names with no subscript refers to the current row. To remove a<br />

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

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

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

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 (i–1)).<br />

The calculation of the Fibonacci series shown includes a conditional expression and a comparison. See the<br />

sections “Conditional Functions” on page 412, and “Comparison Functions” on page 411, for 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!