0% found this document useful (0 votes)
14 views33 pages

Data Visualization in Economics: Key Concepts

The document outlines a Skill Based Course on Data Visualization for B.A. Economics students, focusing on data types, visualization principles, and data storage formats. It emphasizes the importance of effective data visualization for understanding complex datasets and making informed decisions in economics and policy analysis. Key topics include the classification of data types, the process of transforming data into visual formats, and the significance of good visual design principles.

Uploaded by

rajasco3112
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views33 pages

Data Visualization in Economics: Key Concepts

The document outlines a Skill Based Course on Data Visualization for B.A. Economics students, focusing on data types, visualization principles, and data storage formats. It emphasizes the importance of effective data visualization for understanding complex datasets and making informed decisions in economics and policy analysis. Key topics include the classification of data types, the process of transforming data into visual formats, and the significance of good visual design principles.

Uploaded by

rajasco3112
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data Visualization

B.A. (Programme) Economics


Semester-VII
Skill Based Course (SBC)

Course Credit-2
AS PER THE UGCF-2022 AND NATIONAL EDUCATION POLICY 2020

READING NOTES
Table of Content

Sl. No. Title Page No.

Unit-I

Lesson 1 Data Types, Data Attributes, and Data Storage Formats 1-10

Unit-II

Lesson 2 From Data to Visualization & Principles of Good Visual Design 11-20

Lesson 3 Data Wrangling and the Art of Persuading with Data 21-31
Unit-I
Lesson 1

Data Types, Data Attributes, and Data Storage Formats

Introduction
Data visualization is the graphical representation of information and data, using visual elements
like charts, graphs, and maps to help people understand complex datasets easily and quickly.
The main goal is to communicate information clearly and efficiently, allowing audiences to
detect patterns, trends, and relationships that are often hidden in raw data. For economists and
social scientists, visualization is crucial, as it enables effective storytelling, decision-making,
and the presentation of evidence in research and policy analysis.
Data Visualization
• Massive data growth makes it difficult to interpret data without visual tools, and
visualizations can reveal insights that would otherwise be difficult or impossible to
detect in spreadsheets or tables.
• Data visualization also enhances communication, making reports more appealing,
informative, and persuasive for both technical and non-specialist audiences.
• Effective visualization should prioritize clarity, remove unnecessary elements, and
convey the intended message with minimal ambiguity
Brief History
• Early data visualizations date back to maps, charts of astronomical data, and the first
statistical graphics in the 17th to 19th centuries.
• The 19th and 20th centuries saw the development of core principles, including the use
of color, shape, and position to encode information and the invention of many chart
types still in use today.
• In recent decades, the field has grown rapidly due to advances in computing and
software, allowing for interactive and high-dimensional data graphics and expanding
access to visualization tools.
What Makes Visualization Effective?
• Informative: Conveys the desired information from the data to the reader, highlighting
key findings or relationships.
• Efficient and Clear: Avoids ambiguity and reduces the chance of misinterpretation by
using appropriate chart types, scales, and labels.
• Attractive and Engaging: Well-designed visuals attract attention and invite further
exploration while supporting the overall narrative.

1
• Interactive: Modern visualizations may allow users to filter, drill down, or explore data
dynamically, supporting better understanding.
Relevance for Economics and Policy
• Enables exploration of trends (such as unemployment or GDP growth), comparison
across groups, and displays of relationships between economic variables in ways textual
summaries cannot easily match.
• Supports argumentation in research, presentations, and policymaking, where clear and
compelling figures can influence understanding and decisions.
A strong introduction to data visualization should highlight its foundational role in
contemporary data analysis, the key features of effective charts, and its growing necessity for
students and professionals in economics and the social sciences.
Data Types
Data types is the starting point for understanding how to organise, analyse, and visualise
information in any empirical discipline, including economics and the social sciences. Data type
simply means “what kind of values” a variable can take and “how those values can be
meaningfully compared.” This classification matters because it determines which summary
measures, statistical methods, and graphical forms are appropriate and which would be
misleading or meaningless.
Broadly, data are divided into quantitative (numerical) and qualitative (categorical).
Quantitative data record magnitudes or amounts—such as income, age, test scores, or inflation
rates—and can usually be added, averaged, and compared using arithmetic operations. Within
this group, continuous data can take any value in a range (for example, wage rates or heights),
while discrete data take separate, countable values (for example, number of children or number
of employees). Qualitative or categorical data, by contrast, classify observations into groups or
labels—such as gender, state, occupation, or type of firm—and are interpreted in terms of
membership rather than magnitude.
A more refined way to think about data types is through measurement scales: nominal, ordinal,
interval, and ratio. Nominal data distinguish categories without any inherent order (for instance,
districts or industries), whereas ordinal data impose a meaningful ranking (for example, “low,”
“medium,” and “high” satisfaction), but the exact distance between ranks is not defined.
Interval data have ordered values with equal intervals but no true zero (a common example is
temperature in Celsius), while ratio data have all the properties of interval data plus a
meaningful zero, so ratios like “twice as much” are interpretable (income, expenditure, and
quantities are typically ratio scale). Recognising the scale prevents mistakes such as computing
averages of nominal codes or using bar lengths to represent unordered labels.
For a first lesson, it is useful to link data types directly to both statistical and visual practice.
Once students identify whether a variable is quantitative or categorical and what scale it uses,
they can decide: Should they compute means or only medians and percentages? Should they
draw histograms, boxplots, and line charts, or bar charts and pie charts? In this way,

2
“Introduction to data types” becomes not just a set of definitions but a conceptual tool that
guides every later choice in data handling, analysis, and visualization.
1. Why data types matter
• Data type tells you what operations are meaningful (e.g. can you average it? can you
rank it?).
• Correct identification prevents common mistakes such as calculating means of nominal
codes or using a line chart for unordered categories.
• In visualization, different data types naturally pair with different charts: histograms and
scatterplots for numerical data, bar charts and mosaic plots for categorical data, etc.
Main divisions: quantitative vs qualitative
1. Quantitative (numerical) data
• Represent amounts or magnitudes.
• Arithmetic operations (addition, average, ratios) have meaning.
• Examples: income, marks, age, GDP, price, quantity produced.
2. Qualitative (categorical) data
• Represent labels, attributes, or groups.
• You typically count frequencies or percentages, not averages.
• Examples: gender, occupation, state, type of firm, sector (public/private).
3. Sub-types of quantitative data
1. Continuous data
• Can take any value in an interval (theoretically infinitely many possible values).
• Typical in measurements: height, weight, wage rate, interest rate, GDP per
capita.
• Visualisation: histograms, density plots, boxplots, line charts over time.
2. Discrete data
• Take separate, countable values (often integers).
• Typical in counts: number of children, number of firms, number of accidents.
• Visualisation: bar charts of counts, dot plots, step charts for time series.
4. Sub-types of categorical data
1. Nominal data
• Categories have no intrinsic order.

3
• Examples: religion, region, brand name, district code, blood group.
• Analysis: counts, mode, proportions; comparisons via bar charts or pie charts.
2. Ordinal data
• Categories have a clear order, but gaps between them are not precisely defined.
• Examples: education level (primary/secondary/graduate), satisfaction
(low/medium/high), credit rating grades.
• Analysis: medians, percentiles, non-parametric methods; visualisation with
ordered bar charts or stacked bars.
5. Measurement scales and what they allow
1. Nominal scale
• Only equality/inequality (“same or different”) is meaningful.
• No natural ordering, no meaningful arithmetic.
2. Ordinal scale
• Rank order is meaningful (“greater than/less than” in terms of level).
• Distance between ranks is not numerically defined.
3. Interval scale
• Ordered with equal intervals, but zero is arbitrary.
• Example often given: temperature in Celsius; difference of 10 degrees has
meaning, but “twice as hot” does not.
• You can add and subtract, but ratios are not meaningful.
4. Ratio scale
• Has all interval properties plus a true zero that indicates absence of the quantity.
• Most economic variables (income, output, consumption, cost, price, quantity)
are ratio-scale.
• All arithmetic, including ratios (“twice as much”), is meaningful.
6. Data types and typical questions
• For numerical data, you ask: What is the average? How spread out are values? Is there
a trend over time? Is variable X related to Y?
• For categorical data, you ask: How many in each group? What share belongs to each
category? Are two classifications associated (e.g. gender and employment status)?
• For mixed situations (one numerical, one categorical) you ask: How does the numerical
outcome differ across groups (e.g. average wage by education or by state)?
4
7. Data types and choice of visuals
• Numerical, single variable → histogram, density plot, boxplot.
• Categorical, single variable → bar chart of counts or percentages.
• Numerical vs numerical → scatterplot, with possible trend line.
• Numerical vs categorical → grouped boxplots, grouped bar/dot plots, small multiples.
• Categorical vs categorical → stacked or clustered bar charts, mosaic plots, heatmaps.
8. Classroom emphasis points (for notes)
• Always begin any analysis by writing down: variable name, description, unit, and data
type.
• Warn students that the same underlying concept can be stored in different ways: e.g.
“Male/Female” as text or as codes 0/1 is still categorical, not numerical in the analytic
sense.
• Stress that correct understanding of data types is the bridge between raw data, correct
summary statistics, and good visualisation and modelling choices.
From Data to Visualization
From data to visualization means moving step-by-step from raw values and variables to clear,
well-designed graphs that answer a specific question. A good lesson for DU students can be
organised as: (1) deciding what you want to show, (2) choosing the right graph for the data, (3)
mapping data to visual elements, and (4) applying principles of good visual design.
1. From data to graph: key steps
• Clarify the purpose
• What is the question? (e.g. “Are wages higher for graduates?”, “How has
inflation changed over time?”).
• Who is the audience? (peers, policymakers, general readers).
• Understand the data
• Identify variable types: numerical vs categorical, time series vs cross-section,
panel, etc.
• Check data quality: missing values, outliers, inconsistent codes.
• Choose the type of relationship to show
• Distribution of one variable (e.g. income distribution).
• Comparison between groups (e.g. rural vs urban unemployment).
• Relationship/association (e.g. education vs wages).

5
• Change over time (e.g. GDP growth over years).
• Composition (parts of a whole, e.g. sectoral share in GDP).
2. Choosing an appropriate graph
• For distributions (single numerical variable)
• Histogram, density plot, or boxplot.
• Use these to show centre, spread, outliers, and shape (skewness, multimodality).
• For comparisons across categories
• Bar chart or dot plot (for means, totals, or percentages).
• Grouped or stacked bars for multiple categories.
• For relationships between two numerical variables
• Scatterplot, possibly with a fitted line or smooth curve.
• Bubble plots only when size adds real information, not decoration.
• For change over time
• Line graph (time on x-axis, variable on y-axis).
• Multiple lines or small multiples for different groups or regions.
• For composition (parts of a whole)
• Stacked bar charts, 100% stacked bars, or area charts.
• Avoid pie charts when there are many small slices or when precise comparison
is needed.
3. Mapping data to visual elements (“encodings”)
• Position
• Most accurate way to encode quantitative values (e.g. vertical position of
points/bars).
• Prefer aligned scales for easy comparison.
• Length, angle, and area
• Length (bar height) is usually easy to compare.
• Angles (as in pie charts) and areas (bubbles) are harder to judge; use sparingly.
• Color
• Use hue (different colours) to distinguish categories.
• Use light–dark intensity to show ordered or numerical values.

6
• Keep colour-blind-friendly palettes in mind and avoid unnecessary rainbow
schemes.
• Shape and line type
• Use different shapes for points or different line styles (solid, dashed) to
distinguish groups.
• Do not overuse shapes; too many types confuse rather than clarify.
4. Principles of good visual design
• Show the data clearly
• Data should be the most prominent element; avoid 3D effects and heavy
shading.
• Use appropriate scales, starting at zero for bar charts unless there is a strong
reason not to.
• Avoid misleading axis breaks and distorted aspect ratios.
• Reduce clutter (“declutter the chart”)
• Remove unnecessary gridlines, borders, background colours, and repeated
labels.
• Use light, thin gridlines only where they help reading values.
• Limit the number of colours and line styles to what is needed for the message.
• Emphasise what matters
• Use colour, bold text, or annotations to highlight key points or series.
• Put important lines on top of others; use thicker or darker strokes for focus
series.
• Add short notes directly on the plot (e.g. “Policy change in 2016”) rather than
only in the caption.
• Make the graph self-explanatory
• Clear title that states the message, not just the variable name (e.g. “Real wages
have stagnated since 2015”).
• Proper axis labels with units (%, rupees, index=100, etc.).
• Legend placed close to the data, or use direct labelling instead of a separate
legend when possible.
• Ensure consistency and readability
• Use consistent scales, colours, and formats across multiple graphs in the same
document.
7
• Choose readable font sizes; avoid mixing too many font families.
• Maintain adequate white space; don’t cram too much information into one chart.
5. Common pitfalls to warn students about
• Using the wrong chart for the data type (e.g. line chart for unordered categories).
• Using too many categories or series in one graph, making it impossible to read.
• Over-reliance on default settings in software, leading to cluttered or misleading visuals.
• Ignoring the audience: overly technical graphs for non-technical readers, or
oversimplified graphs for technical audiences.
These notes give a compact “pipeline” view: start from a clear question, understand the data,
choose the right graph type, map variables to visual elements, and then refine the figure using
principles of good design so that the final visualization is honest, clear, and persuasive.
Data Storage
Data storage refers to how datasets are organized, saved, and structured on disk or in memory
so that they can be read, manipulated, and visualized by software tools. For economics students,
understanding storage formats is crucial because real-world data from surveys, administrative
records, or official sources often arrive in messy or non-standard forms, and converting them
to clean, visualization-ready structures is a key first step in analysis.
Common Data Storage Formats
• Text-based formats (CSV, TSV)
• CSV (Comma-Separated Values): Each row is an observation; columns
separated by commas. Simple, lightweight, readable in any text editor.
• TSV (Tab-Separated Values): Same idea, tabs as separators.
• Pros: Universal compatibility, small file size, no proprietary software needed.
• Cons: No built-in data types (everything reads as text), no formulas or metadata.
• Example: NSSO household survey data often distributed as CSV files.
• Spreadsheet formats (Excel .xlsx, .xls; Google Sheets; LibreOffice)
• Store data in worksheets with cells, supporting formulas, formatting, multiple
sheets.
• Pros: User-friendly for entry, exploration, basic charts; familiar to most users.
• Cons: Prone to "messy" structures (titles in data cells, merged cells, inconsistent
formatting); version issues; large file sizes.
• Warning: Excel can alter dates or numbers unexpectedly when reopening files.
• Statistical software formats
8
• R (.rds, .RData): Native R formats preserving data types, factors, dates.
• Stata (.dta): Common in economics; stores variable labels, value labels.
• SPSS (.sav), SAS: Similar, with metadata.
• Pros: Retain data types, labels, and analysis history.
• Cons: Software-specific; need conversion for other tools.
• Database formats
• SQL databases (SQLite, MySQL, PostgreSQL): Tables with rows/columns,
relationships via keys.
• HDF5, Feather: For large datasets, fast read/write.
• Pros: Handle millions of rows efficiently; support queries.
• Cons: Require database software or connectors.
Data Structures for Visualization
• Tidy (long) data
• Each variable = one column; each observation = one row; each table = one type
of observational unit.
• Ideal for ggplot2, matplotlib, most plotting libraries.
• Example: Panel data with columns: id, year, income, education.
• Wide data
• Multiple variables in columns (e.g., income_2010, income_2011).
• Common in spreadsheets; harder for faceting/grouping in plots.
• Convert to tidy format using "melt" or "pivot_longer" functions.
Key Principles for Visualization-Ready Storage
• Rectangular structure: One dataset = one table with consistent rows/columns. No
headers/totals mixed with data.
• Consistent naming: Snake_case or CamelCase; no spaces/special characters in column
names.
• Explicit data types: Numbers as numeric (not text); categories as factors/strings; dates
as date format.
• No missing value ambiguity: Use NA, blank, or -999 consistently, not random codes.
• Self-documenting: Include a separate README or data dictionary explaining
variables, units, source, codes.

9
Economics-Specific Storage Examples

Source Typical Common Issues Solution


Format

NSSO/RBI CSV/Excel Multi-sheet, codes in Read specific sheets; recode


surveys text factors

World Bank/Open CSV/API Wide format, metadata Skip rows; pivot to long
Data rows

Administrative Stata/Excel Variable labels in Use haven::read_dta(); merge


data separate files metadata

Panel data Stata/CSV ID-year structure messy Reshape to tidy panel format
(firms/households)

Tools for Handling Storage Formats


• Free/universal: CSV readers in every language; LibreOffice for Excel.
• R: readr (fast CSV), readxl (Excel), haven (Stata/SPSS/SAS), DBI (databases).
• Python: pandas (all formats), openpyxl (Excel).
• Excel/LibreOffice: For small datasets and initial cleaning.
Conclusion
Mastering data types, attributes, storage formats, and free software forms the essential
foundation for effective data visualization and analysis in economics, ensuring that every graph
or model starts from clean, interpretable data rather than assumptions or errors.
Key takeaways include recognizing quantitative (continuous/discrete) versus qualitative
(nominal/ordinal) types and their measurement scales (nominal to ratio), which dictate valid
operations, statistics, and plots; understanding attributes like role (explanatory/outcome),
structure (cross-section, time series, panel), and relationships (distribution, comparison,
association); and structuring data in tidy rectangular formats (CSV preferred) over messy
spreadsheets to enable seamless workflows.
Freely available tools such as R with ggplot2 and tidyverse, RStudio, LibreOffice Calc, and
Python's pandas/matplotlib democratize high-quality visualization, allowing DU students to
produce reproducible, professional graphics without cost barriers.
In practice, this knowledge pipeline—classify types/attributes → tidy storage → plot in free
software—transforms raw NSSO or World Bank data into compelling evidence for research
papers, policy briefs, or exams, bridging theory and empirical storytelling.

10
Unit-II
Lesson 2

From Data to Visualization & Principles of Good Visual Design

The Power and Purpose of Data Visualization


