Table of Contents

Name

table - print anova means in readable tables (ERP statistics)

Synopsis

table [-nde] [-f fw.pr] formatfile < ranova_output

Description

table allows a user to format the descriptive statistics produced by ranova(1) as a readable table, with meaningful labels, as specified in formatfile. The input data, read from the standard input, must be in exactly the same format as the output of ranova(1) ; in particular, the table of means must be present, and must be labelled with the string "TABLE OF MEANS". By default, table prints only the cell means, but the sample sizes, standard deviations, and standard errors can also be specified. The data will be printed in a balanced factorial matrix, with no missing cells. However, the user can arbitrarily decide on the number of dimensions, what the dimensions represent, and which means belong in which dimensions. There are two basic dimensions, horizontal and vertical. These will usually correspond to the two most important dimensions of a factorial design. These dimensions can each be broken up into as many as 20 sub-dimensions, each with up to 20 levels. The user specifies which data from the input file will correspond to a cell of the output file by use of the indices which are printed by ranova(1) .

Options

The following options can either be specified on the command line, or in formatfile using the print keyword (see FORMAT FILE below)

-n
Print sample sizes for each

mean

-d
Print standard deviation for each mean

-e
Print standard error for

each mean

-f fw.pr
Use fw for field width and pr for precision for the printed means, so that each number is fw characters wide (including the decimal point) and there are pr characters following the decimal point. This option is helpful when trying to fit more data on a page.

Format File

The formatfile uses keywords to provide a general description of the data and to specify exactly where the data should be printed in the output. The keywords, described below, can appear in any order in the file. Those marked (optional) need not be specified.

print [n] [d] [e] [f fw.pr]
(optional) Print sample sizes, standard deviation, standard error, in fw.pr format. These are identical to the command line options (see OPTIONS) and can be specified here in the format file for convenience. For example,

print n d e f 12.2

means that in addition to the mean, the output will include standard error of mean, standard deviation, and sample size. Moreover, the format for printing the data is up to 12 places with two digits after the decimal. If the format were 8.5, this would indicate printing up to 8 places with 5 digits after the decimal.

title "title"
(optional) The title can be up to 255 characters long and must be enclosed in double quotes. For example,

title "Interaction between Brightness and Shape"

If the title is longer than a line, the fact that there is continuation line is to be indicated by placing a backslash character (\) at the end of the line.

horizontal ncols [ncols] ...
vertical nrows [nrows] ...
The user specifies the number of factors and the number of levels in each factor for both the horizontal and vertical dimensions. The horizontal factors are specified by the keyword horizontal followed by one or more numbers on the same line, each of which specifies the number of levels of a particular factor. The slowest changing factor is specified first, and the fastest changing factor is specified last. This is followed by several lines, each of which contains labels for the levels of one factor, again beginning with the slowest changing factor. The same thing is done for the vertical dimension, except that the keyword vertical is used.

For example, let’s imagine that we have an ERP experiment with visual stimuli which were either squares or circles, and that the stimuli could be bright or dim. Let’s also suppose that 3 electrode sites were used, Fz, Cz, and Pz. This is a 2 X 2 X 3 design. In this example, our intended output will look like this:

Bright Bright Dim Dim
Square Circle Square Circle

Fz 23.34 20.34 32.34 33.32

Cz 20.03 22.27 28.98 26.33

Pz 19.98 18.80 22.66 23.34

We have two factors, brightness and shape, on the horizontal dimension,

and we would specify

horizontal 2 2
Bright Dim
Square Circle

in the format file. We only have one vertical dimension, and would specify

vertical 3
Fz Cz Pz

in the format file. Note that the labels cannot contain spaces, tabs, etc., unless the label is enclosed within double quotes ("").

indices nfactors
The number of indices in the anova output is specified with the keyword indices followed by a number specifying the number of factors in the design (same as number of columns in the TABLE OF MEANS in the ranova output). In our example, there are probably 3 factors in the anova design, which

would be specified in the format file as

indices 3

format
After these general specifications have been taken care of, the data must be specified. This is accomplished by the keyword format on a line by itself, followed by a table containing the indices. For our example, this might look something like:

format
0 0 0 0 0 1 0 1 0 0 1 1
1 0 0 1 0 1 1 1 0 1 1 1
2 0 0 2 0 1 2 1 0 2 1 1

Any white space (spaces, tabs, etc.) can be used to separate the indices, although the following would result in exactly the same output:

format
0 0 0 0 0 1 0 1 0 0 1 1
1 0 0 1 0 1 1 1 0 1 1 1
2 0 0 2 0 1 2 1 0 2 1 1

Example 1

The invocation using our examples would be:

table formatfile < ranova.out

where the entire formatfile looks like:

print f 12.2
title "Interaction between Brightness and Shape"
horizontal 2 2
Bright Dim
Square Circle
vertical 3
Fz Cz Pz
indices 3
format
0 0 0 0 0 1 0 1 0 0 1 1
1 0 0 1 0 1 1 1 0 1 1 1
2 0 0 2 0 1 2 1 0 2 1 1

Blank lines can be placed between statements in the format file, but not within statements. For example, a blank line can separate the last line of horizontal level names from the vertical statement, but there cannot be a blank line between the line that says ’vertical 3’ and the specification of the vertical level names. table will ignore any lines in the format file that begin with c or C to allow for comments.

One important limit on the performance of this program is that a particular mean can only appear once in a given table. If the same indices appear twice, table will be unable to find the cell the second time and will think that that cell was not listed in the anova output.

Example 2

Consider the following ranova output (only the first 60 lines are shown):


>c: data(erp) first exp
>c: factor A name draw new 
>c: factor B levels -1, -2 
>c: factor C all electrodes 
>c: factor S 15ss
>f: 4 3 2 19 15
>s: 15
>m: mixed (AxBxCxS)
>o: means 15
>o: epsilon
>
>
>                DESIGN SUMMARY
>
>Factor A         3 Levels       Within Subjects
>Factor B         2 Levels       Within Subjects
>Factor C        19 Levels       Within Subjects
>N = 15
>
>
>                TABLE OF MEANS
>
>  A  B  C  S          MEAN       SD         SEM           N
>-----------------------------------------------------------------
>  1  1  0  1         -1.0989     1.1271     0.2586       19
>  1  1  0  2         -0.5505     1.1829     0.2714       19
>  1  1  0  3          1.5579     3.7827     0.8678       19
>  1  1  0  4         -0.6711     2.7883     0.6397       19
>  1  1  0  5         -0.3879     2.1779     0.4996       19
>  1  1  0  6          0.5895     2.4386     0.5594       19
>  1  1  0  7          2.0068     2.7958     0.6414       19
>  1  1  0  8          0.7432     1.5680     0.3597       19
>  1  1  0  9          2.0763     2.2387     0.5136       19
>  1  1  0 10         -2.0079     3.3368     0.7655       19
>  1  1  0 11         -2.5437     2.8444     0.6526       19
>  1  1  0 12          5.1626     4.0054     0.9189       19
>  1  1  0 13          1.8111     1.9791     0.4540       19
>  1  1  0 14         -5.6737     2.2085     0.5067       19
>  1  1  0 15          0.3989     2.0023     0.4594       19
>  1  2  0  1         -1.0916     0.9735     0.2233       19
>  1  2  0  2         -1.7232     1.2712     0.2916       19
>  1  2  0  3         -0.4684     3.5140     0.8062       19
>  1  2  0  4         -0.1432     3.0738     0.7052       19
>  1  2  0  5         -1.4963     2.0521     0.4708       19
>  1  2  0  6          2.2274     2.1329     0.4893       19
>  1  2  0  7          3.9705     5.8361     1.3389       19
>  1  2  0  8         -1.6195     1.8388     0.4218       19
>  1  2  0  9          0.4274     1.6468     0.3778       19
>  1  2  0 10          3.0958     4.1542     0.9530       19
>  1  2  0 11         -2.0858     2.5610     0.5875       19
>  1  2  0 12          2.7405     3.0492     0.6995       19
>  1  2  0 13          2.2321     2.1405     0.4911       19
>  1  2  0 14         -3.8284     1.4977     0.3436       19
>  1  2  0 15          2.4905     2.3082     0.5295       19
>  2  1  0  1         -0.3347     0.9154     0.2100       19
>  2  1  0  2         -1.4632     1.6379     0.3758       19
>  2  1  0  3          1.0768     2.6879     0.6166       19
>  2  1  0  4         -0.8832     2.8730     0.6591       19
>  2  1  0  5         -0.2553     2.0890     0.4792       19
>  2  1  0  6          1.1542     2.2885     0.5250       19

