Logo
root@/software/cygwinports/stat# cursor
home
software
  sgml
  scientific sw
  cygwin ports
    seqaln
    clustal w
    tacg
    readseq
    un
    sgrep
    |stat
    ploticus
  hacks
  history
photography
about
contact

|stat

A collection of command line tools for statistical analysis.

ruler

Overview

The |stat package consists of about 30 command line tools for the statistical analysis of data. To extract and rearrange the data for the analysis, a variety of data extraction and manipulation tools are provided. This package is not intended to replace heavyweight numbercrunchers like SPSS, but instead it is simple and efficient for datasets up to a few thousand.

The software was written by Greg Perlman. The version used for the CygWin port is dated 1/23/89.

ruler

Modifications

The source code is ANSI C and compiles with gcc with just a few modifications. The problems to deal with were:

  • calc.c which is built from the bison source calc.y needs stdlib.h for a proper definition of atof(). Without this, calc treats whatever you enter as integers.
  • Also in calc.c, gcc does not accept stdout as a constant, so global FILE pointers cannot be assigned the value stdout when they are declared. This has to be done in main() instead.
  • In makefile, the absolute paths to rm, mv, make, echo have to be removed as they are not necessarily valid on a CygWin system.
  • Also in makefile, yacc has to be replaced by bison, and the expected yacc outfiles have to be replaced by bison outfiles.

These changes were necessary in calc.y:

--- ../../stat-orig/src/calc.y	Fri Apr 02 14:31:02 1993
+++ calc.y	Sat Aug 14 21:38:11 1999
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 

+#include 
 #ifdef	macintosh
 #include 
 #define isatty(x) (!ioctl(x, FIOINTERACTIVE, NULL))
@@ -77,7 +78,7 @@
 double	eval (), Answer;
 double	*Constant;
 char	*getline ();
-FILE	*Outfile = stdout;
+FILE    *Outfile;
 %}
 
 %union
@@ -386,6 +387,7 @@
 	{
 	int 	i;
 	signal (SIGINT, SIG_IGN);
+	Outfile = stdout;
 	if (isatty (fileno (stdin)))
 		{
 		Interactive = 1;
    

These changes were necessary in makefile:

--- makefile.orig	Tue Jun 22 18:00:22 1993
+++ makefile	Sat Aug 14 22:32:43 1999
@@ -13,15 +13,16 @@
 #      you may need to compile with the -bsd option added to CFLAGS
 ##########################################################################
 
-DESTDIR=../bin#                               destination directory
-DESTDIR=../../bin#                            destination directory
-CFLAGS =-O#                                   C Compiler Options
+CC     =gcc#                                   use GNU c compiler
+DESTDIR=/usr/local/bin#                               destination directory
+#DESTDIR=../../bin#                            destination directory
+CFLAGS =-O -s#                                   C Compiler Options
 LINK   =$(CC) $(CFLAGS) -o $(DESTDIR)/$@#     Generic link command
 LIBS   =-lm#                                  libraries needed (math)
 EDITOR =/usr/ucb/vi#                          editor to call on make edit
-RM     =/bin/rm -f#                           remove forcefully
-MV     =/bin/mv#                              move/rename files
-MAKE   =/bin/make#                            use for recursive makes
+RM     =rm -f#                           remove forcefully
+MV     =mv#                              move/rename files
+MAKE   =make#                            use for recursive makes
 
 MAINS = abut.c anova.c calc.y colex.c contab.c desc.c dm.y dprime.c \
 	dsort.c features.c ff.c fpack.c linex.c maketrix.c oneway.c \
@@ -43,9 +44,9 @@
 	skipnumber.c specol.c strings.c tmpfile.c z.c
 
 all:
-	@/bin/echo "Making all the |STAT Programs"
-	@/bin/echo "Using compiler=$(CC) with options=$(CFLAGS)"
-	@/bin/echo "Installing in directory=$(DESTDIR)"
+	@echo "Making all the |STAT Programs"
+	@echo "Using compiler=$(CC) with options=$(CFLAGS)"
+	@echo "Installing in directory=$(DESTDIR)"
 	@$(MAKE) -i $(PROGS)
 
 edit:
@@ -73,8 +74,8 @@
 calc: $(CALC)
 	$(LINK) $(CALC) $(LIBS)
 calc.c: calc.y
-	yacc calc.y
-	$(MV) y.tab.c calc.c
+	bison calc.y
+	$(MV) calc.tab.c calc.c
 
 cat:
 	$(LINK) -DCAT filter.c
@@ -103,8 +104,8 @@
 dm.o: dm.c
 	$(CC) $(CFLAGS) -DPTREE -c dm.c
 dm.c: dm.y
-	yacc dm.y
-	$(MV) y.tab.c dm.c
+	bison dm.y
+	$(MV) dm.tab.c dm.c
 
 DPRIME=dprime.o number.o z.o parseline.o getopt.o 
 UNTESTED = "This program has not been rigorously tested"
    

System requirements

I used the following setup to build the software:

  • Windows NT 4.0 SP3 Workstation
  • CygWinB20.1
  • gcc-2.95
  • A working setup of bison. To this end, the environment variable BISONLIB has to point to the /cygwin-b20/share directory so bison can find bison.simple.
  • A directory /usr/local/bin which receives the binaries.

With this setup, make runs smoothly.

You will have to copy the man pages manually into your man1 directory.

ruler

Download information

The original sources can be downloaded here. The sources are under a somewhat stricter license than the GPL. Everybody can obtain them free of charge, but you will have to email the author first. The exact procedure is included in the above mentioned download page.

Also due to this restrictive license there are no precompiled binaries currently. Instead I provide a patchkit for the original sources as cygwinb20-statpatch.tar.gz (2 kb).