CHAPTER 2 STAT 303
Qualitative Data: Numerical Summarization
Categorical Data Overview: Qualitative or categorical data represent attributes, classifications, or labels rather than numerical quantities.
Frequency Table (Frequency Distribution):
Organizes and presents the count (frequency) of observations belonging to each distinct category of a qualitative variable.
Includes calculated relative frequencies (proportions), cumulative frequencies, and cumulative relative frequency percentages.
Example (Academic Classification of 1,000 Undergraduate Students):
Freshman: Frequency = , Relative Frequency = , Cumulative Frequency = , Cumulative Relative Frequency =
Sophomore: Frequency = , Relative Frequency = , Cumulative Frequency = , Cumulative Relative Frequency =
Junior: Frequency = , Relative Frequency = , Cumulative Frequency = , Cumulative Relative Frequency =
Senior: Frequency = , Relative Frequency = , Cumulative Frequency = , Cumulative Relative Frequency =
Total: Frequency = , Relative Frequency =
Contingency Table:
Displays the joint distribution and relationship between two categorical variables simultaneously.
Example (Class Year vs. Shirt Size, ):
Freshman: Small = , Medium = , Large = (Total = )
Sophomore: Small = , Medium = , Large = (Total = )
Junior: Small = , Medium = , Large = (Total = )
Senior: Small = , Medium = , Large = (Total = )
Column Totals: Small = , Medium = , Large = (Grand Total = )
Qualitative Data: Graphical Representation
Bar Chart (Bar Graph / Bar Plot):
Displays categorical data using rectangular bars where the height or length of each bar is directly proportional to the category's frequency or relative frequency.
Example (T-Shirt Size Order, ): Extra Small = , Small = , Medium = , Large = , Extra Large = .
Two-Variable Bar Charts:
Side-by-Side Bar Chart: Displays individual bars for each sub-group positioned adjacent to one another, facilitating direct comparison across categories.
Stacked Bar Chart: Combines category segments within a single bar for each group, illustrating both the sub-category components and total category counts.
Standardized Stacked Bar Chart: Scales all composite bars to a uniform height of , allowing for comparison of relative proportions or percentages across groups independent of group size differences.
Example Dataset (Student Housing Types across Two Classes):
Apartment: Class A = (), Class B = (), Total =
Dorm: Class A = (), Class B = (), Total =
House: Class A = (), Class B = (), Total =
Fraternity House: Class A = (), Class B = (), Total =

Mosaic Plot:
A graphical representation of multi-variable categorical data where the area of each rectangular tile is proportional to the relative frequency of observations falling into that joint category.
Provides visual assessment of associations and dependencies within contingency tables.
Example (Titanic Survival by Passenger Class): Standardized stacked bar charts show proportion of survival within class, while mosaic plots simultaneously encode class size (bar width) and survival rate (segment height).