When the following format file is applied to the above ranova output:


>print n e d f 10.1
>
>title  "Interaction between Factor A and Factor B"
>
>horizontal  3
>A1 A2 A3
>
>vertical 2
>B1 B2
>
>indices 4
>
>format
>1 1 1 0    2 1 1 0    3 1 1 0
>1 2 1 0    2 2 1 0    3 2 1 0

the following output is generated:


>    Interaction between Factor A and Factor B
>
>
>            A1        A2        A3
>
>  B1      -1.0      -1.5       0.5
>            15        15        15
>           4.0       3.8       3.0
>           1.0       1.0       0.8
>
>  B2      -0.6      -1.4       0.0
>            15        15        15
>           4.3       5.0       3.8
>           1.1       1.3       1.0

Example 3

When the following format file is applied to EXAMPLE 2’s ranova output:


>Horizontal 3
>name draw new
>
>Vertical 19 
>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
>
>Indices 4
>
>Format
>1 0 1 0     2 0 1 0    3 0 1 0
>1 0 2 0     2 0 2 0    3 0 2 0
>1 0 3 0     2 0 3 0    3 0 3 0
>1 0 4 0     2 0 4 0    3 0 4 0
>1 0 5 0     2 0 5 0    3 0 5 0
>1 0 6 0     2 0 6 0    3 0 6 0
>1 0 7 0     2 0 7 0    3 0 7 0
>1 0 8 0     2 0 8 0    3 0 8 0
>1 0 9 0     2 0 9 0    3 0 9 0
>1 0 10 0    2 0 10 0   3 0 10 0
>1 0 11 0    2 0 11 0   3 0 11 0
>1 0 12 0    2 0 12 0   3 0 12 0
>1 0 13 0    2 0 13 0   3 0 13 0
>1 0 14 0    2 0 14 0   3 0 14 0
>1 0 15 0    2 0 15 0   3 0 15 0
>1 0 16 0    2 0 16 0   3 0 16 0
>1 0 17 0    2 0 17 0   3 0 17 0
>1 0 18 0    2 0 18 0   3 0 18 0
>1 0 19 0    2 0 19 0   3 0 19 0

the following output is generated:


>            name        draw         new
>
>   1     -0.7657     -1.4427      0.2783
>
>   2      0.9287      0.6557      2.0187
>
>   3      1.4503      1.0540      1.7813
>
>   4      2.5230      1.5573      2.9270
>
>   5      2.4657      1.9487      3.2553
>
>   6      1.2563      0.7317      1.9677
>
>   7      1.3477      1.5473      2.4537
>
>   8      0.3113     -0.4100      1.1037
>
>   9     -0.3243     -0.6133      0.7973
>
>  10      0.5280      0.3680      1.5563
>
>  11      1.0997      1.0477      1.5020
>
>  12      1.0710      0.3260      2.0407
>
>  13      0.4590      0.0250      1.1920
>
>  14     -1.8183     -2.2197     -1.8137
>
>  15     -1.8653     -2.1290     -2.1827
>
>  16     -0.3100     -0.6870      0.2683
>
>  17     -0.5257     -0.6567     -0.4880
>
>  18     -1.8713     -2.3110     -2.1953
>
>  19     -2.0710     -2.1837     -2.5277

Example 4

When the following format file is applied to EXAMPLE 2’s ranova output:


>Horizontal 3 2
>name draw new
>-1 -2
>
>Vertical 19 
>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
>
>Indices 4
>
>Format
>1 1 1 0     1 2 1 0     2 1 1 0    2 2 1 0    3 1 1 0     3 2 1 0
>1 1 2 0     1 2 2 0     2 1 2 0    2 2 2 0    3 1 2 0     3 2 2 0
>1 1 3 0     1 2 3 0     2 1 3 0    2 2 3 0    3 1 3 0     3 2 3 0
>1 1 4 0     1 2 4 0     2 1 4 0    2 2 4 0    3 1 4 0     3 2 4 0
>1 1 5 0     1 2 5 0     2 1 5 0    2 2 5 0    3 1 5 0     3 2 5 0
>1 1 6 0     1 2 6 0     2 1 6 0    2 2 6 0    3 1 6 0     3 2 6 0
>1 1 7 0     1 2 7 0     2 1 7 0    2 2 7 0    3 1 7 0     3 2 7 0
>1 1 8 0     1 2 8 0     2 1 8 0    2 2 8 0    3 1 8 0     3 2 8 0
>1 1 9 0     1 2 9 0     2 1 9 0    2 2 9 0    3 1 9 0     3 2 9 0
>1 1 10 0    1 2 10 0    2 1 10 0   2 2 10 0   3 1 10 0    3 2 10 0
>1 1 11 0    1 2 11 0    2 1 11 0   2 2 11 0   3 1 11 0    3 2 11 0
>1 1 12 0    1 2 12 0    2 1 12 0   2 2 12 0   3 1 12 0    3 2 12 0
>1 1 13 0    1 2 13 0    2 1 13 0   2 2 13 0   3 1 13 0    3 2 13 0
>1 1 14 0    1 2 14 0    2 1 14 0   2 2 14 0   3 1 14 0    3 2 14 0
>1 1 15 0    1 2 15 0    2 1 15 0   2 2 15 0   3 1 15 0    3 2 15 0
>1 1 16 0    1 2 16 0    2 1 16 0   2 2 16 0   3 1 16 0    3 2 16 0
>1 1 17 0    1 2 17 0    2 1 17 0   2 2 17 0   3 1 17 0    3 2 17 0
>1 1 18 0    1 2 18 0    2 1 18 0   2 2 18 0   3 1 18 0    3 2 18 0
>1 1 19 0    1 2 19 0    2 1 19 0   2 2 19 0   3 1 19 0    3 2 19 0

the following output is generated:


>          name       name       draw       draw        new        new
>            -1         -2         -1         -2         -1         -2
>
>   1   -0.9540    -0.5773    -1.4787    -1.4067     0.5187     0.0380
>
>   2    0.9280     0.9293     1.0447     0.2667     2.0447     1.9927
>
>   3    0.9867     1.9140     1.0573     1.0507     1.8780     1.6847
>
>   4    2.2260     2.8200     1.3713     1.7433     3.2787     2.5753
>
>   5    2.2860     2.6453     1.6840     2.2133     3.7980     2.7127
>
>   6    1.5660     0.9467     0.9620     0.5013     2.2760     1.6593
>
>   7    1.4480     1.2473     1.0407     2.0540     2.9253     1.9820
>
>   8    0.1867     0.4360    -0.3047    -0.5153     1.3067     0.9007
>
>   9   -0.4667    -0.1820    -0.8007    -0.4260     1.1467     0.4480
>
>  10    0.6320     0.4240     0.3380     0.3980     1.7907     1.3220
>
>  11    0.9527     1.2467     0.7907     1.3047     1.7127     1.2913
>
>  12    1.0687     1.0733     0.7040    -0.0520     2.3893     1.6920
>
>  13    0.1620     0.7560    -0.0620     0.1120     1.5433     0.8407
>
>  14   -1.9860    -1.6507    -2.0113    -2.4280    -1.9853    -1.6420
>
>  15   -2.1187    -1.6120    -2.2413    -2.0167    -2.3807    -1.9847
>
>  16   -0.3487    -0.2713    -0.3047    -1.0693     0.6093    -0.0727
>
>  17   -0.6907    -0.3607    -0.4747    -0.8387    -0.3360    -0.6400
>
>  18   -2.0913    -1.6513    -1.9540    -2.6680    -2.2720    -2.1187
>
>  19   -1.9973    -2.1447    -2.0447    -2.3227    -2.5853    -2.4700

See Also

ranova(1)

Diagnostics

Complains if the input data are formatted incorrectly or if cells specified by the format file do not exists in the input data.

Author

Steve Luck

Bugs

Doesn’t work if a mean is specified twice.


Table of Contents