In the example above there is a condition which specifies which rows are to be included in the analysis, and in general a condition is a statement of a logical expression which is either true or false. So c5>6 is true for a given row if the value in the fifth column of that row is 9, but false if it is 2. Conditions are used to specify whether or not a row belongs to a given group or not, and in the example given whether or not it should be included with the other values towards deciding the sample mean, standard deviation, etc.
s c1 if (c2-c3)<7means that if the statement given is true for a particular row then the value in column one will be taken and added to the sample and incorporated in the measurement of mean and standard deviation, but if not that particular row will be ignored for the purpose of the current analysis and left out of the sample.
Here is a list of all the logical operators:
The expression is true if the relationship between x and y is as described, but false if not. The OR relationship is true if either condition x or condition y is true, and the AND relationship is true only if both condition x and condition y are true. (Note that the symbol for the OR operator, |, appears as a broken vertical line on most keyboards and is usually found on the same key as the backslash, \.) Here are some examples:
So you see expressions can be made as simple or as complicated as you like, and sub-clauses are contained in brackets. In fact the brackets are not always necessary - see the section below on operator precedence. Spaces occurring in logical and arithmetic expressions are ignored.
When the keyword ROW is used in a condition then the number of the row itself is tested, so:
row<5is true if the number of the row is less than 5, i.e. one of the first four rows.
Contrast this to:
c1<5which as we have already discussed means the rows for which the value in the first column is less than 5.
There is no reason why references to rows and column cannot be combined in the same expression, e.g.:
(c1<10) & (row<5)or even:
c1<rowNote to users familiar with spreadsheets:
You will probably realise that these references to values are what are usually called relative references, they relate only to the column of the row in question. There is for example no direct way to compare values in an expression to the value in the third column of the fifth row - an absolute reference. A partial exception to this allowing references to the values in the first valid row only is described in the section on the ARITHMETIC command.