Modern decision-making—whether in economics, business, science, or public policy—is
rooted in evidence. However, evidence in numerical form does not speak fluently to all
audiences. A table of 10,000 rows and 25 columns may carry the truth, but without
interpretation it carries little impact. Visualization exists to amplify that truth, not replace it. It
converts abstract measurements into digestible structures that human cognition can interpret
faster than raw symbols. Studies in cognitive psychology show that the brain processes visuals
60,000 times faster than text—hence visualization is a channel that accelerates understanding,
reduces ambiguity, and helps audiences detect structure in data without additional explanation.
Visualization serves four major purposes:
1. Sense-making – enabling the analyst to discover patterns, anomalies, clusters and
trends.
2. Communication – allowing findings to be transmitted without technical overload.
3. Memory retention – visual structures are recalled more easily than numerical
sequences.
4. Persuasion through evidence – visuals increase confidence when they truthfully
translate data.
The golden rule that governs all visualization design is:
A visualization must reveal the truth, not decorate it.
2. Understanding Data: The Raw Material for Visualization
Data can be categorized in multiple ways, but for visualization design we focus on structure
and measurement scale, as these determine what charts the data can legitimately support.
2.1 Types of Data Based on Structure
• Cross-sectional data – collected at a single point in time across many units (e.g.,
consumer expenditure across 500 households).
• Time-series data – collected over intervals of time for one unit or aggregated units
(e.g., quarterly GDP values).
• Panel/longitudinal data – a mix of both, tracking multiple units over time (e.g., firm-
level productivity from 2015 to 2025).
Managed through software like STATA, and structured in tools such as SQL databases.

11
2.2 Types of Data Based on Measurement Scale
Understanding measurement scale prevents visual distortion:

Scale Permitted
Nature of variable Examples
Type comparisons

Nominal Categories without order Equality only Gender, region, product type

Order but not Rating scales: low < medium


Ordinal Categories with ranking
magnitude < high

Numeric, uniform scale, no Difference but not


Interval Temperature (°C, °F)
true zero ratio

Numeric, uniform scale, has Sales, income, age,


Ratio Difference + ratio
true zero population

Only ratio data should be compared using length-based charts where the axis begins at
zero.
Interval or ordinal data visualized with bar lengths starting at zero may imply false ratios and
must be avoided.
2.3 The Responsibility of Data Cleaning Before Visualization
A chart built on dirty data is a confidently articulated lie. Therefore, visualization must always
be preceded by structured cleaning:
• Removing duplicates
• Handling missing values (through deletion or statistically supported imputation)
• Correcting data entry errors
• Standardizing units (₹, $, %, kg, liters, etc.)
• Summarizing when needed (mean, median, totals, rates, proportions)
• Transforming when needed (log scale, growth rates, indexing)
This stage is executed using tools like Pandas, and Excel Power Query.
3. The Visualization Pipeline: From Numbers to Narrative
Visualization is not a single act but a systematic translation process involving these connected
phases:
1. Problem definition → What question should this data answer?
2. Data preparation → Is data clean and structured correctly?
3. Chart mapping → What visual form best represents the answer?

12
4. Design encoding → What design principles ensure comprehension?
5. Refinement → Is the chart simple, honest, readable?
This pipeline ensures that visualization remains insight-driven rather than tool-driven. The
question leads the design—not the default templates of the software.
4. Matching Data Questions to Graph Types
Before selecting a chart, we must identify the underlying analytical question the audience is
unconsciously trying to ask while viewing the visualization.
4.1 Questions of Comparison
Used when the audience wants to know differences between categories.

Chart Best for Limitations Tools

Bar/Column Comparing discrete Misleading if axis does not begin at Excel


Chart categories zero for ratio data Charts

Cleaner variant for ranked


Lollipop Chart Less ideal for showing volume Plotly
comparisons

4.2 Questions of Trends Over Time


Used when the question involves movement across time.

Chart Best for Limitations Tools

Line Continuous movements,


Hard to read if too many lines overlap Matplotlib
Chart seasonality, growth

Area Can visually exaggerate if


Trend + magnitude Power BI
Chart transparency is misused

4.3 Questions of Distribution


Used when the question involves spread, central tendency and outliers.

Chart Best for Tools

Histogram Frequency distribution Pandas

Box Plot Median, quartiles, outliers Tableau

Density Plot Smoothed distribution trends R ggplot2

4.4 Questions of Relationships


Used when variables influence or move with each other.

13
Chart Best for Tools

Scatter Plot Correlation, clusters, patterns R ggplot2

Bubble Chart Relationship + third variable weight Plotly

Heatmap Intensity of relationship Power BI

4.5 Questions of Composition (Parts of Whole)


Shows proportions.

Chart Best for Limitations Tools

Stacked Bar / 100% Proportion comparison Hard to read if segments are


Tableau
Stacked Bar within categories unordered

Simple 2-3 segment Misleading beyond 5+ Excel


Pie/Donut Chart
composition segments Charts

Important Note: Pie charts should be used only when proportions are highly distinct and few
in number, otherwise magnitude comparisons fail.
5. Encoding Insight in Design: The Science of How We Read Visuals
Visualization leverages visual encoding channels—properties of a graph that represent data.
Choosing correct encoding ensures both comprehension speed and interpretation accuracy.

Encoding Channel Suitable for Example

Position on scale Most accurate perception Line intersections, scatter points

Length Precise for ratio comparisons Bar height comparison

Angle Weak for magnitude comparison Pie chart slices

Area/Size Moderate perception accuracy Bubble size

Color intensity Best for heat-based encoding Gradient heatmaps

Shape Best for nominal distinction Scatter plot categories

Position and length are the most cognitively precise channels; angle and 3D representations are
among the weakest and most distortion-prone.

