DataLab is a compact statistics package aimed at exploratory data analysis. Please visit the DataLab Web site for more information....



Math Formulas - Constants, Variables, Operators

For entering mathematical formulas there are several special variables and constants, most of which are directly connected to the contents or indices of the data matrix:

Identifier Type Explanation
NCol const R/O Number of columns of the data matrix
NRow const R/O Number of rows of the data matrix
Pi const R/O The number Pi (3.14159...)
Cx var R/W Data in column x (x = 1..NCol)
Rx var R/W Data in row x (x =1..NRow)
Cx:Cy var R/W Data in columns x to y (x,y = 1..NCol)
Rx:Ry var R/W Data in row x to y (x,y = 1..NRow)
CuRv:CxRy var R/W Data in a rectangular area of the data matrix which is bounded by the columns Cu and Cx and the rows Rv and Ry.
All var R/W All data of the data matrix
Marked var W/O All marked cells of the data matrix; the identifier "Marked" is only allowed in the left part of an equation.
Rix var R/O Row index of the data matrix
Cix var R/O Column index of the data matrix

The following operators are currently available for mathematical transformations:

Operator Function Explanation
+ summation x+y
- subtraction x-y
* multiplication x*y
/ division x/y
# modulo round(x) mod round(y)
^ exponentiation x^y , x,y..any real values
() parenthesis parenthesis can be used to change operator precedence
ABS absolute value abs(x), x..any real value
ARCCOS inverse cosine arccos(x), x..angle in radians
ARCSIN inverse sine arcsin(x), x..angle in radians
ARCTAN inverse tangens arctan(x), x..angle in radians
COS cosine cos(x), x..angle in radians
EXP exponent exp(x)
FRAC decimal part of a real number frac(x)
GAUSS normally distributed random numbers gauss creates random numbers with zero mean and unit standard deviation
INT integer part of a real number int(x)
LG decadic logarithm lg(x)
LN natural logarithm ln(x)
NDDENS density of the standard normal distribution nddens(x)
NDINT integral of the standard normal distribution from
-infinity to x
ndint(x)
NDQUANT quantile of the standard normal distribution for a probability x ndquant(x)
RAND uniformly distributed random numbers random(x), x..amplitude of noise (mean = 0.0)
ROUND rounding to integer round(x)
SIGN returns the sign of variable x sign(x)
SIN sinus sin(x)
SQR square sqr(x)
SQRT square root sqrt(x)
TAN tangens tan(x)


Last Update: 2010-Mär-09