# MAKMAT: help and advice

Consult the reference manual for further details and worked examples.
W.G.Bardsley, University of Manchester, U.K.

Data tables for statistics and plotting

Program Makmat is designed to facilitate the rapid creation of data files for relatively small data sets, say less than 100 values. For larger data sets it will probably be more convenient to use one of the following techniques.

1. Create smaller data sets using Makmat, then join them together retrospectively using program Editmt.
2. Copy data from your spreadsheet to the clipboard, then paste into the program directly, or into a file using program Maksim.
3. Copy data from your spreadsheet into a comma delimted ASCII text file, then transform this into a Simfit file using program Maksim.
4. Use a macro to create data files in Simfit format from your spreadsheet, e.g. simfit6.xls for MS Excel.

All Simfit data files are ASCII text files of tables, i.e. numerical matrices, that must follow the same formatting principles as follows.

- Rows are the cases
- Columns are the variables.
- Columns can be separated by spaces or single commas.
- All cells must contain numbers.
- Numbers can be in any format, except that commas cannot replace decimal points, or be used to improve readability as in 1,000,000 for 1 million, etc., they can only be used as column separators.
- Cells cannot have missing values, non-printing characters, or labels.
- Labels for rows (then columns) can follow the data if this is required, e.g. for dendrogram plotting.

The precise meaning of the columns varies from application to application, and can be discovered by browsing the test files provided.

Formatting details

A title and header must precede the data table and, optionally, extra lines can be appended to the data table as follows.

         Line 1    : Title of the data
         Line 2    : Row and column dimensions m and n
         Line 3    : 1st. entry either v(1) or a(1,1),...,a(1,n)
         Line 4    : 2nd. entry either v(2) or a(2,1),...,a(2,n)
          ...
          ...
          ...
         Line m+2  : Last entry either v(m) or a(m,1),...,a(m,n)
         Line m+3  : Number of extra text lines (k >= 1)
         Line m+3+1: first optional text line
         ...
         Line m+3+k: k'th optional text line

After creating the data matrix you can perform further editing. Also, vectors can be rearranged into ascending/descending order. Here, for example, is the test file matrix.tf1, but note that any format can be used, not necessarily scientific notation, and it is not necessary to use commas as column separators.

    Test file matrix.tf1: arbitrary 5 by 5 matrix
         5     5
               1.2           4.5           6.1           7.2           8.0
               3.0           5.6           3.7           9.1          12.5
              17.1          23.4           5.5           9.2           3.3
              7.15          5.87          9.94          8.82          10.8
              12.4           4.3           7.7          8.95           1.6
         1
    Default line

    For instance, this was the file in earlier versions of SIMFIT.

    Arbitrary 5 by 5 matrix
         5     5
      1.2000E+00,  4.5000E+00,  6.1000E+00,  7.2000E+00,  8.0000E+00
      3.0000E+00,  5.6000E+00,  3.7000E+00,  9.1000E+00,  1.2500E+01
      1.7100E+01,  2.3400E+01,  5.5000E+00,  9.2000E+00,  3.3000E+00
      7.1500E+00,  5.8700E+00,  9.9400E+00,  8.8200E+00,  1.0800E+01
      1.2400E+01,  4.3000E+00,  7.7000E+00,  8.9500E+00,  1.6000E+00
         1
    Default line

Definitions

A column vector is just a vertical set of numbers, e.g.

               4
           V = 7
               5

is a three dimensional column vector with components v(1) = 4, v(2) = 7 and v(3) = 5.

A m by n matrix is just a rectangular array of numbers, e.g.

               1  3  5
           A = 2  4  7
               4  8  2
               5  9  2

is a 4 by 3 matrix with four rows and three columns. A matrix is simply a set of column vectors and in this example some typical components a(i,j) are: a(1,1) = 1, a(1,2) = 3, a(1,3) = 5, a(4,2) = 9, etc. Program Makmat can write a file containing either a column vector or a rectangular matrix.

Alternative ways to input a(i,j) when m > 2, n > 2

The obvious way to input elements of a vector or matrix is to enter all the values from a terminal, then do corrections as required before writing data to a file. This option is of course provided, but you may want a special matrix type e.g. one with certain rows or columns having the same values, or with nonzero diagonal elements and zero off-diagonal ones. Experienced users can use the EXPERT mode to ease preparation of special matrices by a sort of painting process. First input any number x and set all a(i,j) = x, i.e. pick a colour for the background wash. Also, If the matrix is square, you can proceed to colour-in descending or ascending diagonals. Then you can fill-in rows or columns in bold brush-strokes of the chosen colours by simply selecting the row or column numbers and values required. When the vector or matrix is ready you then add fine details (changes etc.) before writing a file. Program Editmt can edit or join files prepared by Makmat. A convenient way to construct large matrices is to make small files with this program (Makmat) and then join them together using program Editmt.

Appending extra details such as labels

Sometimes you will want to use the end of the file to record details of the experimental protocol, directions to the procedure to be used, or labels for plotting to identify the rows and/or columns. Such data can easily be pasted in retrospectively using a text editor such as Notepad. However, if you do this, you will have to change the value of the counter which indicates the number of extra lines. It may be more convenient to store a simple text file containg the row labels followed by the column labels corresponding to the data set you have created. Then, if labels are required, e.g., for principal components, dendrograms, or biplots, the labels can be pasted into the plot when required.