14
6. Principles of Good Visual Design
Now that we understand data and chart selection, we define design laws that separate good
visualization from bad visualization. These principles are not subjective—they are rooted in
human perception, ethics of representation, and communication efficiency.
6.1 Principle 1: Clarity is the highest design goal
A chart must be self-explanatory. If the sender has to verbally decode the graph, the design has
failed. This means:
• Eliminating 3D effects unless structurally necessary
• Reducing non-data ink (borders, grid lines, background noise)
• Avoiding chart junk (clip art, heavy gradients, decorative photographs)
• Preventing legend dependence—direct labels are better when possible
6.2 Principle 2: Honesty in scale
Manipulated axes mislead even when data is correct. Two major rules govern honesty:
1. Bars using ratio data must start at zero
2. Time-series comparisons must remain proportionally scaled
Distorted example: starting a bar axis at 50 instead of 0 makes a 60 vs 80 comparison visually
appear 6× larger, implying a false ratio.
6.3 Principle 3: Use of Pre-attentive Attributes
These are design elements interpreted almost instantly without conscious effort. They include:
• Length
• Position
• Direction
• Size
• Contrast
• Color grouping (when consistent)
They must be used to highlight insight, not distract.
6.4 Principle 4: Visual hierarchy
A chart must guide the eye logically:
1. Title (insight message)
2. Visual comparison / pattern
3. Axis and labels
15
4. Source and annotations
The title must communicate a takeaway, not describe a task.
Weak title: “Company Sales Chart”
Strong title: “Sales grew 35% after price discount strategy”
6.5 Principle 5: Color must serve meaning
Color must help, not confuse:
• Limit palette to 5 or fewer colors unless encoding gradients
• Maintain consistent color legend mapping
• Avoid red/green dependence (not accessible to color-blind readers)
• Never use colors that imply emotional bias unless representing alert levels
Use palettes similar to those supported by systems like ColorBrewer.
6.6 Principle 6: Typography rules
• No font smaller than 8pt
• Avoid ALL CAPS sentences
• Don’t rotate text unless unavoidable
• Maintain consistent font family discipline
Professional chart typography is maintained in tools like Adobe Illustrator.
6.7 Principle 7: Simplicity reduces cognitive load
Ask before finalizing the chart:

Can it be understood in 5 seconds?


Does every element serve data meaning?
Is anything ornamental rather than analytical?

If the answer is no, revise.


6.8 Principle 8: Context must accompany visuals
Numbers alone mislead without explaining why they matter.
Therefore, good visualizations also include:
• Light annotations
• Benchmarks or reference lines when needed
• Brief captions when complexity is unavoidable
• Sources (survey, database, experiment, etc.)
16
6.9 Principle 9: Avoid illusionary correlations
Just because software can generate a pattern does not mean the data supports it. Analysts must
confirm validity before visual relationships are published.
For example, a scatter plot visually showing clustering does not imply causal correlation unless
supported by statistical results like OLS Regression, ANOVA, or other inferential methods.
7. Common Visualization Mistakes (With Explanation)

Mistake Why it happens Why it is harmful

Using pie charts for 10 Software defaults encourage Humans cannot compare angles
categories it precisely

Starting bar axis above zero Designer tries zoom-in effect It exaggerates difference falsely

Beauty attempt without


Using too many colors Viewers lose mapping clarity
discipline

It distorts area and depth


Using 3D charts To look visually rich
perception

Analyst focuses on task not Audience cannot decode


No insight title
message takeaway

Overplotting many trend Creates unreadable noise instead


Trying to show everything
lines of signal

8. Visualization Tools Ecosystem for Practitioners


• Beginners typically start in: Google Sheets
• Economists and statisticians typically plot in: R ggplot2
• Python practitioners visualize in: Matplotlib and improve data structuring in Pandas
• Enterprise analytics dashboards are built in: Power BI
• High-quality publication visuals are refined in: Adobe Illustrator or Tableau
9. Visualization Ethics: The Moral Contract with the Audience
Designing charts carries ethical responsibility because humans rarely double-verify numeric
values once visual perception gives them an instant conclusion. Therefore:
1. Charts must not intentionally exaggerate or minimize differences
2. Visual proportions must not contradict numeric truth
3. Axes must respect measurement scale

17
4. Colors must not emotionally manipulate interpretation
5. Patterns shown must reflect real data structure, not illusionary AI-assumed
insights
Ethical visualization does not manipulate perception, it designs for precise perception.
10. Practical Example Walkthrough (Narrative Explanation)
Consider a firm that tracks monthly revenue:

Month Revenue (₹ lakh)

Jan 48

Feb 52

Mar 55

Apr 49

May 63

Jun 72

Analysis question: When did revenue peak and what pattern is visible over time?
Design choice:
• A line chart is better than bars because months represent sequential time.
• Bars starting at zero create exaggerated heights visually, whereas trends require
proportional slope.
• Title should encode insight: “Revenue peaked in June, with steady rise before
summer season demand.”
• Labels should remain horizontal and units should be clearly stated as ₹ lakh
• Only crucial grid lines should remain
• Peak point can be gently highlighted or annotated
11. Data Storytelling + Statistical Validation
Some datasets only demand clear visual communication. Others demand statistical proof before
visuals imply a relationship. For such cases, economists verify trend claims using:
• OLS Regression
• Hypothesis tests (t, F, χ², etc.)
• Confidence intervals
• Elasticity measures

18
• Growth indexing
• Correlation matrices
This prevents accidental storytelling based on visual assumption.
12. Rubric for Assessing Visualization Quality

Criteria Question it answers Maximum Score

Clarity Can a reader understand instantly? 20

Accuracy Does it reflect numeric truth? 25

Design Discipline Free from clutter and distortion? 20

Accessibility Is it readable to all users? 15

Insight Communication Is the title meaningful? 20

Total 100

13. Final Guiding Principles Summary (For Chart Creators, Not Short Notes)
Visualization is effective only when it is:
• Insight-driven, not template-driven
• Cognitively precise
• Ethically honest
• Minimal but contextual
• Audience-friendly
• Readable without verbal explanation
• Statistically validated when necessary
Summary
Data visualization is a structured process that transforms raw numbers into meaningful, fast-
to-grasp insights. The visualization workflow begins with data collection (surveys, records,
sensors), followed by data cleaning and processing to remove errors, resolve missing values,
standardize units, and summarize measures such as totals, averages, or rates. Only after data is
analytically prepared should charts be selected, ensuring they align with the question being
answered instead of software defaults.
The choice of visualization depends on the analytical need:
• Comparison across categories is best shown using bar or column charts, created in tools
like Google Sheets or Microsoft Excel.

19
• Trends over time require line or area charts, plotted using systems such as Matplotlib
or dashboard platforms like Power BI.
• Data distribution is visualized through histograms and box plots, structured in Pandas
and explored in Tableau.
• Relationships between variables are displayed via scatter or bubble charts, commonly
designed in R ggplot2.
• Parts of a whole (composition) may use pie or stacked bar charts, but pie charts must
be limited to few, clearly distinct proportions as human perception compares angles
poorly.
Effective visualization design is governed by cognitive clarity and representational ethics. Key
design principles include:
1. Clarity above decoration — avoid 3D effects, heavy grids, or chart junk.
2. Honest scales — bars using ratio data must begin at zero to prevent exaggerated
differences.
3. Pre-attentive processing — leverage position, length, size, direction, and contrast,
which the brain reads instantly.
4. Visual hierarchy — deliver an insight-driven title, readable axes, direct labels, minimal
legend dependence, and concise annotations.
5. Purposeful color — use limited palettes with consistent meaning, avoiding inaccessible
red-green dependence.
6. Legible typography — maintain horizontal alignment, avoid excessive rotation, and
ensure readable font sizes.
Common harmful mistakes arise when:
• Bar axes start above zero, distorting perceived differences.
• Pie charts encode too many similar categories.
• Colors are excessive or inconsistent.
• Visual patterns suggest correlations that are not statistically validated.
For relationship claims, visuals should be supported by statistical methods like OLS regression,
t-tests, or confidence intervals, often estimated using tools such as STATA.
Finally, visualization carries an ethical contract: it must amplify truth without manipulating
perception, reduce cognitive load, communicate insight without verbal decoding, and remain
statistically validated when implying relationships. Publication-ready visuals are refined in
design environments like Adobe Illustrator.

20
Lesson 3

Data Wrangling and the Art of Persuading with Data

Introduction
Economics, at its core, is a science of inference, explanation, and influence. Economists
observe real-world phenomena through data—prices, wages, production levels, consumption
behavior, employment cycles, trade fluctuations, firm growth, and policy outcomes. However,
for data to become evidence and for evidence to become influential, two essential
transformations must occur:
1. The technical transformation: where raw data is cleaned, structured, merged,
reshaped, and validated.
2. The communicative transformation: where insights derived from data are presented
in forms that shape understanding, build trust, and guide decision-making.
The first process is data wrangling. The second is data persuasion—not emotional
persuasion, but logical influence driven by clarity, visual cognition, truthful storytelling, and
statistical backing where required.
Economists do not merely analyze data—they communicate policy implications, market
insights, and behavioral revelations. A powerful dataset poorly communicated may fail to
influence; a modest dataset well-wrangled and honestly visualized can change economic
understanding, business strategy, and public policy.
2. Data Wrangling: The Backbone of Economic Communication
In academic economics, students often handle pre-structured textbook data. In real economic
systems, however, datasets are disorderly. Before data is analyzed or visualized, it must be
transformed to remove distortions that mask economic truth.
2.1 The Real Characteristics of Raw Economic Data
Economic data is fundamentally human-recorded or institution-recorded information and
therefore prone to imperfections such as:
• Multiple naming conventions for the same variable (e.g., “U.P.”, “UP”, “Uttar
Pradesh”)
• Fragmented files emerging from multiple survey enumerators or agencies
• Mixed units for income, expenditure, output, tax, trade statistics
• Non-date formats for time-series variables
• Missing values because respondents choose not to disclose or data fails to record
• Data duplication due to multi-source exports
• Outliers that may represent real economic shocks or errors, and need verification

21
• Non-economic variables that pollute analytical focus until filtered out
Without wrangling, data may contain truth but not meaning.
2.2 The Economics Student’s Data Wrangling Toolkit
While economists must conceptually understand wrangling, practical execution depends on
software environments such as:
• Economic datasets are cleaned, sorted, and transformed using libraries like Pandas
within scripting environments like Python.
• Large national datasets are reshaped and aggregated using distributed processing
systems like Apache Spark.
• Formal economic research datasets are stored and merged using database systems such
as PostgreSQL, queried using SQL.
• Dashboard and data persuasion outputs in public policy, development economics, and
economic communication summaries are visualized using tools like Tableau and Power
BI.
• Print-quality charts for academic papers are refined using design tools such as Adobe
Illustrator.
Each tool serves a purpose in the transformation chain, but the moral duty of economists lies
in the conceptual discipline, not software automation alone.
2.3 Stages of Data Wrangling Explained for Economic Analysis
Stage 1: Data Acquisition
Sources vary widely, for example:
• Household consumption surveys stored in university files
• Education or poverty datasets from repositories such as Kaggle
• Primary data collected via digital surveys conducted on platforms like Google Forms
• Public economic indicators published by institutions like the Reserve Bank or Planning
Commission
Key idea for economists: Data sources must be credible, dated, comparable, and transparent
before acquisition.
Stage 2: Parsing and Format Standardization
Data from different sources comes in formats like:
• CSV exports
• Excel files with multi-sheet storage
• API data
22
• JSON responses
• HTML-scraped government data
• SQL database exports
If raw imports fail to parse correctly, economists may generate mistaken aggregates that look
valid but misrepresent economic conclusions.
Stage 3: Cleaning the Data
This includes:
1. Identifier standardization – Convert “Delhi”, “delhi”, “DEL” into consistent form.
2. Unit consistency – Convert ₹, ₹ lakh, ₹ crore into one unit (preferably lakh or crore for
Indian economics datasets) but ensure the transformation is mathematically
proportional.
3. Date formatting – Time-series must be converted into real date or index format.
4. Duplicate removal – Same household or firm entry repeated twice skews elasticity or
trend graphs.
5. Missing value strategy – Fill or remove only if it maintains validity and economic
truth—otherwise explicitly mark missing.
6. Error correction – Correct impossible numeric entries (e.g., negative age, year 3025,
13th month).
7. Outlier verification – Confirm if it’s a real shock (e.g., pandemic sales collapse) or an
input error.
Design thinking for economics: We fix noise, not behavior.
Stage 4: Reshaping the Data
Raw datasets are reshaped into analytical frames:
• Trend-ready data: Long format (Month/Year on one column)
• Comparison-ready data: Wide summary format (State–income–consumption
aggregates)
• Regression-ready data: Firm-level variables in wide-frame numeric matrix
• Policy segmentation: Data grouped by region, gender, consumption class
• Derived variables creation: Elasticity, price responses, conversion ratio, growth
index, profit rate, consumption rate, etc.
Stage 5: Data Merging and Relational Joins
Economics persuasion often pulls from multiple datasets—for example:

