TABTEST <table_of_frequencies>,L
performs various tests for independence etc. by simulation
for a two-dimensional table of frequencies. The table is
given in edit field in the form used by the TAB operations.
The table can be also given in a simpler form without any labels:
TABLE TEST / Example (An empty line indicates the end of the table.)
7 2 0
3 1 5
Different assumptions about the stochastic structure of the table are
determined by a FIX specification with following alternatives:
FIX=Fisher Both row and column margins fixed (exact test)
FIX=RC Both row and column margins fixed
FIX=C Column margins (vertical sums) fixed
FIX=R Row margins (horizontal sums) fixed
FIX=N No fixed margins, only the grand total fixed
FIX=F(i,j) Element of row i and column j fixed
FIX=FIT Goodness of fit test for an n x 2 table
The test statistics used in simulation is selected by a TEST specification:
TEST=X^2 is the common Pearson's chi-square statistics: sum of (O-E)^2/E .
TEST=G^2 is the likelihood statistics: sum of -2*O*log(O/E) .
TEST=PROB is the probability of the simulated table. The unknown
margin probabilities are replaced by simulated relative
frequencies. We call this `Probability statistics'.
In case FIX=Fisher, TEST=PROB is always selected.
In other cases TEST=X^2 is default.
Maximum number of replicates is given by SIMUMAX (default 10000000).
The seed number of the random number generator (either 'rand' or 'urand')
is given by RAND (default RAND=rand(12345). See RAND? .
The process may be interrupted by pressing any key.
The results are displayed after each 100 replicates as a table of the form
N P Confidence interval (level=0.95)
# of replicates Estimate of P lower limit
s.e. Standard error upper limit
The confidence level for P is set by CONF=p (0.8<p<1). Default is CONF=0.95
The two-way table is also saved as a matrix by using the specification
MATRIX=<name_of_a_matrix_file> , say, MATRIX=T .
This matrix can be analyzed further, for example, by the sucro command
/X2
which computes various derived tables as matrices such as the expected
frequencies and decomposition of the X^2 statistics in cells and
margins.
........................................................................
Example:
TABLE T / This 2x2 table is tested with default settings.
7 2
1 4
TABTEST T,CUR+1
G = Goodness of fit test for an n x 2 table
T = More information on TAB operations
S = More information on statistical tests