home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Explore the World of Soft…e: Engineering & Science
/
Explore_the_World_of_Software_Engineering_and_Science_HRS_Software_1998.iso
/
programs
/
statistc
/
statsak.exe
/
STAT-SAK.DOC
next >
Wrap
Text File
|
1989-03-01
|
25KB
|
571 lines
STAT-SAK
The Statistician's
Swiss Army Knife
Version 2.40
(c) 1985 -- 1988
"One of many STATOOLS(tm)..."
by
Gerard E. Dallal
53 Beltran Street
Malden, MA 02148
STAT-SAK is the STATistician's Swiss Army Knife: While not
the custom tool for any particular job, it carries out a wide
variety of miscellaneous tasks that are not easily performed
by most large statistical packages.
NOTICE
Documentation and original code copyright 1985-1988 by Gerard
E. Dallal. Reproduction of material for non-commercial
purposes is permitted, without charge, provided that suitable
reference is made to STAT-SAK and its author.
Neither STAT-SAK nor its documentation should be modified in
any way without permission from the author, except for those
changes that are essential to move STAT-SAK to another
computer.
DISCLAIMER
STATOOLS(tm) are provided "as is" without warranty of any
kind. The entire risk as to the quality, performance, and
fitness for intended purpose is with you. You assume
responsibility for the selection of the program and for the
use of results obtained from that program.
PAGE 2
INSTALLATION
STAT-SAK was written for the IBM-PC but few changes should be
needed to install it on another computer. The first DATA
statement initializes the variables
IIN -- input unit number (screen)
IOUT -- output unit number (screen)
DESCRIPTION
STAT-SAK is a tool for anyone who regularly analyzes data.
It was written under the assumption that users would have
access to a "comprehensive" micro or mainframe statistical
package such as SAS, SPSS-X, BMDP, or SYSTAT. STAT-SAK does
not perform calculations that require access to the original
observations.
STAT-SAK performs the following calculations and analyses:
1. Distributions:
a. Normal distribution
quantile to probability: upper-tail
lower-tail
two-tailed
probability to quantile
[Whenever a quantile of zero is specified,
STAT-SAK prompts for three quantities A,B,C and
then evaluates A/(B/SQRT(C)).]
b. t distribution: quantile to probability
probability to quantile
c. chi-square distribution: quantile to probability
probability to quantile
d. F distribution: quantile to probability
probability to quantile
e. Binomial: Prob (binomial(n,p) <=,=,>= k)
f. Poisson: Prob (Poisson(mean) <=,=,>= quantile)
g. Studentized range: probability to quantile
2. Tests of independence/homogeneity of proportions in two
dimensional contingency tables: Pearson chi-square
statistic, with Yates's continuity correction in the
case of a 2 by 2 table.
STAT-SAK G.E. Dallal
PAGE 3
3. Exact confidence intervals for binomial p's. The
confidence interval is (theta1, theta2), where
Prob(X>=# of successes|theta1) = (1-c)/2 ,
Prob(X<=# of successes|theta2) = (1-c)/2 ,
and c is the level of confidence.
4. Fisher's exact test for 2 by 2 contingency tables.
5. Mantel-Haenszel test, approximate 95-% confidence
interval for common odds ratio using equation 10.22 of
Fleiss (1981).
6. McNemar's test: An exact test using the binomial(n,0.5)
distribution.
7. Correlation coefficients:
a. Test that a population correlation coefficient is
zero.
b. Construct confidence interval for a single
correlation coefficient using a FORTRAN
translation of the BASIC program of Maindonald
(1984, p.300) based on an approximation of
Winterbottom (1980).
c. Compare two independent correlation coefficients
using Fisher's z transformation.
d. Compare two dependent correlation coefficients,
that is, two correlation coefficients from the
same correlation matrix (measured on the same
individuals). The statistics are Z1*-tilde and
Z2*-tilde, equations (14) and (15) from Steiger
(1980). The information needed to perform this
analysis must be stored in a space or comma
delimited ASCII file. (The program will prompt
the user for the file's name.) The first record
contains the sample size. Subsequent records
contain the correlation matrix in lower
triangular form. (The second record contains the
element r(2,1).) The program will work properly
if the file contains the square correlation
matrix, provided the first row is replaced by a
record starting with the sample size.
8. Bartholomew's test for increasing proportions: Exact
P-values are given for 3 or 4 proportions. For 5 or
more proportions, STAT-SAK gives the P-value
appropriate for equal column totals. This value is
NOT conservative for all tables. See Bartholomew
STAT-SAK G.E. Dallal
PAGE 4
(1959a,b).
Since Bartholomew's test is a pool-adjacent-violators
procedure, it can yield "significant" results even
when the data show no real trend. In the table
85 15 85
15 85 15
the first row proportion decreases from column 1 to
column 2; Bartholomew's test fits the proportion
100 (=85 + 15) / 200 (=100 + 100) to these columns.
The first row proportion then increases significantly
as we move to column 3 and the test statistic is
significant overall. In order to alert users to such
potential pitfalls, STAT-SAK reports the Pearson
goodness-of-fit statistic for homogeneity of
proportions along with the difference between the
Pearson statistic and the Bartholomew statistic.
Although the reference distribution of the difference
is not known, large values are indicative of model
failure. A conservative test can be had using the
central chi-square distribution with degrees of
freedom equal to the number columns minus 1.
9. Bartholomew's test for increasing normal means: Exact
P-values are given for 3 or 4 means. For 5 or more,
STAT-SAK gives the P-value based on equal column
totals. This value is NOT conservative in all cases.
The test for increasing means poses the same problem
as does the test for proportions: the data can be
significant relative to the null hypothesis of no
change even if the monotonicity is seriously violated.
Lack-of-fit is assesses by partitioning sums of
squares as in a standard analysis of variance. Exact
tests for lack of fit are unavailable, however, since
the F-ratios constructed in this manner do not follow
central F distributions under their respective null
hypotheses. We must be content with bounds on the
P-value.
Let BSS and WMS be the between group sum of squares
and within group mean square calculated when
performing a standard one-way analysis of variance.
Let OBSS be the between group sum of squares
STAT-SAK G.E. Dallal
PAGE 5
calculated under order restriction. Let 'k' be the
number of samples and N be the total number of
observations. Since
(BSS-OBSS)/(k-1) / WMS < = [1]
(BSS/(k-1)) / WMS [2]
it follows that an upper bound to the P-value can be
had by comparing [1] to the percentiles of the F
distribution with k-1 numerator degrees of freedom and
N-k denominator degrees of freedom.
A lower bound to the P-value is obtained by assigning
the difference BSS-OBSS to a single degree of freedom,
but it must be noted that in the case of two groups
with equal means, BSS-OBSS equals BSS with probability
1/2 and 0 with probability 1/2. Hence, for k
populations not all of whose means are monotonically
nondecreasing, the probability that (BSS-OBSS)/WMS
exceeds some particular value is no less than HALF
that given by the F distribution with 1 numerator
degree of freedom and N-k denominator degrees of
freedom.
The summary statistics may be read from an external
file, one record per sample, each record containing a
sample's mean, SD or SE, and count separated by one or
more spaces. (FORTRAN's list directed input is used to
read the values.)
10. One sample t test from summary statistics.
11. Two sample t test from summary statistics: includes
pooled standard deviation, F-ratio for testing
equality of variances, and t tests based on both equal
and unequal (using Satterthwaite's approximation)
variances. (By entering dummy sample means, this
routine can be used to obtain pooled standard
deviations from individual standard deviations or
standard errors.)
STAT-SAK G.E. Dallal
PAGE 6
FOR THE FREQUENT USER
At the prompts "Enter 'Q' to quit, press <Enter> to continue"
and "Enter 'R' to return to main menu, press <Enter> to
continue", any valid STAT-SAK command may be entered, thereby
bypassing the display of the menu.
ALGORITHMS
STAT-SAK makes use of the following published routines:
Best, D.J. and D.E. Roberts (1975). Algorithm AS 91. The
percentage points of the chi-squared distribution. Appl.
Statist.,24,385-388.
Bhattacharjee, G.P. (1970). Algorithm AS 32. The incomplete
gamma integral. Appl. Statist.,19,285-287.
Cran, G.W., K.J. Martin and G.E. Thomas (1977). Remark
AS R19 and Algorithm AS 109. A remark on algorithms AS
63: The incomplete beta integral, and AS 64: Inverse of
the incomplete beta function ratio. Appl.
Statist.,26,111-114.
Hill, I.D. (1973). Algorithm AS 66. The normal integral.
Appl. Statist.,22,424-427.
Lund, R.E. and J.R. Lund (1983). Algorithm AS 190.
Probabilities and Upper Quantiles for the Studentized
Range. Appl. Statist.,32,204-210. (correction: Appl.
Statist.,34(1985),104)
Majumder, K.L. and G.P. Bhattacharjee (1973). Algorithm
AS 63. The incomplete beta integral. Appl.
Statist.,22,409-411.
Odeh, R.E. and J.O. Evans (1974). Algorithm AS 70. The
percentage points of the normal distribution. Appl.
Statist.,23,96-97.
and the author's FORTRAN translation of
Pike, M.C. and I.D. Hill (1966). Algorithm 291. Logarithm
of the gamma function. Commun. Ass. Comput. Mach.,9,684.
STAT-SAK G.E. Dallal
PAGE 7
REFERENCES
Bartholomew, D.J. (1959a). A test of homogeneity for ordered
alternatives. Biometrika,46,36-48.
---------------- (1959b). A test of homogeneity for ordered
alternatives. II. Biometrika,46,328-335.
Fleiss, Joseph L. (1981). Statistical Methods for Rates and
Proportions, 2-nd ed. New York: John Wiley & Sons, Inc.
Maindonald, J.H. (1984). Statistical Computation. New York:
John Wiley & Sons, Inc.
Steiger, James H. (1980). Tests for comparing elements of a
correlation matrix. Psychological Bulletin,87,245-261.
Winterbottom, Alan (1980). Estimation of the bivariate
normal correlation coefficient using asymptotic
expansions. Comm. in Statist. Simulation and Computation,
B9, 599-609.
STAT-SAK G.E. Dallal
STATOOLS(tm)
STATOOLS(tm) are stand-alone programs designed to fill in
some of the gaps left by major statistical packages.
The following programs are available as a set of three
disks for the IBM PC and compatibles running DOS 2.0 or later
versions. The disks contain FORTRAN source code, executable
files, and user's guides. They may be obtained by sending a
check in the amount of $15 to
Gerard E. Dallal
53 Beltran Street
Malden, MA 02148
STAT-SAK is the STATistician's Swiss Army Knife. While not
the custom tool for any particular job, it carries out a wide
variety of miscellaneous tasks that are not easily performed
by most large statistical packages. These include probability
distributions (normal, t, chi-square, F, binomial, Poisson,
studentized range); exact confidence intervals for binomial
p's; Fisher's exact test for 2 by 2 tables; Mantel-Haenszel
test and approximate 95% confidence interval for the common
odds ratio; Bartholomew's test for increasing proportions;
Bartholomew's test for increasing normal means; one and two
sample t-tests from summary statistics; correlation
coefficients: test that a population value is 0, confidence
interval for a single coefficient, test of equality of two
independent coefficients, test of equality of two dependent
coefficients (coefficients from the same correlation matrix).
PC-SIZE determines the sample size requirements for single
factor experiments, two factor experiments, randomized blocks
designs, paired t-tests, and comparison of proportions. It
can calculate the power of specific sample sizes as well as
determine the sample size needed to achieve specific power.
PC-PLAN generates randomization plans.
PC-EMS produces tables of expected mean squares for balanced
experiments by using the Cornfield-Tukey algorithm.
PC-PITMAN calculates observed significance levels by using
recursive relationships to obtain the randomization
(permutation) distribution of a number of statistics without
directly examining all possible permutations of the data. It
performs one and two sample randomization tests and rank tests
in the presence of an arbitrary number of ties in the data.
PC-MULTI performs multiple comparisons by using Tukey's
honestly significant differences (studentized range
statistic).
FORGET-IT produces Forget-it Plots (also known as Two-way
Plots), a graphical device for displaying the interaction
structure of a two-way table.
STRUCTR fits structural relations when the ratio of error
variances is known.
PC-AIP fits additive-in-the-probits models to two-dimensional
contingency tables with ordered column classifications.
--------------------------------------------------------------
Other programs:
OCTA (One man's Contingency Table Analysis): Interactive log-
linear analysis of multi-dimensional contingency tables by use
of the Deming-Stephan iterative proportional fitting
procedure. Quasi-independence models; Brown's tests of
partial and multiple association. Tables of up to 1000 cells
containing no more than 7 dimensions and 20 categories per
dimension. ($10)
WUBA-WUBA: Converts space or comma delimited ASCII files of
numerical data to MYSTAT/SYSTAT files. ($5 OR formatted 5-1/4"
floppy diskette in a self-addressed stamped mailer.
Accompanies any program that analyzes data in MYSTAT/SYSTAT
files at no additional charge.)
GENERIC: Set of FORTRAN source code that can be used as a
template for writing MYSTAT/SYSTAT supplements. ($5 OR
formatted 5-1/4" floppy diskette in a self-addressed stamped
mailer)
RCJOIN: identifies sources of interaction in two-way tables of
counts (Computers and Biomedical Research, 21(1988), 129-136)
($5 OR formatted 5-1/4" floppy diskette in a self-addressed
stamped mailer)
FMT: FORTRAN FORMAT Statement Generator. Use your word
processor to create a text file looking like the output you
want from your FORTRAN program. FMT turns the text into
FORTRAN FORMAT statements. ($5 for a disk containing FMT; $12
shareware registration)
The following programs work with MYSTAT/SYSTAT system files.
They can be used independently of MYSTAT and SYSTAT by using
WUBA-WUBA (described above) to convert ASCII data files to
MYSTAT/SYSTAT system files.
LOGISTIC: Logistic regression. Maximum likelihood estimates
of the regression coefficients are obtained by use of a
Newton-Raphson iterative procedure. Interactions may be
specified in the model. The model may contain up to 20 terms.
($10)
cLOGISTIC: Conditional logistic regression for stratified
case-control data. Up to 500 strata with no more than 10
cases plus controls per stratum. The product of the number of
subjects and the number of variables must be no greater than
6000. ($5 OR formatted 5-1/4" floppy diskette in a self-
addressed stamped mailer. Also, accompanies LOGISTIC at no
additional charge.)
PITMAN: A version of PC-PITMAN (described above) that works
with MYSTAT/SYSTAT files. ($5 OR formatted 5-1/4" floppy
diskette in a self-addressed stamped mailer)
TRACK: Foulkes-Davis tracking index, the probability that two
individuals chosen at random will have measurement curves over
time that do not cross. (Foulkes and Davis. Biometrics,
37(1981), 439-446) Fits linear, quadratic, or cubic
polynomials to each individual's data and judges the adequacy
of the fit. Produces a command file that allows SYGRAPH
(Systat, Inc.) to draw the measurements curves. ($5 OR
formatted 5-1/4" floppy diskette in a self-addressed stamped
mailer)
MUDIFT: Multivariate distribution-free comparison of growth
curves. (Guo S, Simon R, Talmadge JE, Klabansky RL. Computers
and Biomedical Research, 20(1987), 37-48.) MUDIFT was written
with Shumei Guo, R. Simon, J.E. Talmadge, and R.L. Klabansky.
($5 OR formatted 5-1/4" floppy diskette in a self-addressed
stamped mailer)
ODDJOB: MIscellaneous statistical procedures including, tests
of normality (Lilliefors and Wilk-Shapiro), test of
unimodality, isotone regression, two-phase regression,
structural relations (a MYSTAT/SYSTAT version of STRUCTR,
above) and a low resolution locally weighted scatterplot
smoother (LOWESS). ($5 OR formatted 5-1/4" floppy diskette in
a self-addressed stamped mailer) (Available March 29, 1989)
BUMP: Dose-response curves in the presence of a downturn.
(Simpson and Margolin, Biometrika, 73(1986), 589-596). BUMP
was written with Douglas G. Simpson and is available only from
him at Department of Statistics, University of Illinois at
Urbana-Champaign, 101 Illini Hall, 725 South Wright Street,
Champaign, IL 61820. ($5 OR formatted 5-1/4" floppy diskette
in a self-addressed stamped mailer)
A word about MYSTAT...
MYSTAT is a full-featured subset of the statistics package
SYSTAT by Systat, Inc. MYSTAT can analyze up to 32000 cases
and 50 variables. It contains a full-screen editor which can
import ASCII files and, through an extensive transformation
facility, create new variables and modify existing variables.
MYSTAT's statistical capabilities include summary statistics,
scatterplots, histograms, stem-and-leaf displays, t tests,
correlation coefficients, regression analysis, balanced and
unbalanced multi-way analysis of variance, and the analysis of
two dimensional tables of counts. MYSTAT will soon be
packaged with number of introductory statistics textbooks.
Anyone may obtain a free copy of MYSTAT by sending a written
request to Systat, Inc., 1800 Sherman Avenue, Evanston, IL
60201. (Reference: Wilkinson, L. (1987), "MYSTAT: A Personal
Version of SYSTAT," The American Statistician, 41, 334.) I am
unable to provide copies of MYSTAT.