23
• Joining household income survey with household consumption survey
• Joining firm-level inputs with firm-level outputs
• Mapping state employment data with state GDP data
• Matching trade flows with exchange rate data
This stage is executed using merge logic in platforms like Pandas or relational joins using SQL,
but the economist must define the merge key correctly (household ID, state name, year, etc.).
Wrong merge keys generate visual lies.
3. The Art of Persuading with Data: An Economist’s Communication Language
Persuasion in economics is not emotional—it is logical inevitability created through
presentation clarity, cognitive ease, truthful design, and statistical confirmation.
Economics persuasion exists in three dominant forms: narratives, charts, and validated
economic inference.
3.1 The Four Pillars of Persuasion with Data
Pillar 1: Credibility
• No unseen imputations
• Mentioned data source
• Verified outliers
• Honest preprocessing
• No fabricated charts
Pillar 2: Cognitive Usability
Visualization must minimize thinking effort. The audience must detect:
• Who is being compared?
• What is rising/falling?
• How large is the difference?
• What pattern is significant?
If a graph takes 30 seconds to understand, persuasion is lost.
Pillar 3: Communication Aesthetics
Persuasive charts adopt:
• Minimal visual clutter
• Honest scales
• Eye movement discipline (hierarchy)

24
• Purposeful colors
• Horizontal labels
• Annotated trend points
A chart must look elegant because it is disciplined, not because it is artistic.
Pillar 4: Ethical Interpretation
• Bar charts start at zero only when using ratio scale
• Time trends maintain slope proportionality
• Avoid 3D representations
• Do not imply correlation visually unless backed using regression
• No emotionally sensational color use
3.2 The Persuasion Pipeline for Economists
1. Define the question (e.g., “Do richer households spend proportionally more on
discretionary goods?”)
2. Wrangle the data to answer that question
3. Select a chart that best communicates that question (e.g., scatter for relationship, bars
for category comparison)
4. Encode the answer in the title itself so the chart delivers the conclusion first
5. Label axes clearly and include units
6. Provide light annotations
7. Declare the source at the bottom
8. Validate statistically if required via regression logic or hypothesis testing
4. Visualization Psychology in Economic Influence
Visualization is a cognitive science because it leverages automatic brain-decoding heuristics.
The audience perceives:

Visual Attribute Perception strength order

Position Most accurate

Length 2nd most accurate

Area 3rd

Color grouping 4th

25
Visual Attribute Perception strength order

Angle (pie charts) Weakest

3D depth Highly misleading

Therefore economists prefer:


• Line charts for trends
• Bar/column for category magnitudes
• Scatter for relationships
• Stacked columns for compositions
• Histograms and boxplots for data spread
5. Chart Library with Economics Use-Cases

1. Bar/Column (Comparison Questions)

Examples:
• “Which Indian state produces the highest wheat output?”
• “Which sector employs the most workers?”
• “Which firm has higher input costs?”
Built using: spreadsheet charts like Microsoft Excel charts.

2. Line Charts (Trend Questions)

Examples:
• “GDP movement over 20 quarters”
• “Price trends during inflation cycles”
• “Household demand seasonality”
Built using: Matplotlib.

3. Scatter (Relationship Questions)

Examples:
• “Income vs discretionary spending”
• “Price vs Quantity demanded (for elasticity illustration clusters)”

4. Histogram / Boxplots (Distribution Questions)

Examples:

26
• “Wage spread across labor groups”
• “Consumption outlier detection”

5. Stacked Bar (Composition Questions)

Examples:
• “Sources of tax revenue in India”
• “Sector-wise GDP contribution”
6. Economics Case Studies (Expanded Explanation)
Case Study A — Development Economics
Topic: Consumption inequality across Indian states over a year.
Problem: Mixed state naming, missing incomes, different currency units, duplicate survey
responses.
Wrangling performed:
• Standardized state labels
• Income converted to ₹ lakh
• Missing incomes verified through median imputation strategy
• Spending aggregated month-wise
• Duplicate households removed
• Dataset reshaped into long trend format
Persuasion message encoded:
“High-income households spend 3× more on discretionary festival goods; demand surges post-
monsoon season.”
Graph strategy used:
• Line chart for trend
• Bar chart for magnitude comparison
• Scatter when validating relationship claims
Outcome: Policymaker or reader reaches conclusion instantly, analysis becomes socially
influential.
Case Study B — Behavioral Economics
Topic: Consumer preference validation (Revealed preference).

27
Problem: Preference ranking data is ordinal yet plotted using bar lengths, creating false
understanding.
Correction: Economists redesign the visual using ordered segments or scatter positions instead
of misleading bar heights.
Persuasion lesson: A truthful chart strengthens economic inference, a distorted one weakens
the economist’s credibility.
Case Study C — Firm Theory Economics
Topic: Production input-output mapping for 5 firms across 10 years.
Question: “Which firm achieved higher output using proportional cost efficiency?”
Wrangling performed:
• Data merged by firm-year key
• Output indexed for growth comparison
• Cost filtered to economic variables only
• Data reshaped into analytics-ready frame
Relationship validated using:
• Inference models like OLS Regression
established before publishing correlation scatter.
Message encoded:
“Firm digital adoption speed explains 50% productivity divergence post-2019 (validated at
95% confidence).”
Summary
The lesson explains how economic insight and influence begin long before chart-making,
starting with the disciplined process of preparing messy information through Data Wrangling,
using environments such as Python with libraries like Pandas for structuring and
transformation, relational logic through SQL on databases such as PostgreSQL, and large-scale
aggregation through systems like Apache Spark, to ensure data is accurate, standardized, and
modeling-ready, after which economists choose the most cognitively truthful chart forms—
bars for magnitude comparison, lines for time trends, histograms or box plots for distribution,
and scatter plots only when relationships are statistically validated using methods like OLS
Regression and Hypothesis Testing (typically 95% confidence), finally designing visuals
through principles of good design such as maximizing the Data-Ink Ratio, minimizing
Chartjunk, maintaining scale honesty by avoiding Axis Truncation, reducing reader Cognitive
Load through clear typography and hierarchy, and applying Narrative Framing so charts do not
merely display results but persuade ethically, rapidly, and correctly toward real economic
conclusions for business or policy decisions.

