Compiling EASISTAT

The file essrc.zip contains the source files and a makefile called
easistat.mak. The archive should be unzipped in a directory where
compilation can be performed. All file names should be lower case and if a
Unix system is used then they should use the Unix end-of-line character,
LF, rather than the MS-DOS one(s), CR-LF. To avoid problems regarding
this, the archive should be unzipped with the -A -l options. 

Essentially, on Unix systems you should be able to build easistat by entering:

make -f easistat.mak

You may need to make a few adjustments to the makefile according to your
operating system - I haven't attempted to be at all comprehensive in
terms of what switches the compiler and/or linker might need.

More likely, you may need to fiddle with the #define's in dcutils.hpp
and dcutils.cxx. These mainly deal with string manipulation functions
which may or not be provided by the standard library, such as strupr().
Hopefully if you get error messages regarding these when you attempt to
build the program you will be able to fix things by modifying these
files.

If you want to build the program using Microsoft Visual C++ then you
should be able to do this using the workspace file easistat.dsw, which
should be present along with the source files in a directory called
\msvc\easistat.

Extending EASISTAT

The code has deliberately written to be readily extensible, so that new
functionality can be incorporated. In particular, it should be
straightforward to add new statistical functions and to add new
expresssions for the parser.

Adding new functions

The code for EASISTAT has been designed so that one can add new functions
just by linking in extra modules without having to modify any other
code. The functions then become available to the user just as readily as
the build-in functions, while the data management and selection
procedures of EASISTAT remain accesssible to the programmer. For a very
simple example of how this can be done, please examine the source file
easisize.cpp. If the makefile is modified to link in this module (by
chainging the definition for EXTRAOBJS) then the function will be added
to the others available to the user. For a more complex and realistic
example, refer to the file easikapp.cpp. If this is linked in then the
EASISTAT program gains the capacity to calculate Cohen's kappa. Any
additional statistical test can be coded and incorporated in this kind
of way. All one needs to do is to define the function and then to
provide an instance of an "extrafunc" which refers to the function and
which provides a name by which it will be accessible to the user.

Extending the expression parser

The parser has also been designed so that new operators can easily be
added. To understand how this should be done, please examine the files
pvexpr.cpp and stexpr.cpp. The former is linked in to provide
functionality to calculate significance values for statistical
functions. The second file, stexpr.cpp, is not linked in to the standard
version of EASISTAT. It provides various string manipulation routines
(and is used in another program, QDB). If it is linked in when EASISTAT
is built then various string operators are recognised by the expression
parser. These are unlikely to be particularly useful for EASISTAT,
especially as all expressions are ultimately evaluated as numerical
values rather than strings. Nevertheless, pvexpr.cpp and stexpr.cpp
provide models for how additional unary and binary operators could be
added to the parser if desired. Care would need to be taken to avoid
name clashes with other operators. Essentially all one needs to do is to
define the relevant functions and to provide an instance of an
initialiser which will add them to the parser's function library. It
should be fairly straightforward to do this by using pvexpr.cpp as an 
example.

Please contact me if you have any problems building EASISTAT, or if you
code any additional functionality which might be of value to other
users. Thank you.

Dave Curtis

December 2002
dcurtis@hgmp.mrc.ac.uk
www.mds.qmul.ac.uk/statgen/dcurtis.html