Pie Chart:
Represents a single categorical variable by dividing a circle into proportional sectors (slices) matching category frequencies or percentages.
Example (Vegetable Preferences, ): Peas = (), Carrots = (), Spinach = ().
Limitations: Becomes cluttered, unreadable, and misinformative when applied to variables with numerous categories (e.g., student population across 16+ university colleges).
Quantitative Data: Measures of Central Tendency
Summation Notation ():
Sum of all values:
Sum of squared values:
Square of the sum:
Worked Example with dataset :
Mean (Arithmetic Mean / Average):
The sum of all numerical values in a dataset divided by the total number of observations.
Sample Mean (Statistic, or ): where represents the sample size.
Population Mean (Parameter, ): where represents the population size.
Calculation Example: For dataset ():
Shark Attack Example: For shark attack counts across 8 states ():
Weighted Mean (Weighted Average, ):
Used when individual data values contribute unequally to the final sum according to specific weight factors ():
Course Grade Example:
Exam 1 (, weight or )
Exam 2 (, weight or )
Final Exam (, weight or )
Homework (, weight or )
Quizzes (, weight or )
Calculation:
Habitat Population Density Example:
Forest (, area weight or )
Grassland (, area weight or )
Wetland (, area weight or )
Calculation:
Median ( or ):
The percentile value that divides an ordered dataset into two equal halves.
Position Formula:
Odd Sample Size (): The median is the single central observation.
Example (): Median position is value ().
Even Sample Size (): The median is the mean of the two central observations.
Example (): Median position is position; average of () and () values gives
Practice Dataset Calculations:
Dataset 1 (): Median
Need to order the numbers from less to greater
Dataset 2 (): Median
Mode:
The observation that occurs most frequently in a dataset.
A dataset can be unimodal (one mode), bimodal (two modes), multimodal (three or more modes), or have no mode.
Basically the most often
Selecting the Appropriate Measure of Central Tendency:
Mode: Generally the least informative measure for numerical data.
Doesnt well represent the bulk of the distribution
Median: Preferred when data distributions are skewed or contain extreme outliers.
Mean: Preferred when data distributions are symmetric and free of outliers, as it incorporates all numerical values.
gets pulled like away
Quantitative Data: Measures of Spread and Variability
Range:
The absolute difference between the largest and smallest observations:
Example (Graduate Starting Salaries in \\$1,000\text{s}): 1,000\text{s} = \\
Properties: Uses only extreme values, making it non-resistant and highly sensitive to outliers. or not robustt
Doesnt consider all data points just min and max so doesnt accuratley record the overall spread of the dataset, which can lead to misleading interpretations in the presence of outliers.
Variance:
Measures variability by computing the average squared deviation from the mean.
square of the original data minus the mean
Sample Variance (Statistic, ):
S = the sample standard deviation
x= a specific data value
-x = the sample mean
n = the sample size
Population Variance (Parameter, ):
Limitation: Expressed in squared units relative to original data.
Always a positive number when finishing calculating
Given 55,59,63,67,71,75
Find variance and standard deviation for data set
\begin{align}
\text{Step 1: Calculate the mean (}\mu\text{)}&:\
\mu = \frac{55 + 59 + 63 + 67 + 71 + 75}{6} = \frac{390}{6} = 65
\text{Step 2: Find each deviation from the mean (}\mu\text{)}&:\
\begin{align}
55 - 65 &= -10\
59 - 65 &= -6\
63 - 65 &= -2\
67 - 65 &= 2\
71 - 65 &= 6\
75 - 65 &= 10\
\end{align}\ \text{Step 3: Square each deviation}&:\ \begin{align}
(-10)^2 &= 100\
(-6)^2 &= 36\
(-2)^2 &= 4\
(2)^2 &= 4\
(6)^2 &= 36\
(10)^2 &= 100\
\end{align}\
\text{Step 4: Calculate the variance (}\sigma^2\text{)}&:\
\sigma^2 = \frac{100 + 36 + 4 + 4 + 36 + 100}{5} = 280/5 \approx 56k² is the variance 56000 squared dollars
\text{Step 5: Calculate the standard deviation (}\sigma\text{)}&:\
\sigma = \sqrt{46.67} \approx 6.83.
\end{align}
Standard Deviation:
The positive square root of the variance, restoring units to match original data.
Sample Standard Deviation (Statistic, ):
Population Standard Deviation (Parameter, ):
Key Properties:
always; only when all observations are identical.
Larger values indicate greater dispersion around the mean.
Sensitive to outliers (non-resistant).
Worked Calculation Example (Employee Salaries in \\$1,000\text{s} ):
Data ():
Mean:
Deviations ():
Squared Deviations ():
Sum of Squared Deviations:
Sample Variance: s^2 = \frac{280}{6 - 1} = 56\,(\\$1,000)^2
Sample Standard Deviation: 1,000) \approx \\
Worked Calculation Example (Hybrid A Rose Bloom Diameters):
Data ():
Mean:
Deviations:
Squared Deviations:
Sum of Squared Deviations:
Sample Variance:
Sample Standard Deviation:
Quartiles and Interquartile Range ():
Quartiles:
: Zeroth quartile / Minimum value
: First quartile ( percentile) - median of lower half
: Second quartile ( percentile / Median)
: Third quartile ( percentile) - median of upper half
: Fourth quartile / Maximum value
Computation Rules for and :
If is odd, exclude the median from both halves when computing quartiles.
If is even, split data evenly into lower and upper halves and include all values.
Worked Example (Blood Pressure Measurements, ):
Sorted readings:
Median ():
Lower half ( values):
Upper half ( values):
Interquartile Range Formula: Measures spread of central of data; highly resistant to outliers.
Outliers Identification (1.5 IQR Rule):
Observations beyond cutoffs are potential outliers.
Pumpkin Weight Example: Dataset ().
Median , , ,
Upper Cutoff
Lower Cutoff
Evaluation: Since , is an outlier.
Tukey's Five-Number Summary:
Consists of: Sample Minimum (), First Quartile (), Median (), Third Quartile (), Sample Maximum ().
NYC Monthly High Temperatures Example: Sorted .
, , , ,
Robustness and Summary of Measurement Selection
Robustness Definition: Resistance of a statistical measure to distortion caused by extreme values or outliers.
Demonstration (NFL Offensive Tackles Weight Dataset):
Original dataset ():
Mean:
Median:
Adding an unusually small weight (, ):the new dataset becomes ext{Dataset} = \{154, 307, 307, 308, 314, 317, 317, 328, 330} ext{ lb}. The mean now is calculated as , while the median changes to .
New Mean: (decreased by )
New Median: (decreased by only )
Conclusion: Mean is non-robust; Median is robust.
Summary Guide for Selecting Numerical Measures:
Symmetric Distribution (No Outliers): Center = Mean, Spread = Standard Deviation
Skewed Distribution (or Outliers Present): Center = Median, Spread = Interquartile Range ()
Quantitative Data: Graphical Representation
Histograms:
Graphical display of numerical data using contiguous bars over equal-width interval bins.
Bar height reflects frequency or relative frequency.
Binning Rule of Thumb:
Cautions: Bin width heavily alters visual shape; individual raw data points cannot be recovered; small sample sizes can create misleading displays.
STAT 302 Height Histogram Analysis: Continuous numeric variable, x-axis in inches, y-axis count of students, range = ( to ), bin width = .
Box Plot (Box-and-Whisker Diagram):
Visual representation of the Five-Number Summary.
q0, Q1,q2,Q3,Q4
Box spans to with a line at Median (). Whiskers extend to minimum and maximum values (or 1.5 IQR cutoffs with outliers plotted as individual points).

