KS: Statistics
Chapter 1: Collecting & Summarizing the Sample
Esmaeil Naderi Abbandani
Linz Institute of Technology, LIT,
Future Energy Lab
March 2025
1 / 50
Agenda
1
Introduction to Data Collection & Summarization
2
Population and Sample
3
Sampling Techniques
4
Study Designs
5
Types of Variables
6
Descriptive Statistics
▷ Summarizing Data: Graphical Representations
▷ Summarizing Data: Numerical Summaries
7
Exploratory Data Analysis (EDA)
2 / 50
Chapter 1
Introduction to Data Collection & Summarization
What is Statistics? How it works?
What is the fundamental building block of statistics?
Why is Data Collection Important?
Identify trends and patterns in business and economics.
Ensures accuracy and reliability of conclusions.
Provides the foundation for statistical analysis and decision-making.
Therefore
ÐÐÐÐÐ→ we must first determine how to collect data, analyze and present
it effectively, explore relationships within the data, and ultimately interpret the findings to derive meaningful insights.
3 / 50
Chapter 1
Population and Sample
How to Collect Data? ⇒ Sampling
Instead of studying the entire population (which is time-consuming and
costly), sampling involves selecting a subset of observations to analyze and
draw conclusions about the whole.
Key Aspects of Sampling?
To collect a reliable and accurate sample, we must carefully consider the
Sampling Method, Sample Size, Representativeness, Sampling Distribution,
and other potential biases.
Sampling Methods can be categorized into:
Probability Sampling: Each member has a known chance of selection.
Non-Probability Sampling: Selection is based on convenience or
judgment.
4 / 50
Chapter 1
Sampling Techniques
Probability Sampling:
Simple Random Sampling: Every individual has an equal probability
of being selected.
Stratified Sampling: The population is divided into homogeneous
groups (strata) before random selection.
Cluster Sampling: The population is divided into clusters, and a few
clusters are randomly selected.
Non-Probability Sampling:
Convenience Sampling: Samples are selected for accessibility and
convenience (ease).
Judgmental Sampling: Experts select samples based on judgment.
The Study Design (Observational vs. Experimental) type directly determines the sampling methods, ensuring accurate, reliable, and unbiased analysis.
5 / 50
Chapter 1
Study Designs
Types of Observational Studies
1 Cross-Sectional Studies:
▷ Data is collected at a single point in time.
▷ Used for analyzing current conditions or trends.
Example∶
ÐÐÐÐ→ A survey measuring consumer satisfaction in 2025.
2
Time-Series Studies:
▷ Data is collected at multiple time points.
▷ Tracks trends and patterns over time.
Example∶
ÐÐÐÐ→ Monthly inflation rates over five years.
3
Panel Studies:
▷ Data is collected from the same subjects over multiple time points.
▷ Helps analyze individual changes and long-term trends.
Example∶
ÐÐÐÐ→ Tracking household income changes over ten years.
Note: Survey data is typically collected in observational studies, where
Statisticians gather information without altering variables.
6 / 50
Chapter 1
Study Designs
Types of Experimental Studies
Controlled Experiments:
▷ Researchers manipulate one variable while keeping others constant.
▷ Used to establish cause-and-effect relationships.
Example∶
ÐÐÐÐ→ Testing the effect of a new product on the marginal profit of a
firm.
Randomized Controlled Trials:
▷ Participants are randomly assigned to treatment or control groups.
▷ Reduces bias and improves the reliability of results.
Example∶
ÐÐÐÐ→ Clinical trials for vaccine effectiveness.
Note: Since our focus is Not on Experiments, this lecture will exclusively
cover survey data, omitting experimental designs.
7 / 50
Chapter 1
Types of Variables
Measurement Levels:
Measurement levels (or scales of measurement) classify variables based on
the kind of values they can take and the mathematical operations that
are meaningful. The four primary measurement levels include:
1
Qualitative (Categorical) Variables
Nominal: Categories with no specific order (e.g., gender, nationality,
eye color).
Ordinal: Categories with a meaningful order but no fixed numerical
difference (e.g., education level, customer satisfaction ratings).
2
Quantitative (Numerical) Variables
Discrete: Countable values with distinct gaps (e.g., number of
students, cars sold).
Continuous: Can take any value within a range on the real line R on a
certain interval (e.g., height, weight, temperature).
8 / 50
Chapter 1
Types of Variables
9 / 50
Chapter 1
Types of Variables
Question: Define the measurement level and the type of these variables:
1
Hair color
2
Points scored in a Statistics course
3
Subjective health perception (1 = Very good, ..., 4 = Very bad)
4
Number of annual admissions in the IBA Program
5
Temperature (measured in Celsius)
6
Salary of Red Bull employees
⇒ How to Statistically Analyze these variables?
10 / 50
Chapter 1
Descriptive Statistics
Descriptive Statistics
Definition:
Summarizing and organizing data to make it easier to understand.
Providing a clue on what type of modelling can be applied to analyze
relationships between the variables.
⇒ They do not infer conclusions but help describe the dataset.
How to REPORT these descriptive statistics?
1
Graphical Representations: Visualization using Tables, graphs, etc.
2
Numerical Summaries: Using statistical measures to describe data.
11 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Graphical Representations
Purpose:
Provides a visual summary of data.
Helps identify patterns, trends, and distributions.
Common Graphical Methods:
▷ Frequency Tables: Provide a first, structured overview of data.
▷ Histograms: Show frequency distributions.
▷ Bar Charts: Compare categories.
▷ Pie Charts: Show proportions.
▷ Boxplots: Display data spread and outliers.
▷ Scatter Plots: Show relationships between variables.
12 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Frequency Tables
Definition: A frequency table summarizes data to get a better overview of
a dataset through a readable format.
Types of Frequency Tables:
Univariate tables analyze a single variable,
Bivariate tables (or Cross-table) demonstrates the joint distribution
of two variables.
Multivariate tables extend to more than two variables distributions.
Note: Usually, univariate and bivariate tables are of interest, because multivariate tables can get quite big.
13 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
14 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Univariate Frequency Table: To present the frequency distribution of a
single variable.
Example:
15 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Bivariate Frequency Table (Contingency Table): To present the
frequency distribution of two variables.
Contingency refers to dependence between two variables.
Example:
Interpretation?
16 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Multivariate Frequency Table: To present the frequency distribution of
three or more variables.
Example:
Interpretation? any EDA!
17 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Steps for Drawing a Frequency Table
Step 1: Define the Variables
Identify the variable(s) and Determine types of frequency table.
Step 2: Organize Data into Categories
For categorical variables: List unique categories (e.g., Male/Female).
For numerical variables: Create intervals (e.g., Age: 18-25, 26-35).
Step 3: Count the Frequencies (Number of observations in each category)
Step 4: Construct the Frequency Table
Step 5: Interpret and Visualize
Summarize key insights from the table.
18 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Example: How Can We Construct a Frequency Table in Our Statistics
Course?
Given Data (90 Students)
Program: IBA (85 students), EBA (5 students)
Gender: 60% Girls (54 students), 40% Boys (36 students)
Statistical Background: Yes (30%), No (70%)
Given this sample of 90 students categorized by Program, Gender, and Statistical Background, follow a step-by-step approach to construct a frequency
table for effectively summarizing and interpreting the data.
19 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Histograms vs. Bar Chart
What is a Histogram?
It’s a graphical representation of Numerical & Continuous data
to show how data are distributed.
The X-axis represents class intervals; the Y-axis represents frequency.
It uses bars (with no gaps in between) to show frequency of observations
within specified intervals.
Area of a bar is proportional to frequency (height × width = frequency),
hence, its height alone does not always represent the frequency directly.
⇒ What if class widths are equal?
What is a Bar Chart?
A bar chart is a graphical representation of categorical & discrete
data, mainly to compare different categories.
The X-axis represents distinct categories, and the Y-axis represents
counts or percentages.
20 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Key Difference: Histograms and bar charts may look similar, but they
serve different purposes.
Example:
Interpretation?
21 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Understanding Skewness
Definition: It measures the asymmetry of a dataset’s distribution around
its mean. It tells us whether the data is symmetrically distributed or has
a longer tail on one side.
Right-Skewed distribution: The right tail is longer,
Left-Skewed distribution: The left tail is longer,
Symmetric distribution: Both sides of the distribution are mirror images.
22 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Steps for Constructing a Bar Chart and Histogram
Step 1: Define the Variable Type (Categorical vs. Numerical)
Step 2: Organize Data into Categories or proper Intervals
Step 3: Count the Frequencies
Step 4: Draw the Chart & Interpretation
For bar charts: Define X-axis as Categories (separated or discrete);
the Y-axis as Frequency or percentage.
⇒ Compare the size (frequency) of categories.
For histograms: Define X-axis as intervals (with touching bars); the
Y-axis as Frequency.
⇒ Analyze the distribution shape (e.g., symmetric, skewed).
23 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Example: Construct a Bar Chart and Histogram for Grocery Receipts
from a Sample of 50 Customers.
Categorical Data (Bar Chart Example):
Payment Method: Cash (20 customers), Credit Card (25 customers),
Digital Wallet (5 customers)
Store Location: Downtown (30 customers), Suburban (20 customers)
Numerical Data (Histogram Example):
Total Grocery Spending ($): Recorded for 50 customers.
Data Range: $10 - $120, divided into bins ($10-$30, $30-$50, etc.).
1
2
3
Spending follows a Left-Skewed distribution.
Spending follows a Symmetric distribution. distribution.
Spending follows a Right-Skewed distribution.
24 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Pie Chart: Definition and Purpose
Definition: A Pie Chart is a circular statistical graphic that represents
categorical data as proportional slices of a whole. It visualizes relative
sizes and is useful for percentage-based comparisons.
Components of Pie Charts
1
Slices: Represent different categories.
2
Angles: Each slice has an angle proportional to its percentage.
3
Labels: Indicate the category and sometimes the percentage.
4
Legend: Explains what each color represents.
25 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
26 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Steps to Create a Pie Chart
Step 1: Collect and Organize Data
Step 2: Convert Frequencies to Percentages
Frequency
Percentage = ( Category
Total Frequency ) × 100
Step 3: Calculate the Angle for Each Slice
Frequency
○
Angle = ( Category
Total Frequency ) × 360
Example: If a category makes up 25% of the dataset:
25
× 360○ = 90○
100
Step 4: Draw the Pie Chart
Use a protractor (manually) or software to create slices based on
calculated angles.
27 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Example: Constructing a Pie Chart
Dataset: Favorite Ice Cream Flavors (Survey of 100 People)
Flavor
Frequency
Vanilla
30
Chocolate
40
Strawberry
20
Mint
10
Percentage
Angle
30
30
○
100 × 100 = 30% 100 × 360 = 108
40
40
○
100 × 100 = 40% 100 × 360 = 144
20
20
○
100 × 100 = 20% 100 × 360 = 72
10
10
○
100 × 100 = 10% 100 × 360 = 36
Now, draw a Pie Chart based on the result
28 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Boxplots
Definition: A Boxplot (Box-and-Whisker Plot) is a graphical representation of the distribution of a dataset based on five key summary statistics.
Why Use Boxplots?
Shows central tendency (median) and spread of the data.
Identifies outliers and skewness in the distribution.
Useful for comparing multiple datasets at a glance.
29 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Outlier: A Prerequisite for Box Plots
Outlier: A data point that is significantly different from the rest of the
dataset.
What Do Outliers Tell Us? Example:
30 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Quintiles vs. Quartiles: A Prerequisite for Box Plots
Quantile: A general term for dividing a dataset into equal parts.
The p-th quantile is the value below which p% of the data falls.
Assist in describing data distribution, including spread, central tendency, skewness, and outlier detection.
Quartiles: Quartiles divide a dataset into four equal parts, helping to
understand the spread of data.
Q1 (First Quartile): Represents the 25th Percentile of the data
(25% of data is below Q1).
Q2 (Second Quartile): Demonstrates the Median (50th Percentile)
or the middle value of the data (50% of data is below Q2).
Q3 (Third Quartile): Shows the 75th Percentile of the data or the
median of the upper half (75% of data is below Q3).
31 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Measuring IQR: A Prerequisite for Box Plots
Step 1: Arrange Data in Ascending Order
Example Dataset: 4, 8, 15, 21, 24, 30, 35, 40, 50
Step 2: Compute Quartiles
Q2: Middle value → 24.
Q1: Median of the lower half → 10.5 (between 8 and 15).
Q3: Median of the upper half → 37.5 (between 35 and 40).
Step 3: Compute the Interquartile Range (IQR)
IQR = Q3 - Q1 = 37.5 - 10.5 = 27
IQR measures the middle 50% of the data.
Helps detect outliers: Outliers lie beyond 1.5 × IQR from Q1 and Q3 .
⇒ A value outside this range is statistically distant from the central
data and may be an outlier (unusually large or small).
32 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Constructing a Boxplot
Step 1: Compute the Five-Number Summary
Minimum: Smallest value (Whisker Endpoint).
Q1 (First Quartile): 25th percentile.
Median (Q2): 50th percentile.
Q3 (Third Quartile): 75th percentile.
Maximum: Largest value (Whisker Endpoint).
Step 2: Draw the Box
A box is drawn from Q1 to Q3.
A line inside the box marks the median (Q2).
Step 3: Add Whisker Endpoints and Outliers
Whiskers specify the smallest and largest values within 1.5 × IQR.
Outliers (extreme values) are plotted as dots beyond the whiskers.
33 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Interpreting a Boxplot
Key Observations from a Boxplot:
Symmetric Data: The median is centered in the box, and whiskers
are roughly equal in length.
Right-Skewed Data: The median is closer to Q1, and the right
whisker is longer.
Left-Skewed Data: The median is closer to Q3, and the left whisker
is longer.
Presence of Outliers: Points beyond the whiskers indicate potential
outliers.
34 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Scatter Plots
Definition: A Scatter Plot graphically shows the relationship between two
numerical variables on a Cartesian plane.
Visualizes correlations, patterns, and trends between two variables.
Detects outliers and supports regression analysis.
35 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Interpreting Scatter Plots: Correlation
What Can We Learn from a Scatter Plot?
Positive Correlation: Both variables increase together.
Negative Correlation: One increases as the other decreases.
No Correlation: No clear pattern exists between the two variables.
Note: Be careful of Spurious Regression, consider Causal Effects, and also
Theoretical Foundations.
36 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Constructing a Scatter Plots
Step 1: Identify Two Numerical Variables
Example: Work Hours vs. Incomes.
Step 2: Plot Data Points
X-axis: Independent Variable (e.g., Work Hours).
Y-axis: Dependent Variable (e.g., Income).
Each pair of points represents one observation in the dataset.
Step 3: Analyze the Relationship
Look for patterns, trends, or clusters.
Check for outliers that deviate significantly.
Determine if a linear or non-linear trend is visible.
37 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Scenario: A company investigates whether drinking more coffee affects
employee productivity. The dataset includes 10 employees, tracking their:
Coffee intake (cups/day): (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
Tasks completed per day: (5, 7, 9, 10, 12, 14, 13, 12, 10, 7)
Questions:
Visualize the relationship using a scatter plot.
What pattern do you notice? Is there an optimal coffee intake for
peak productivity?
38 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Pearson Correlation: Definition and Formula
Definition: The Pearson Correlation Coefficient (r ) quantifies the strength
and direction of a linear relationship between two numerical variables. It
normalizes the covariance, ensuring that r is always within [−1, +1].
Formula:
r=
sxy
sX ⋅ sY
Where:
sxy = Covariance between X and Y .
sX = Standard deviation of X .
sY = Standard deviation of Y .
Alternatively, it can be written as:
∑(Xi − X̄ )(Yi − Ȳ )
√
r=√
∑(Xi − X̄ )2 ⋅ ∑(Yi − Ȳ )2
39 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Assumptions and Interpretations
Key Assumptions:
The relationship between X and Y is linear.
Both variables should be normally distributed.
Sensitive to outliers, which can distort results.
A high correlation does not imply causation.
How to Interpret r ?
r = 1 ⇒ Perfect Positive Correlation (both increase together).
0 < r < 1 ⇒ Moderate Positive Correlation.
r = 0 ⇒ No Correlation (random or non-linear relationship).
−1 < r < 0 ⇒ Moderate Negative Correlation.
r = −1 ⇒ Perfect Negative Correlation (one variable increases, the
other decreases).
40 / 50
Chapter 1
Descriptive Statistics: (1) Graphical Representations
Sample Dataset: Study Hours vs. Exam Scores
Study Hours (X) Exam Score (Y)
2
50
3
55
5
65
7
75
9
85
11
95
Compute Pearson Correlation (r )
∑(Xi − X̄ )(Yi − Ȳ )
√
r=√
∑(Xi − X̄ )2 ⋅ ∑(Yi − Ȳ )2
Step 2: Interpretation
41 / 50
Chapter 1
Summarizing Data: (2) Numerical Summaries
Numerical Summaries
Purpose:
Provide quantitative measures to describe data and understand its
distributional characteristics.
Types of Numerical Summaries:
▷ Measures of Central Tendency (Location Parameters):
Mean (µ or x̄): The Average value of dataset.
Median (Q2 ): The Middle value when the data is sorted.
Mode (Mo): The most Frequently Occurred value in the dataset.
▷ Measures of Dispersion (Scale Parameters):
Range (R): Difference between max and min.
Variance - Spread of data points.
Standard Deviation - Average distance from mean.
42 / 50
Chapter 1
Summarizing Data: (2) Numerical Summaries
Measures of Location Parameters
Dataset (Without Outlier): Consider the dataset of students’ exam scores:
{60, 65, 70, 75, 80, 85, 90}
Mean x̄ = 60+65+70+75+80+85+90
= 75
7
Median (Middle value) = 75
Mode (Most frequent value) = None (all values appear once)
43 / 50
Chapter 1
Summarizing Data: (2) Numerical Summaries
Now, Introducing an Outlier: Example: Outlier = 200
{60, 65, 70, 75, 80, 85, 90, 200}
New Mean x̄ = 60+65+70+75+80+85+90+200
= 90.6
8
New Median (Middle value) = 75+80
= 77.5
2
New Mode = None
Conclusion: Why Median is Better in This Case?
The mean increased from 75 to 90.6 due to one extreme value.
The median changed slightly from 75 to 77.5, staying more stable.
The median is a better measure of central tendency in the presence
of outliers since it is less sensitive to extreme values.
44 / 50
Chapter 1
Summarizing Data: (2) Numerical Summaries
Measures of Dispersion (Scale Parameters)
Definition: Scale Parameters describe how the data values are spread out
around the central tendency.
Range (R): Difference between the maximum and minimum values.
Variance (σ 2 or s 2 ): The average squared distance from the mean.
Standard Deviation (σ or s): The square root of variance, measuring
the average deviation from the mean.
Formulas:
Range: R = Xmax − Xmin
(Xi −µ)2
N
2
(X
−
X̄
)
∑
i
Sample Variance: s 2 = n−1
, (Why is that? What is df?)
√
√
2
Standard Deviation: σ = σ , s = s 2
Population Variance: σ 2 = ∑
45 / 50
Chapter 1
Summarizing Data: (2) Numerical Summaries
Interpreting Standard Deviation
What Does Standard Deviation Tell Us?
Low Standard Deviation: Data points are close to the mean.
High Standard Deviation: Data points are widely spread from the
mean.
Note:
Since variance squares the deviations from the mean, extreme values
(outliers) contribute disproportionately, making the variance and
standard deviation much larger.
Outliers increase dispersion, causing the spread to be overestimated.
46 / 50
Chapter 1
Summarizing Data: (2) Numerical Summaries
Example: Calculating Dispersion Measures
Given Dataset: X = {5, 10, 15, 20, 25}
Step 1: Compute the Range R = Xmax − Xmin = 25 − 5 = 20
= 15
Step 2: Compute the Mean X̄ = 5+10+15+20+25
5
Step 3: Compute the Variance
s2 =
(5 − 15)2 + (10 − 15)2 + (15 − 15)2 + (20 − 15)2 + (25 − 15)2
5−1
100 + 25 + 0 + 25 + 100 250
=
= 62.5
4
4
√
Step 4: Compute the Standard Deviation s = 62.5 ≈ 7.91
=
Interpretation: The standard deviation tells us that, on average, the data
points deviate 7.91 units from the mean.
47 / 50
Chapter 1
Exploratory Data Analysis (EDA)
Definition: Exploratory Data Analysis (EDA) is a critical step in understanding datasets before formal modelling or hypothesis testing.
Goals of EDA:
Identify patterns, trends, and anomalies in the data.
Detect outliers and missing values.
Assess the distribution of variables.
Uncover potential relationships between variables.
Choose the appropriate statistical or machine learning model.
Common Techniques:
Summary Statistics: Mean, median, standard deviation, quartiles.
Visualizations: Histograms, boxplots, scatter plots, bar charts.
Correlation Analysis: Assessing relationships between variables.
48 / 50
Chapter 1
Exploratory Data Analysis (EDA)
Steps in Exploratory Data Analysis (EDA)
Step 1: Understanding the Dataset
Load the data and check its structure (variables, types, size).
Identify missing values and outliers.
Step 2: Univariate Analysis
Use summary statistics (mean, median, range, variance).
Visualize distributions with histograms & boxplots.
Step 3: Bivariate & Multivariate Analysis
Use scatter plots or contingency tables to explore relationships.
Compute correlation coefficients for numerical variables.
Step 4: Detecting Patterns
Identify skewness, trends, seasonality, and clusters.
Spot potential outliers and inconsistencies in the data.
49 / 50
Thank You!
Questions and Discussions Welcome
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )