Descriptive Statistics for Categorical Data
Introduction to Descriptive Statistics
Descriptive statistics involve techniques for exploring and summarizing variables to describe the information available in a specific sample.
This branch of statistics focuses on graphical and numerical methods to summarize data. Generalizing these conclusions to an entire population is reserved for later statistical inference.
The analysis begins with research questions involving a single variable of interest. The appropriate descriptive techniques differ based on whether the variable is categorical or numerical.
Relationships between variables are also explored within a sample, where the type of variables (categorical or numerical) dictates which techniques are suitable.
Considering Categorical Data
Categorical data is analyzed using tables and basic tools. This analysis often utilizes the email data set, which consists of information on emails. A smaller subsample called the
email50data set is also used for specific illustrations.
Frequency Tables and Bar Plots
Frequency Tables: A frequency table displays the number of times each particular outcome occurs in a data set.
Absolute Frequency: This refers to the specific count of each outcome.
Relative Frequency: This is obtained by dividing the absolute frequency by the total sample size . Relative frequencies can be expressed as proportions or percentages.
Mode: The mode is defined as the outcome that occurs most frequently in the data set.
Example: The
numberVariable: A frequency table for thenumbervariable (based on the email data set where ) demonstrates these concepts:Outcome: none: Absolute frequency = ; Relative frequency = .
Outcome: small: Absolute frequency = ; Relative frequency = .
Outcome: big: Absolute frequency = ; Relative frequency = .
Total: Absolute frequency = ; Relative frequency = .
For the outcome "none", the relative frequency is calculated as .
The mode for this data set is the outcome "small".
Bar Plots: These are standard graphical representations for single categorical variables.
Plots can be based on counts (absolute frequency) or proportions (relative frequency).
In a bar plot of proportions, the y-axis indicates the proportion of observations falling into each category level.
Pie Charts: While common, pie charts are generally less useful for data analysis than bar plots.
Comparing the sizes of groups is more difficult in a pie chart, particularly when categories have very similar counts.
In the
numbervariable example, the categories "none" () and "big" () are so similar in size that they are nearly indistinguishable in both pie charts and bar plots.
Cumulative Frequencies for Ordinal Variables
Cumulative frequencies and cumulative percentages are applicable to ordinal variables, which have a natural ordering.
Cumulative Frequency: This is the total of the absolute frequencies for all outcomes at or below a specific outcome.
Example 2.1: Number of Characters in
email50: This example uses a new ordinal variablenum_char_ordderived from the character count in theemail50data set:Category 1 (): Frequency = ; Cumulative Frequency = ; Percentage = ; Cumulative Percentage = .
Category 2 (]: Frequency = ; Cumulative Frequency = ; Percentage = ; Cumulative Percentage = .
Category 3 (]: Frequency = ; Cumulative Frequency = ; Percentage = ; Cumulative Percentage = .
Category 4 (): Frequency = ; Cumulative Frequency = ; Percentage = ; Cumulative Percentage = .
100% Stacked Bar Plots: This graphical display represents ordinal information by stacking categories. The cumulative percentages can be read directly from the y-axis of the plot.
Distribution Information: Cumulative percentages and standard percentages provide identical information regarding the distribution of outcomes. If one set is known for all outcomes, the other can be derived.
Mathematical Notation for Categorical Data
Outcomes: Possible outcomes of a categorical variable are denoted as .
Frequencies: The absolute frequencies for these outcomes are denoted as .
Sample Size: The total sample size is the sum of all frequencies:
Sample Proportions (Relative Frequencies): These are denoted as , where:
Cumulative Proportions: For ordinal variables, cumulative proportions are denoted as . The cumulative proportion for the -th category is defined as: