Frequency formatting options can be specified:
Any options specified as part of a call to freq.save()
will override options specified when declaring the named frequency.
The formatting options include the following commands: valueset
, and pagelength
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.
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).
command typically results in multiple frequency tables being created for each item and is generally used instead of the valueset
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).
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.
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
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.
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.
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.
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.
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.
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.