* *Example Analysis ( undergraduate height box plot)*:
*
* Proportion is (from to Maximum).
* Number of students .
Side-by-Side Box Plot: Compares numerical distributions across categorical groups (e.g., student club participation grouped by academic class year).
Q1 : The first quartile (Q1) represents the value below which 25% of the data falls, providing insight into the lower range of the dataset.
Q2 : The second quartile (Q2), also known as the median, indicates the value at which 50% of the data points lie below, offering a central tendency measure of the dataset.
Q3/Q4 : The third quartile (Q3) marks the value below which 75% of the data falls, highlighting the upper range of the dataset, while Q4, or the fourth quartile, encompasses all values above Q3, providing a perspective on the highest data points. In summary, these quartiles allow for a comprehensive understanding of data distribution, facilitating better interpretation of statistical trends within the student club participation across different academic years.
Dots above the graph represent outliers, which are data points that deviate significantly from the other observations and can indicate variability in the dataset or potential data entry errors.
Time Series Plot: Displays quantitative data collected over time (-axis = time, -axis = variable). Identifies long-term trends and regular seasonal fluctuations.
The time series plot is particularly useful for analyzing how student club participation evolves, allowing us to observe patterns that coincide with academic cycles, such as increased engagement during orientation weeks or annual events.
Additionally, this visual representation enables us to forecast future participation trends by examining historical data, thereby aiding in resource allocation and planning for upcoming events.
Examples: Monthly atmospheric levels at Mauna Loa observatory (1958–2014) showing upward trend with seasonal cycles; Lake Erie monthly water levels (1921–1970).
Scatterplot: Graphically displays relationships between two numeric variables. typically a point for each pair
Used to display and explore the relationship between two numeric variables
Examples:
Linear positive relationship dots going like up
Linear positive relationship: Dots are arranged in an upward slope, indicating that as one variable increases, the other variable also tends to increase.
Life Expectancy vs. Total Fertility (Gapminder 2021): Negative linear association (higher fertility correlates with lower life expectancy
Do these two variables are they associated or independent? To determine their association, we can analyze scatterplots or calculate correlation coefficients, which will help clarify whether changes in total fertility have a significant impact on life expectancy.
Study Hours vs. Sleep Hours: Negative linear relationship.
Possum Head Length vs. Skull Width: Positive linear association.
Distribution Shape, Symmetry, and Skewness
Describing Quantitative Distributions (4 Key Characteristics):
Shape: Modality, symmetry, skewness.
One mode can indicate a unimodal distribution, while multiple modes suggest a multimodal distribution, which may reveal important underlying patterns in the data.
Two modes Bimodel
Three or more multimodal
modal refers to a distribution that possesses multiple peaks, indicating the presence of distinct subgroups within the dataset that may require further investigation.
Center: Midpoint or center of mass.
Spread: Range of values.
Outliers / Unusual Observations.
Modality:
Unimodal: Single major peak.
Bimodal: Two distinct major peaks.
Multimodal: Three or more distinct peaks.
Skewness & Measures of Center Relationships:
Left-Skewed (Negatively Skewed): Long tail extends left. . Example: Human lifespan / age at death.

* *Symmetric (Bell-Shaped)*: Left and right sides mirror each other. .

* *Right-Skewed (Positively Skewed)*: Long tail extends right. . Examples: Individual income, BMI, weekly extracurricular hours.

Comprehensive Guide to Selecting Data Description Methods
Data Summarization Decision Tree:
Qualitative Data - 1 Variable:
Tables: Frequency Table, Relative Frequency Table
Graphs: Bar Graph, Pie Chart, Pareto Diagram
Qualitative Data - 2 Variables:
Tables: Two-Way Frequency Table, Two-Way Relative Frequency Table
Graphs: Side-by-Side Bar Graphs, Side-by-Side Pie Charts, Stacked Bar Graphs, Mosaic Plots
Quantitative Data - 1 Variable:
Graphs: Dot Plot, Stem-and-Leaf Display, Histogram, Box Plot
Numerical Descriptive Measures:
Central Tendency: Mean, Median, Mode
Variation: Range, Variance, Standard Deviation, Interquartile Range ()
Relative Standing: Percentiles, Z-scores
Quantitative Data - 2 Variables:
Graphs: Scatterplot

Software Functions for Statistical Summaries
Excel Functions Reference:
Summation:
=SUM(number1, [number2], ...)Mean:
=AVERAGE(number1, [number2], ...)Median:
=MEDIAN(number1, [number2], ...)Single Mode:
=MODE.SNGL(number1, [number2], ...)Multiple Mode:
=MODE.MULT(number1, [number2], ...)First Quartile ():
=QUARTILE.INC(array, 1)Third Quartile ():
=QUARTILE.INC(array, 3)All Quartiles:
=QUARTILE(array, quart)(wherequart= 0 for Min, 1 for , 2 for Median, 3 for , 4 for Max)Population Variance:
=VAR.P(number1, [number2], ...)Sample Variance:
=VAR.S(number1, [number2], ...)Population Standard Deviation:
=STDEV.P(number1, [number2], ...)Sample Standard Deviation:
=STDEV.S(number1, [number2], ...)
R Functions Reference:
Minimum:
min(x)Maximum:
max(x)Mean:
mean(x)Median:
median(x)Sample Variance:
var(x)Sample Standard Deviation:
sd(x)Quartiles:
quantile(x, 0.25),quantile(x, 0.75),quantile(x, probs = c(0.25, 0.5, 0.75))Importing Datasets:
read.csv("filename.csv"),read.table("filename.txt", sep = "\t", header = TRUE)Graphical Functions:
hist(x, ...),boxplot(x, ...),pie(table(x), ...),barplot(table(x), ...),par(mfrow = c(1, 2))