
DataAnal V5.5
=============

1. Introduction
===============

DataAnal is a program for analysing data (no surprise there).  At the very
least, DataAnal will find the mean, median and standard deviation of a list
of numbers.  It will also draw histograms, plot graphs, and compare your
data to mathematical probability distributions.

DataAnal can read data in two forms:

(a) A list of single numbers.
(b) A list of coordinate pairs.

Data is read from ASCII text files, and can therefore by typed up and
edited with an standard text editor, such as `ED'.

2. Instructions
===============

2.1 Entering/Loading Data
-------------------------

When the program is first run, you have a choice to load in the data from a
disk file, or to enter it from the keyboard.  Choose the appropriate item
from the menu, using the right mouse button.

To enter data from the keyboard, you must specify how many data items you
have.  Then just type in each number, and press return.  If you are
entering coordinate pairs, you must separate the two numbers with a comma.

You can also enter a note corresponding to each item of data.  This is done
by typing a ' after the data, and then entering your note.  This is
explained in more detail later.

2.2 The Main Screen
-------------------

The Main Option Screen lists a portion of the data list you have just typed
in or loaded.  On the right hand side there is some information about the
current file, and the current status of DataAnal.

The portion of data is divided up into five columns.  The first column
shows the item number of the data.  Click on an item number to centre the
data-list on that item.

The second column (M) shows whether or not an Item has been `marked'.  When
results are calculated, only the `marked' items will be taken into account.
This means it is possible to perform calculations on a certain portion of
the data only.  Marked Items are indicated by a "*".  To mark/unmark an
item, click in this column.

The third and fourth columns (Set X and Set Y) show the data itself.  If
coordinate pairs were typed (or loaded) in then Set X and Set Y will
contain numbers.  Otherwise, only Set X will.

The final column shows any notes you have added to the data-list.

Notice one item in the data-list is in a darker colour.  This is the one
that will be amended if the `Amend' option is selected.

The File Info on the right tells you how long the current file is (if it
was loaded from disk), and how many items there are.  Also written here is
something like this:-

           Operator:  Ignore

           No. Sets:  1 or 2

           X Func :   Linear
           Y Func :   Linear

`Operator' refers to which operator has been selected from the `Mark' menu.
This is explained later.

`No.  Sets :' Tells you how many sets there are.  If `Set Y' contains
numbers, then this will be `2'.

`Set X:  Linear' (and `Set Y:  Linear' if it is there) refer to the
function that is currently operating on each data set.  This is selected
from the `Func' Menu.

2.3 Menus
---------

Functions are generally selected using pull-down menus.  Most functions are
relatively straight forward...

SAVE will save the current data-list.  NEW will clear the list and return
you to the opening screen.

The PAGE UP, PAGE DOWN, GOTO FIRST and GOTO LAST enable you to list a
different portion of the data.  GOTO #N will allow you to choose a certain
item number; the data-list will then be centred on this item.

AMEND allows you to enter a new value of a specific item.  The item that is
currently shown in white will be amended.  To amend a coordinate pair, you
must enter both coordinates (x then y), separated by a comma.  You can also
write a short note for each item.  This is preceded by a '.  For example,
you might type in:

1,3  'This is my note         for a coordinate
27   'This is my note         for a single item

As well as marking items manually, by clicking on the `M' Column as
described above, you can also mark a whole section of the data at a time.
MARK ALL and SWAP ALL are self-explanatory.  Here are the more interesting
ones...

If you choose MARK ABOVE you will be asked to enter a number.  All items
whose data is above this number will be "marked".  Similarly for MARK
BELOW.  With MARK RANGE, a continuous portion of the data can be selected
(eg, all items from item 3 to item 7).

You can also perform AND, OR and XOR operations with the previous `mark'
status.  To do this, select the appropriate operator from the `Mark' menu.
For example, suppose you wanted to select all items that were either above
20 or below 10.  You would first choose MARK ABOVE and type in 20.  Then
select OR from the list of OPERATORs so that the results from both search
will combined.  Finally select MARK BELOW and type in 10.

If you want the previous select status to be ignored, choose the `Ignore'
operator.  This is the default.

The options in the RESULTS menu are examined in section 2.4

The next menu is the FUNCTION menu.  This is used to perform a function on
every item of data in Set X and/or Set Y.  The default is `Linear' which
simply means no function is in operation.  Here is a list of the functions
and the result on the data set.

        Function        Effect
        --------        ------
        Linear          Nothing
        Square          Take the square (x^2)
        Square Root     Take the square root
        Inverse         Take the reciprocal (1/x)
        Ln              Take the natural Logarithm (ie, to base e)
        Exp             Take the exponent (ie, inverse of log)

All calculations will then apply to the values of the functions of x, not
the original value itself.  For example...

        Linear         Square
        ------         ------
Item1:  2               4
Item2:  3               9
Item3:  6               36
Item4:  5               25

Mean:   4               18.5

The final menu is the SETS menu.  These options will do things to your
entire data set(s).

`Swap X,Y' simply swaps Set X and Set Y around.  `Kill Set Y' will remove
the numbers in `Set Y', so that only one data-set (Set X) is left.

`Sets 1<->2' will change your data list from one to two sets (or back from
two to one).  This works as follows:

When a single set is converted to two sets, then the number of times each
element occurs becomes the corresponding second set.  Here is an example:

