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

Home Introduction Guided Tour Transforming Data |
||
See also: Math Formulas, Math Formulas - Constants, Variables, Operators, Scaling, DataLab Scripts, Univariate Descriptors
![]() |
||
Guided Tour: Transforming DataA quite useful feature of DataLab is the support of arbitrary mathematical transformations which can be applied to the data matrix or parts of it. This transformation capability can also be used to create new artificial data (e.g. to create random numbers). The principle of the data transformation is quite simple: The rows and columns are denoted by the characters 'R' and 'C' together with some numerical index. The expression 'C13' means for example the variable (column) number 13. These identifiers can be used within a mathematical formula just like variables in a BASIC statement. An expression such as 'C2 = C3*(C10-C4)' calculates the difference between columns 4 and 10 and multiplies it by the values in column 3. The result is stored in column 2. The calculation is carried out for each row in the data matrix unless the range of rows is restricted.
In order to enter a formula, you have to select the command Math/Apply Math Formula or the shortcut button
For now let's create a data matrix (100 by 5 elements) holding artificial data. Therefore, first we have to set the number of rows and columns at 100 and 5, respectively (use the command Edit/Resize Data Matrix or the shortcut button C1 = SIN(0.33*RIX)*COS(0.13*RIX)
This fills the first column with a nice curve. You may plot this curve by opening a plot window and selecting a Col-Idx plot (command Window/New or the shortcut button C2 = C1 + 0.1*GAUSS This equation creates the sum of the first column and normally distributed random numbers and stores it in the second column. You can display the resulting signal either by opening another data plot, or by switching to the next column in the existing plot (use the arrow buttons). Looks much more realistic a signal, doesn't it ?
|
||