Tabulating the frequency of data values in a variable


The frequency of a data value is the number of times that a particular value occurs. When tabulating frequency, the count of the number of responses associated with different values of one variable can be obtained. Tabulated frequency data is generally useful for data checking.


EXAMPLE DATABASE: Nhanes

DATA INPUT

Table nhanes in the Nhanes.mdb database is the input.



QUERY frequency_of_infants

SELECT age, COUNT(age) AS infant_count
FROM nhanes
WHERE ageunit = 'M'
GROUP BY age;

Query frequency_of_infants lists the age frequency of infants below 1 year old.



DISCUSSION

The query counts the number of infant records by age (in months), given the condition that the ageunit is M, which stands for MONTH.


QUERY frequency_by_age

SELECT age, COUNT(age) AS count
FROM nhanes
WHERE ageunit='Y'
GROUP BY age;

Query frequency_by_age lists the age frequency of respondents who are 1 year old and above.



DISCUSSION

The query counts the number of respondent records by age (in years), given the condition that the ageunit is Y, which stands for YEAR.


Last modified September 23, 2008 9:13 am