Epi Info™ User Guide

Command Reference


Analysis Command: FREQ

Description
FREQ produces a table from the table(s) specified in the last READ statement, showing how many records have each value of the variable. Exact Confidence limits for each proportion are included.

Syntax
FREQ [<variable(s)>] {<settings>}
FREQ * {EXCEPT [<variable(s)>]} {<settings>}

  • <variable(s)> represents one or more variable names. Group variables may be used.
  • <settings> represent clauses from the SET command indicating a value of a setting (except PROCESS and HYPERLINKS) which will be used for the duration of the statistical command only.

Comments
Records may be included or excluded from the count by using SELECT statements. Those marked as deleted in Enter will be handled according to the current setting for SET PROCESS. If more than one variable name is given, FREQ makes a separate table for each variable. Confidence limits for the binomial proportions are produced.

If a WEIGHTVAR is specified, the value of the WEIGHTVAR variable is treated as a count of instances of the variable being computed in the frequency (i.e., in the following command a record containing the value 30 for AGE and 15 for COUNT would give a result equivalent to 15 individuals of age 30).
FREQ AGE WEIGHTVAR = COUNT

If STRATUM is specified, a separate frequency is produced for each stratifying variable value.

FREQ ILL STRATAVAR=SEX, produces a table showing ILL (Yes/No/Unknown) for males and another for females. The same numbers can be obtained using TABLES ILL SEX, but the latter produces results in one table rather than in separate tables, and produces statistics to test for an association between ILL and SEX.

FREQ * makes a table for each variable in the current form other than unique identifiers. It is often used to begin analyses of a new data set.

To do frequencies of all variables except a few, use FREQ * EXCEPT VarName(s) followed by the names of the variables to be excluded.

Multiline (memo) variables cannot be used in Frequencies. To use a Multiline variable, define a new variable and assign to it the value SUBSTRING(<old variable>,1,255) and use it in the frequency.

Examples
Example 1: The number of ill and healthy people are displayed along with their percentages and the total.

READ {.\Projects\Sample\Sample.prj}:Oswego 
FREQ Ill

Example 2: In this case, the variable ‘Desserts’ is a group variable containing the Yes/No variables Chocolate, Vanilla, and Cakes. Running a frequency on a group variable automatically runs a frequency on every variable contained in the group.

READ {.\Projects\Sample\Sample.prj}:Oswego 
FREQ Desserts

Example 3: A frequency on two variables is produced. In this case, BakedHam and Milk.

READ {.\Projects\Sample\Sample.prj}:Oswego 
FREQ BakedHam Milk

Example 4: A frequency on every variable in the current data source is produced.

READ {.\Projects\Sample\Sample.prj}:Oswego 
FREQ *

Example 5: A frequency on every variable in the current data source (except Age, Code_RW, DateOnset, Name and TimeSupper) is produced.

READ {.\Projects\Sample\Sample.prj}:Oswego 
FREQ * 
EXCEPT Age Code_RW DateOnset Name TimeSupper

Example 6: A frequency of ill people is produced, stratified by sex. Using the stratification option will produce two frequencies. In this case, males and females.

READ {.\Projects\Sample\Sample.prj}:Oswego 
FREQ Ill STRATAVAR=Sex

Example 7: A weighted frequency is conducted. For each record, the value stored in Count is used to represent that record’s weight.

READ {.\Projects\Sample\Sample.prj}:Lasum 
FREQ Outcome WEIGHTVAR=Count

Example 8: A complex sample frequency is run using the Epi1 data set.

READ {.\Projects\Sample\Sample.prj}:Epi1 
SET STATISTICS=COMPLETE  
FREQ VAC PSUVAR=Cluster