28
Glossary
1. Data Wrangling
The systematic process of collecting, inspecting, cleaning, restructuring, transforming, and
enriching messy, raw datasets into a consistent, analysis-ready format. It includes resolving
inconsistencies, correcting formats, standardizing spelling, aligning measurement units,
removing duplicate entries, handling missing values, and engineering new variables that make
economic inference valid. It is the stage that protects the research pipeline from producing
misleading statistics or visualizations and forms the backbone of reliable economic storytelling.
2. Data Cleaning
A core component of wrangling focused on identifying and repairing incorrect, contradictory,
or impossible values (e.g., negative prices without justification, wrong date entries, illogical
age or income data, incorrect category labels). It prioritizes correcting noise while preserving
real economic variation and carefully reviews outliers before removal to avoid deleting
meaningful ground realities like genuine income inequality or seasonal demand shocks.
3. Data Parsing
The conversion of data from different sources and file types (CSV, Excel, APIs, PDFs, text
exports, database extracts) into a uniform, structured form that analytical tools can read
correctly. In economics, parsing ensures that dates behave like time values, numbers like
continuous measures, and categories like standardized identifiers so that merging, aggregation,
and modeling do not break.
4. Deduplication
The identification and removal of repeated records in a dataset that can artificially inflate
averages, totals, or trends. This is critical when working with household surveys, administrative
data, retail exports, or multi-channel business reports where the same transaction, individual,
or entry might appear multiple times due to file merging or repeated exports, which can distort
demand estimation, price averages, GDP components, or conversion metrics.
5. Missing Data Handling
Strategies used to address missing or unreported values in datasets. Economists choose from
deletion (listwise or pairwise), statistical substitution (mean/median), or principled imputation
based on domain logic (e.g., predicting income based on asset ownership or location). The
chosen method depends on the question, data scale, and sample size, ensuring that adjustments
do not bias economic conclusions like consumption inequality or price responsiveness.
6. Feature Engineering
The construction of new variables from raw or cleaned data to enable economic analysis or
persuasive visualization. Examples include growth rate from time data, inflation rate from price
indices, budget share from consumption baskets, elasticity from log-transformed demand,
profit margin from firm records, or conversion rate from business datasets. These derived
measures help data communicate higher-level economic reality instead of scattered raw values.
29
7. Wide Format
A data structure where each category has its own column (e.g., separate columns for rice price,
wheat price, electricity spending, fuel cost). While useful for record storage, it often fails for
chart-building or regression pipelines because economic inference needs category and time
behavior. Economists reshape it to long form for scalable analysis.
8. Long Format
A data structure where categories are stacked into rows under one column (e.g., “commodity
type”) while values sit in another (e.g., “price” or “spending”). This structure is superior for
economic models, regressions, and most visualizations because it scales to many variables,
works well with time-series slices, allows meaningful joins, and matches real inference
pipelines.
9. Data Aggregation
The transformation of individual-level observations into summary insight units such as total
district consumption, average commodity price, median household income, or state-wise
discretionary budget share. Economic storytelling relies on aggregation because persuasion
works with patterns, not spreadsheets of isolated rows.
10. OLS Regression
Ordinary Least Squares, a method for estimating relationships between an independent
economic driver (e.g., income, price, advertising expenditure, input cost) and a dependent
outcome (e.g., consumption demand, quantity sold, revenue). It minimizes total squared error
to fit the best straight line, offering statistical proof before annotating or visualizing
relationships in policy or business persuasion.
11. Hypothesis Testing
A decision framework that evaluates whether a visual or numeric data pattern is statistically
reliable or likely observed by chance. Economics students validate claims like “ad spend raises
revenue” or “income drives consumption” by producing confidence-based evidence (typically
95%) before persuasive annotation or communication, ensuring correlation or trend claims are
ethically grounded.
12. Pre‑attentive Attributes
Chart elements that the brain processes instantly—length, position, direction, clustering, size,
spacing, and contrast—used strategically in persuasive visual design. In economics, the most
persuasive charts rank encoding methods: position > length > area > angle. These attributes
allow charts to communicate inequality, demand spikes, or policy impact without cognitive
strain.
13. Chartjunk
Visual decoration added to graphs that does not represent data (e.g., 3D bars, clipart, heavy
gradients, glowing shadows, distracting backgrounds, ornamental icons). These hurt

30
persuasion in economics by slowing perception or implying a magnitude that does not exist.
Effective design removes chartjunk and retains insight.
14. Axis Truncation
Deliberately starting bar or trend axes not from zero when the variable is ratio-scaled, making
differences look visually exaggerated. This is considered a harmful design practice in
economics because it can mislead magnitude perception in themes like inflation rise or state-
wise spending comparison. Good design keeps scales honest.
15. Cognitive Load
The amount of thinking effort a reader must use to decode a graphic. Economics persuasion
reduces cognitive load by simplifying design, placing direct labels, minimizing legends, using
clean typography, and embedding insight into the chart title so readers grasp the conclusion
within seconds.
16. Data‑Ink Ratio
A principle that maximizes the proportion of pixels representing actual data rather than grid
lines, borders, backgrounds, or decorations. In economics visuals, a higher data-ink ratio means
faster persuasion, clearer inequality perception, and honest policy communication.
17. Dashboarding
The process of placing multiple charts, filters, and numeric indicators into a single interactive
analytical interface to communicate interconnected economic variables like demand trends,
price distributions, regional spending, ad conversion, or cost-revenue relationships.
Dashboards are persuasive when each visual is individually clean but collectively narrates one
validated economic story.
18. Narrative Framing
The art of structuring data communication so that numbers and visuals tell a logical,
emotionally neutral, evidence-backed economic message. It involves sequencing: question →
cleaned data → chart choice → takeaway title → annotations → sourcing → policy/business
implication, ensuring persuasion is achieved through clarity, not distortion.

31

You might also like