freq2.pl -- Frequency Counts with Percentages


freq2.pl is a simple extension of freq.pl which provides frequency counts, frequency as a percentage of total count, plus cumulative frequency, and cumulative percentage.

Usage

The command line is: freq2.pl [-h] [-c[#-#][#] [-n] filename] where: -c#-# indicates starting & ending column numbers of the variable, -c# indicates a single-column variable at column #, and -n selects a numeric sort of the output instead of the default character sort.

As an example, the command freq2.pl -c210 data.file might produce output like:

(pts/1):~> freq2.pl -c210 data.file

   Page  1
   Frequencies for the values in columns 210-210
   in the file "data.file"

                                 Value  Cumulative  Cumulative
            Value   Frequency  Percent   Frequency     Percent
           -------  ---------  -------  ----------  ----------
                0       2214    11.37        2214       11.37
                1       1009     5.18        3223       16.55
                2        533     2.74        3756       19.28
                9      15721    80.72       19477      100.00

Back to Kent's Perl Page