




























































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





























































































Lecture 1 – 22/
Introduction
Data analysis is the process of collecting, analysing, and interpreting data to generate meaningful insights
that can be used to make strategic business decisions.
This course is important to
For example, “Competitive Analysis” course, where you will learn to analyse markets.
- Hedonic Pricing : to understand the attributes of a product that are more relevant on the choice of
consumer, starting from its price ( regression ) à regression on product attributes to explain price
- Demand Segmentation: to create segment of similar consumers ( cluster analysis ) à clustering
consumers based on similarities
Data is among the most precious resources available; this course will provide the basics to understand it.
No business willing to scale can overlook the importance of data. Data Analysis is the common ground
language between marketers, scientists, engineers, and stakeholders.
Course content
Prerequisites
Basic statistical concepts and terminology
Software: basic Excel functionality
Book: Sarstedt, Mooi: chapters 1, 2, and 3
What is data?
Data is not only numbers, but also sales figures, survey responses, customer reviews, clicks, web/social
traces. They are fundamental to take decisions.
Why data matters in marketing?
(1) concrete basis for decisions , not just intuition
(2) reduce risks and improve strategy.
Goal of Data Analysis à the goal is to transform raw data to actionable insights ( information ) into
decisions. The decision is therefore based on concrete reality.
As presented in the figure, one information is visible and intuitive à the lowest sales of product B are done
in the South ( information ). The following decision will be targeted marketing (local advertising campaigns)
to increase product awareness ( decision ).
Another example à a fashion company wants to understand why sales have dropped. With data analysis it
can (1) identify causes (new competitors, prices, changing tastes) and (2) find strategies to respond.
Data Analysis: the main tool in Market Analysis
Market analysis helps companies to better understand the environment in which a company operates:
customers, competitors, opportunities, and risks.
It also answers questions about :
This can lead to:
sustainable products).
satisfaction.
Conclusions about market analysis
Market analysis is like having a compass à it tells the company.
The process of (qualitative) market analysis
Example: Interview a group of customers to understand their views on sustainability in a cosmetics
collection.
Sometimes it precedes quantitative analysis for exploratory purposes: define the contours of the problem;
develop working hypotheses; identify variables and relationships to explore further.
à this means that sometimes it might appear that the problem is the product, but sometimes it’s just about
hearing and understanding customers’ opinions.
What it collects: opinions, motivations, perceptions, attitudes.
How: in-depth interviews, focus groups (a small group of people discuss under the
guidance of a moderator), and observations.
Objective: To understand the reasons behind consumer choices (ideas, emotions, values).
The process of (quantitative) market analysis
This analysis is different from qualitative, but it’s still fundamental.
Information sources
Primary Data:
We specifically collect them for our purpose.
Example: If we want to know what customers think of a new product, we conduct a survey or interview.
Secondary Data:
They already exist but have been collected for other purposes.
For example: internal company data (invoices, CRM, social media, call center) or external sources (Istat,
AIDA, Google, Nielsen, etc.).
Types of information
Secondary
Data (AIDA,
Istat)
Primary
Data
(Survey)
Classification data
Example: age, education, nationality, sector, company size, revenue YES YES
Opinions
Examples: values, opinions, lifestyle, satisfaction.
Behaviors
Examples: purchases (frequency and quantity)
YES (observed
data)
(declared
data)
Data Science and ML (Machine Learning) platforms: main players
This is one of the most well-known representation of data science
and machine learning companies that build software for data
analysis.
Picture: Gartner 2021 Magic Quadrant for Data Science and
Machine Learning Platforms.
Data Science Software Classification
By Application à statistics, machine learning, deep learning, data
mining, text analytics… One platform can support multiple
applications.
By Commercial Policy – how the software is distributed
licensing costs.
Interface – how users interact with the software
Example :
Why we can’t study everyone
Studying the entire population is often impractical (too costly, time-consuming, or even impossible).
Example :
You want to know what all Coca-Cola consumers think in 2024
è Solution: So we usually use a sample!
Sampling
Sampling is the process through which we select
cases from a population. The most important aspect
of sampling is that the selected sample is
representative of the population. Representative
means that the characteristics of the sample closely
match those of the population.
Probability sampling a pproaches provide every
individual in the population with a chance (not equal
to zero) of being included in the sample.
Non-probability sampling procedures do not give
every individual in the population an equal chance
of being included in the sample.
A good sample speaks for all
The sample should reflect the diversity of all population. The sample must be representative:
Example : a representative sample for coca-cola mean:
à This way, what we learn from the sample can be generalised to all Coca-Cola consumers.
An example of a non-representative (biased) sample:
streetwear.
Probabilistic Sampling
Choosing the Right Sample Method
Non-probabilistic Sampling
(roughly 10,000 units or more).
Example: If the population is made of 100.000 or 10.000 consumers, then a sample of 400-500 units is
enough in both the cases.
Accuracy vs. Precision
Consider a target with a centre, where the center represent the real
value of the population and the shots (arrows or balls) represent the
estimates obtained from the sample. Then, accuracy means that the
shots are close to the centre of the target (the estimates are close to
the real value of the population). Precision means that the shots are close to each other, even if they don’t hit
the centre (the estimates from different samples are very similar, and so they have low variability).
Common exam traps 🚨
❌ “A larger population requires a larger sample” → False
❌ “400 observations are too few for 100,000 people” → False
✅ “Representativeness is more important than size” → True
Survey
Data is the core of the analysis. A survey is a method to collect data.
à A survey is a collection of primary data through structured interviews with a sample of subjects.
Survey Alternatives
possibility);
Survey Advantages
à Surveys = depth + representativeness
Phases of a Survey
diagnostic, predictive), expected results, population, sample.
à Secide what you want to know → prepare → ask → analyze → report
Contact Method
Having an interviewer ensures more accurate and reliable responses, but it makes the process more
expensive + bias.
Construction of the Questionnaire
à Fundamental principles: clarity, simplicity, brevity
1. What to ask
a. Identify information of primary and secondary interest
b. Example : opinions, habits, satisfaction.
2. Questionnaire structure
a. Put questions in a clear order.
b. Example : start with opinions → then behaviours → then demographics
3. How to ask
a. Example : open/closed questions, scales (1–5), include “I don’t know”.
à Decide the content → order it well → choose how to ask
Question Formulation: Recommendations
Key Takeaways:
making, while statistics ensures interpretability.
observations are often sufficient.
Binary Data
dummy variables , indicating the presence (1) or
absence (0) of a certain characteristic
possible to transform nominal categorical data into
numerical data.
Data Type Summary Diagram
Data Munging: Cleaning & Transformation
Data Cleaning - Examples:
o Impossible values: Age = 999 → error → replace with missing or from the record
o Missing values: Preferred brand = NULL → decide whether to impute or drop the row
o Standardizing formats: “zappalà” → “Zappalà”
o Out-of-scale responses: “pizza” is not a valid frequency → flag as error or recode
Data Cleaning - Missing Values
Missing data is a problem for many analyses.
o In Survey data: inapplicable questions, total or
partial non-response
o In Official data: non-publication
o In General: technical errors, mistakes
Outlier
Outliers are numbers in a dataset that are very different from all the others.
The key question is: Why is that number so different?
In some fields (like fraud detection in banking), finding outliers is the main goal of the analysis.
Example: Pizza expenditure, you want to know how much money your friends spend on a pizza
an outlier , as it does not reflect typical behavior
Why consider outliers:
o Ex. à Mean with outlier: (10+12+9+11+200)/5 = 48 → misleading, it gives the wrong idea
that my friends spend €48 each on pizza
Identifying and treating outliers
Ourliers can be identifies by statistical tools. They should not be ignored à they can be errors, but also
valuable information!
o error → eliminate,
o real but extreme value → ranking or capping.
§ Corrected by ranking or capping :
§ Ranking : exclude 200 → mean = 10.5. 200 is not considered for the mean
(but we specify that is the highest value) à (10 + 12 + 9 + 11) / 4 = 10,
§ Capping : replace 200 with next highest (12) → mean = 10.8. 200 is
substituted with the other highest value (in this case 12=
Example:
A histogram of customer ages may group ages into intervals:
15 – 24, 25–34, 35–44, etc.
3. Probability
Probability in Everyday Life
We use probabilities to describe uncertainty:
Definition
difficult it is for something to happen
o 0 → impossible event
o 1 → certain event
o Between 0 and 1 → varying degrees of likelihood
Example: Coin Toss
à If we toss a coin many times, we expect about half to be heads, but the exact proportion may vary
for small numbers of tosses.
4. Experimental Probability and Relative Frequency (results)
When we actually perform an experiment (e.g., tossing a coin 20 times), the observed results ( relative
frequency ) may differ slightly from the theoretical probability.
Example :
20 coin tosses → 9 Heads
This might not be exactly 0.5 (50%), but as the number of trials increases , it gets closer to the true
probability.
Law of Large Numbers
As the number of experiments increases indefinitely, the relative frequency converges to the
theoretical probability.
The relative frequency = probability
When the number of tosses tend to infinity.
Seeing Theory – Ch. 1 Basic Probability https://seeing-theory.brown.edu/basic-probability/index.html
This chapter is an introduction to the basic concepts of probability theory.
Chance Events
Randomness is all around us. Probability theory is the mathematical framework that allows us to analyze
chance events in a logically sound manner. The probability of an event is a number indicating how likely that
event will occur. This number is always between 0 and 1, where 0 indicates impossibility and 1 indicates
certainty.
A classic example of a probabilistic experiment is a fair coin toss , in which the two possible outcomes are
heads or tails. In this case, the probability of flipping a head or a tail is 1/2. In an actual series of coin tosses,
we may get more or less than exactly 50% heads. But as the number of flips increases, the long-run
frequency of heads is bound to get closer and closer to 50%.
Expectation
The expectation of a random variable is a number that attempts to capture the center of that random
variable's distribution. It can be interpreted as the long-run average of many independent samples from the
given distribution. More precisely, it is defined as the probability-weighted sum of all possible values in the
random variable's support,
Variance
Whereas expectation provides a measure of centrality, the variance of a random variable quantifies the
spread of that random variable's distribution. The variance is the average value of the squared difference
between the random variable and its expectation,
5. Basic Probability Rules
Concept Example Probability
Certain Event P (Head or Tail) = 1 (or 100%)
Impossible Event P (rolling a 7 on dice) = 0
Between 0 and 1 – closer to 1=more likely; 0=less likely P (raining tomorrow) = 0.
Sum Rule - The sum of the probabilities of all possible events is 1 P(Head) + P(Tail) = 1 = 1
Interpretation:
All possible outcomes of an experiment together must add up to a total probability of 1.
6. Frequency Distributions vs Probability Distributions
Aspect Frequency Distribution Probability Distribution
Based on Observed (sample) data Theoretical model
Purpose Describe what we observe Predict or model what could happen
Values Counts or percentages Probabilities that sum to 1
Many curves of different shapes exist to model different
phenomena:
o Mean (μ) → the center
o Standard Deviation ( 𝛔
𝟐
) → the spread, variance
Properties
Examples of normally distributed variables:
Examples of non-normal variables
Using Probability Distributions
What is the probability of values between a and b?
What is the probability of values greater (or less) than a?
standard normal distribution
Example of application of the normal
Suppose the number of customers per day at a store follows an approximately normal distribution with:
We can write this as:
i ~ 𝑁
'
This means:
Question
What is the probability that there are more than 700 customers in a day?
What is the probability that in X>700 (in 𝑁(750; 100
'
What is the area to the right of 700 (𝑁(750; 100
'
Answer
Interpretation:
There’s a 69.15% chance that more than 700 customers will visit the store in a day.
9. Standard Normal Distribution
A special case of the normal distribution where:
This is denoted as:
Any normal variable can be standardized (converted to Z) using:
This makes it easier to look up probabilities using Z-tables or software.