• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
        • Freq Statement (Named)
        • Frequency Formatting Options
        • Freq.tally Function
        • Freq.clear Function
        • Freq.save Function
        • Freq.view Function
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Frequency Formatting Options

Frequency formatting options can be specified:
  • When using the unnamed frequency command.
  • When declaring a named frequency.
  • When calling the Freq.save function.
  • When calling the Freq.view function.
Any options specified as part of a call to Freq.save or Freq.view will override options specified when declaring the named frequency.
The formatting options include the following commands: valueset, distinct, vset, heading, stat, percentiles, nofreq, decimals, sort, nonetpercents, and pagelength.
Value Set Specification
valueset(value_set_name1ʃ, ..., value_set_nameNʅ)
When creating the frequency table, CSPro tries to find a label to associate with each value in the table. By default, an item's primary value set is used for unnamed frequencies and the current value set is used for named frequencies. To instead specify a specific value set to use to lookup the labels, use the valueset command and supply one or more value set names. The names of the value sets must match the items that are part of the frequency.
distinct
When using the valueset command, the frequency table is generated showing only the labels of values. If you would like to see the values in addition to the labels, you can use the distinct command, which will result in each value corresponding to a row in the frequency table. Without this option, a value set range such as 0 - 4 would have resulted in all values between 0 and 4 being displayed in the row with the label "0 - 4." With this option, the table would have up to five rows ("0 | 0 - 4," "1 | 0 - 4," and so on).
vset
The vset command typically results in multiple frequency tables being created for each item and is generally used instead of the valueset or distinct commands. When used, a frequency table is generated using the primary value set with the distinct setting and then frequency tables are generated using each of an item's value sets with the not distinct setting (unless distinct was explicitly specified). For example, if an item has three value sets, four tables would be generated (value set 1 distinct, value set 1 not distinct, value set 2 not distinct, value set 3 not distinct).
Specifying a Heading
heading(heading_text1ʃ, ..., heading_textNʅ)
The command heading results in the string expressions heading_text1 to heading_textN being displayed as a heading to the frequency tables. These headings are only used in HTML and text frequencies.
Generating Statistics and Percentiles
stat
The command stat indicates that statistics will be displayed along with the frequency table. These statistics include a count of how many unique values are part of the frequencies table. If running a numeric frequency, the statistics include values such as the minimum and maximum values, the mean, the standard deviation and variance, the mode, and the median and interpolated median.
percentiles(number_percentiles)
The percentiles command means that percentiles will be displayed along with the frequency table. The numeric constant number_percentiles must be a value between 2 and 20. For example, 4 will show quartiles and 10 will show deciles.
nofreq
The command nofreq, when used with stat, indicates that the frequency table should not be shown. With this combination, only the statistics (and/or percentiles) are shown. This option is only used in HTML and text frequencies.
Formatting Options
decimals(number_decimals)
The decimals command means that the frequency values will be displayed with the specific number of digits after the decimal mark. The numeric constant number_decimals must be a value between 1 and 5. For example, 2 will show frequency values such as 126.00 (as opposed to 126). This may be useful if you are using non-integer weights when tallying frequencies.
sort(ʃascending ‖ descendingʅ by valueset ‖ code ‖ label ‖ Freq)
The sort command allows you to control the order in which each row of the frequency table appears. The options include:
  • by valueset: the rows will appear in the order that the values are defined in an item's value set.
  • by code: the rows will appear in order sorted by each row's value.
  • by label: the rows will appear in order sorted by each row's label as defined in an item's value set.
  • by Freq: the rows will appear in order based on the frequency of each row's value.
By default, frequency tables are sorted ascending by code.
nonetpercents
If your frequency table contains blank values, two columns will be added to the frequency table, displaying the net percents (of the frequencies and cumulative frequencies). These net percent columns exclude the blank values from the percent calculations. If you use the nonetpercents command, these columns will not be added to the frequency table.
pagelength(number_lines)
The pagelength command specifies the number of lines that should be written to a frequency file before inserting a page break. The numeric constant number_lines must be a non-negative value. This option is only used in text frequencies.