Set X             Set X   Set Y
 2                  2      2         (ie `2' occurs twice)
 2      ----->      3      1         (ie `3' occurs once)
 3                  4      0         (ie `4' does not occur at all)
 5                  5      3         (ie `5' occurs three times)
 5
 5

Note the order of Set X does not matter.  If Set X had contained
5,5,5,3,2,2 then the result would have been the same.  It is important to
realise therefore, than using this option will cause the order of the data
to be lost.  Also, if any of your data-items had `notes', then these will
be lost too.

Selecting this option again will convert the two sets back to one set.

2.4 Results
-----------

Note:  Results are only calculated for those items that have been `marked'.
Initially, all the items are `marked'.

This first item in this menu is Print.  You can set the print device to a
the printer (ie, PRT:) or filename (eg, DF0:myfile).  All results will then
be outputed to your chosen print device/file.  To cancel this, select
`Cancel' from the same menu.

The results will apply as follows:

If there are two data sets, then the item in Set Y is assumed to mean to
frequency with which the corresponding item in set X occured.  Here is an
example:

Set X    Set Y

 1        2      }  --------->   1, 1, 2, 2, 3  The results refer to this
 2        2      }                              list of numbers. Eg, the
 3        1      }                              average (mean) is 1.8


LIST will simply give a list of results.  The mean, standard deviation,
median, minimum value, maximum value, and mode (if appropriate) are shown.
Note that the results only apply to items that have been marked.

HISTOGRAM will draw a histogram showing the frequency with which each
number occured.  This is only applicable to integers, but for non-integers,
the numbers are rounded first.  You can choose the character with which the
histogram is to be drawn (usually # or *).  You can also make the histogram
bigger by, for example, entering `##' instead of `#'.  Here is an example:

       Set X               or             Set X  Set Y
Item1:  7                                  4      1
Item2:  6                                  5      0
Item3:  7                                  6      2
Item4:  4                                  7      3
Item5:  7
Item6:  6

would produce a histogram like one of these:

Characters=`#'         Characters=`##'      Characters=`*'

4:#1                   4:##1                4:*1
5:0                    5:0                  5:0
6:##2                  6:####2              6:**2
7:###3                 7:######3            7:***3

PROBABILITY will attempt to fit your data to a probability distribution.
In this version, the following distributions are available:

 - Binomial.
 - Pascal (or Negative Binomial).
 - Normal.

Both the actual probabilities (ie, according to your data), and the
theoretical probabilities (ie, according to the distribution itself) are
shown for each value of data.  P(x=a) means the probability that x equals
a.  P(x<=a) means the probability that x is less then or equal to a.

DISTRIBUTION will also attempt to fit your data to a probability
distribution, but will draw a graph of the distribution, rather than a
table of probabilities.  The continuous line is the theoretical
distribution, and the solid vertical lines represent the frequencies with
which each data value occured.  For each distribution, the defining
coefficients are also displayed.

Note:  You may not be able to fit your data to ALL of the distributions.
The computer will tell you if it is impossible.  The Normal Distribution
should work for all data, however.

PLOT Y vs X will only work if there are two sets of data.  If you select
this option, a graph will be plotted of y against x.

Before the graph is plotted, you have a choice of two options:  Best Fit
Line enables you to choose whether you want a line of best fit drawn on the
graph.  Lower-Left Origin enables you to decide whether the lower-left
corner of the graph will be the origin(0,0) or the smallest value of data.
`m=' and `c=' give the gradient and y-intercept respectively, of the
best-fit line.

It is also possible to plot a graph of say, Ln Y against X.  To do this,
just choose `Set Y/Ln' from the Functions menu, before plotting.

3. Further Notes
================

3.2 DataAnal_Files Directory
----------------------------

(a) When you opt to load a data file from disk, DataAnal will look for a
directory called `DataAnal_Files/'.  If no such directory exists, DataAnal
will instead look in the current directory.  If you decide to use DataAnal
a lot (!), it would therefore be a good idea to keep all your data-lists in
the `DataAnal_Files/' directory.

(b) By way of an example to show how DataAnal could be used, I have
included a file called `Presidents.DA'.  It is in the `DataAnal_Files'
directory.  This contains the ages of all the Presidents of the United
States when they took office.  The item's notes are the corresponding
Presidents' names.  You should therefore be able to work out the average
age of American presidents, and find out who was the youngest etc.  Sorry I
couldn't think of anything else more interesting to include instead!

3.2 Format of Data Files
------------------------

To make life simple, the data is saved as simple ASCII text files.  These
can be edited with any text editor.  The items must be on separate lines.
Lines that start with letters are ignored.  Example...

 24 'hello1
 hello2
 26 'hello3
 26 'these are notes
 22 'this is another note

DataAnal would read:  24,26,26,22.
The corresponding notes would be`hello1',`hello3',`these are notes', and
`this is another note'.  `Hello2' would be ignored.

Coordinate pairs are read and saved in this format:

 1.2, 2.4 'note1
 1.6, 3.1 'note2
 2,4, 3.7 'note3
 2.8, 4.5 'note4

3.3 Author
----------

DataAnal V5.5 (c) Steve P, 1989-1993

Steven Pugh
10 Wellington Close
Sandhurst Green
Sundorne
Shrewsbury
Shropshire
SY1 4SP

Write to me if you any suggestions for improvements, or if you can think of
any interesting uses for this program.

DataAnal is freely distributable provided this document, and the file
`Presidents.DA' is included in all copies.
