Mercurial > hg > aim92
comparison man/man1/stats.1 @ 0:5242703e91d3 tip
Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author | tomwalters |
---|---|
date | Fri, 20 May 2011 15:19:45 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:5242703e91d3 |
---|---|
1 .TH STATS 1 "1 September 1993" | |
2 | |
3 .SH NAME | |
4 stats \- calculate some statistics. | |
5 | |
6 .SH SYNTAX | |
7 stats [options] [file] | |
8 | |
9 .SH DESCRIPTION | |
10 Calculate statistics for given frames of each input file and write the | |
11 results on the stdout. | |
12 If no filenames are given, one input file is expected on the stdin. | |
13 Otherwise each given filename is processed in turn. | |
14 | |
15 .SH OPTIONS | |
16 | |
17 1. frame, width, samplerate | |
18 | |
19 The `frame' option selects a sequence of contiguous frames for processing by: | |
20 | |
21 .nf | |
22 frame=a[-b] | |
23 .fi | |
24 | |
25 where `a' and `b' are frame numbers: 1,2,3,...,max The upper limit `b' is | |
26 optional, and when it is missing then the frame sequence is a single | |
27 frame, otherwise `a' and `b' are inclusive limits. The strings "min" | |
28 and "max" are recognised as extreme limits. | |
29 Each frame has size `width' samples which | |
30 may be given with time units (s or ms), in which case the they | |
31 are converted to a number of samples using the given `samplerate' option. | |
32 The special option value "width=max" is interpreted as a single frame covering | |
33 the whole file. | |
34 | |
35 2. type | |
36 | |
37 Datatype for both input and output. Binary types are char, short, int, float, double. | |
38 Ascii input (one number per line) is recognised with "type=ascii". | |
39 | |
40 3. stat | |
41 | |
42 The statistics available to the `stat' option are: | |
43 | |
44 .nf | |
45 n sample (ie. data set) size | |
46 sum area | |
47 ss sum of squares | |
48 mean sum/n | |
49 rms root mean square: square root of ss/n | |
50 variance computed with n-1 degrees of freedom | |
51 stddev standard deviation: square root of variance | |
52 min minimum value | |
53 max maximum value | |
54 absmax maximum absolute value, ie. max( |max|, |min| ) | |
55 range max-min | |
56 .fi | |
57 | |
58 | |
59 The variance is the average squared deviation from the mean value, where the | |
60 average is computed by dividing by n-1 for a data set of n samples. | |
61 The stddev is the square root of this variance. | |
62 The stddev would be equal to the rms value for a data set with zero mean, | |
63 except that the average squared value is computed using ss/n, while the | |
64 average squared deviation from a zero mean value is computed using ss/(n-1). | |
65 | |
66 Statistics may be given in a comma separated list, for example: | |
67 | |
68 .nf | |
69 stats stat=mean,variance,min,max | |
70 .fi | |
71 | |
72 For each frame of each input file this will output the four statistics in the | |
73 data type selected by the `type' option. | |
74 | |
75 4. line | |
76 | |
77 When line=on (or -l) output is forced to be ascii irrespective of the `type' option, | |
78 and for each file argument in turn stats prints the statistics requested, | |
79 in the order they were requested, on one line. | |
80 This makes a table (one line per file), and also helps subsequent operations | |
81 between statistics. For example, the standard error of the mean (the stddev | |
82 divided by the square root of the sample size) can be computed: | |
83 | |
84 .nf | |
85 stats -l stat=stddev,n | awk '{ print $1 / sqrt($2) }' | |
86 .fi | |
87 | |
88 Tables can be formatted using field-width and precision arguments which are | |
89 included as silent options. For example, to format columns with a precision | |
90 of 4 decimal places with each number right-justified in a field-width of | |
91 12 characters: | |
92 | |
93 .nf | |
94 stats -l fieldwidth=12 precision=4 | |
95 .fi | |
96 | |
97 The columns may be left-justified by making the fieldwidth parameter negative. | |
98 Output is truncated to integers by setting the precision parameter 0. | |
99 For example, to print the sample size of each file as an integer without | |
100 setting in a field: | |
101 | |
102 .nf | |
103 stats -l fieldwidth=0 precision=0 stat=n [files] | |
104 .fi | |
105 | |
106 .SH "SEE ALSO" | |
107 .LP | |
108 options | |
109 .SH COPYRIGHT | |
110 .LP | |
111 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995 | |
112 .LP | |
113 Permission to use, copy, modify, and distribute this software without fee | |
114 is hereby granted for research purposes, provided that this copyright | |
115 notice appears in all copies and in all supporting documentation, and that | |
116 the software is not redistributed for any fee (except for a nominal | |
117 shipping charge). Anyone wanting to incorporate all or part of this | |
118 software in a commercial product must obtain a license from the Medical | |
119 Research Council. | |
120 .LP | |
121 The MRC makes no representations about the suitability of this | |
122 software for any purpose. It is provided "as is" without express or | |
123 implied warranty. | |
124 .LP | |
125 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
126 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
127 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES | |
128 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
129 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
130 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
131 SOFTWARE. | |
132 |