Introduction to Data Science

Chapter 2
Data, Measurement and Information Quality

Diploma in Data science
Introduction to Data Science   •   Diploma

Data, Measurement and Information Quality

Introduction

Data science begins before modelling, programming, or visualisation. It begins with deciding what is being observed, how observations are represented, and whether the resulting information is trustworthy enough for a particular purpose. A sophisticated algorithm cannot compensate for unclear definitions, inappropriate measurement, missing records, systematic bias, or poorly documented data.

This chapter introduces the foundations required to work responsibly with data. It distinguishes structured, semi-structured, and unstructured data; explains variables and measurement scales; examines common data formats and metadata; and develops a practical understanding of data quality, bias, and fitness for purpose. These ideas apply to business, government, healthcare, education, science, and everyday digital services.

Learning Objectives

By the end of this chapter, you should be able to:

  • classify data as structured, semi-structured, or unstructured;
  • distinguish observations, variables, records, and data sets;
  • explain nominal, ordinal, interval, and ratio measurement scales;
  • identify common tabular, text, image, audio, and exchange formats;
  • explain the role of metadata and data dictionaries;
  • assess data quality using recognised dimensions;
  • identify sources of bias and explain their effects;
  • judge whether data are fit for a stated purpose;
  • recommend practical steps for improving data quality and governance.

1. Data, Information and Knowledge

Data are recorded representations of observations, measurements, events, or assertions. A temperature reading of 21 °C, a customer identifier, a photograph, and a paragraph in a clinical report are all data. Data may be numerical, categorical, textual, visual, auditory, or multimodal.

Information is data interpreted in a context so that it has meaning. The isolated value “21” is ambiguous; it could represent degrees Celsius, a person's age, or a product quantity. When accompanied by a definition, unit, time, and location, it becomes more informative.

Knowledge is a justified understanding of relationships, patterns, or rules derived from information and experience. For example, repeated observations may support the knowledge that indoor temperature falls when a heating system is switched off.

The distinction is not absolute. A value can be information in one context and raw data in another. Meaning depends on definitions, metadata, and the intended use.

Observations, variables and records

An observation is one recorded instance, such as one patient's visit or one transaction. A variable is a characteristic that may differ between observations, such as age, department, or purchase amount. A record is a collection of related values describing one observation. A data set is an organised collection of records or other data objects.

For a table of student results:

  • each row may represent one student;
  • each column may represent a variable such as programme, attendance, or mark;
  • the student number may act as an identifier;
  • the complete table is the data set.

An identifier is not necessarily a meaningful measurement. A student number may be numeric in appearance but usually should not be averaged or treated as a quantity.

2. Types and Structures of Data

Structured data

Structured data follow a predefined schema. They are commonly stored in relational database tables, spreadsheets, or consistently formatted files. Each field has an expected name, type, and relationship to other fields.

Examples include payroll tables, inventory records, and examination results. Structured data are relatively easy to query because the location and meaning of values are specified in advance. However, structure does not guarantee accuracy. A well-organised table can still contain duplicate customers, incorrect dates, or biased samples.

Semi-structured data

Semi-structured data do not fit a rigid table but contain labels, tags, keys, or other organisational markers. Examples include JSON documents, XML files, email headers, and event logs. Different records may contain different fields, and nested objects may represent relationships.

For example, a JSON order might contain a customer object, an address object, and an array of products. This is flexible and useful for web applications, but analysis may require the nested data to be flattened, standardised, or joined.

Unstructured data

Unstructured data lack a consistent tabular schema. Examples include free-form documents, social-media posts, images, audio recordings, videos, scanned forms, and medical notes. They may still contain valuable structure, such as words, pixels, timestamps, or speech segments, but that structure is not necessarily explicit.

Data scientists often transform unstructured data into analysable representations. Text may be tokenised; images may be represented by pixels or learned features; audio may be converted into a waveform or transcript. Transformation introduces choices and possible errors, so the original material should be retained where lawful and appropriate.

Comparison

TypeTypical organisationExamplesCommon analytical issue
StructuredFixed fields and recordsSQL table, spreadsheetSchema errors and inconsistent values
Semi-structuredKeys, tags, nested objectsJSON, XML, logsVariable fields and complex nesting
UnstructuredNo fixed analytical schemaText, image, audio, videoFeature extraction and interpretation

The categories are useful but not perfectly separate. A spreadsheet containing comments has both structured columns and unstructured text. A database may contain structured metadata linked to unstructured documents.

3. Variables and Their Roles

Variables may be classified by their content and by their role in an investigation.

A quantitative variable expresses a quantity, such as income, distance, or duration. A qualitative or categorical variable represents categories, such as region or payment method. A discrete variable generally takes countable values, such as number of complaints. A continuous variable can take values across an interval, such as mass or elapsed time, subject to measurement precision.

In a model or study:

  • an independent variable is a factor used to explain or predict variation;
  • a dependent variable is the outcome being explained or predicted;
  • a control variable is held constant or included to reduce confounding;
  • a confounder is associated with both an apparent explanatory factor and the outcome, potentially creating a misleading relationship.

These labels depend on the design. A variable used as an input in one project may be an outcome in another. Association alone does not establish causation.

4. Measurement Scales

A measurement scale describes the mathematical meaning of values. Selecting a scale determines which summaries and comparisons are legitimate.

Nominal scale

Nominal values are labels or categories with no intrinsic order. Examples include blood group, browser type, country, and department. Equality and difference are meaningful; arithmetic operations are not. The mode and category proportions are appropriate summaries.

Ordinal scale

Ordinal values have an order, but differences between adjacent categories are not known to be equal. Examples include satisfaction ratings such as dissatisfied, neutral, and satisfied, or risk levels such as low, medium, and high. Medians, ranks, and order-based comparisons may be appropriate. Treating ordinal labels as if the intervals were equal requires justification.

Interval scale

Interval values have ordered, equal differences, but zero does not represent a complete absence of the measured quantity. Temperature in degrees Celsius is a familiar example: a difference of 10 °C has the same meaning throughout the scale, but 20 °C is not twice as hot as 10 °C. Addition and subtraction are meaningful; ratio statements require caution.

Ratio scale

Ratio values have order, equal intervals, and a meaningful zero. Examples include mass, duration, length, and revenue measured from zero. Ratios such as “twice as long” are meaningful when the measurement process supports them. Multiplication, division, and most common numerical summaries are available.

ScaleOrder?Equal intervals?True zero?Example
NominalNoNoNoProduct category
OrdinalYesNot establishedNoService rating
IntervalYesYesNoCelsius temperature
RatioYesYesYesDistance in metres

The scale is a property of how a variable is defined, not merely of whether values use digits. Postal codes and identification numbers are nominal even though they contain numerals.

5. Data Formats and Representation

A data format is a convention for storing or exchanging data. Common formats include:

  • CSV: plain text separated by delimiters; simple and widely supported, but weak for nested data and data types;
  • XLSX: spreadsheet format supporting multiple sheets, formulas, and formatting; useful for human work but vulnerable to accidental changes;
  • JSON: key-value and nested representation common in web services;
  • XML: tagged hierarchical representation used in many enterprise and document systems;
  • SQL tables: structured records managed by relational database systems;
  • Parquet: column-oriented binary format efficient for analytical workloads;
  • TXT, PDF, and DOCX: document formats that may contain text, layout, tables, or images;
  • JPEG, PNG, and TIFF: image formats with different compression and preservation properties;
  • WAV and MP3: audio formats differing in compression and fidelity.

A format affects portability, storage, processing cost, and possible loss of information. Converting a spreadsheet to CSV may remove formulas, multiple sheets, formatting, and some type information. Converting an image to a compressed format may remove visual detail. Therefore, a project should preserve an authoritative source and document transformations.

Dates, numbers and missing values

Dates are a frequent source of error. The string 03/04/2025 may mean 3 April or March 4 depending on locale. A robust practice is to store dates in an unambiguous standard such as ISO 8601, for example 2025-04-03, while retaining time zone information where relevant.

Numbers may also be misinterpreted because of decimal and thousands separators. A value such as 1,250 can have different meanings in different conventions. Currency, unit, precision, and rounding rules should be recorded.

Missingness is not one condition. A value may be unknown, not collected, not applicable, suppressed for confidentiality, or lost through a system failure. Replacing all missing values with zero changes the meaning of the data and can create serious bias.

6. Metadata and Documentation

Metadata are data about data. They describe meaning, origin, structure, context, ownership, and conditions of use. Useful metadata may include:

  • variable name and definition;
  • data type and permissible values;
  • unit of measurement and precision;
  • date, time zone, and collection location;
  • source system and responsible owner;
  • collection method and sampling frame;
  • update frequency and version;
  • privacy classification and access restrictions;
  • known limitations and transformation history.

A data dictionary is a practical metadata document defining fields in a data set. A schema describes allowable structure and types. Provenance records where data came from and what happened to them. A lineage may show the chain from source through transformations to a published report or model.

Good metadata reduce ambiguity, support reproducibility, enable correct integration, and help users judge fitness for purpose. Documentation should be maintained as part of the data life cycle rather than written only at the end.

7. Dimensions of Data Quality

Quality is multidimensional. A data set is not simply “good” or “bad”; it may be strong on one dimension and weak on another.

Accuracy

Accuracy is the degree to which recorded values represent the real-world condition or accepted reference. A customer’s recorded address may be syntactically valid but factually wrong.

Completeness

Completeness concerns whether required values or records are present. A data set may have 95% complete phone numbers but still be incomplete for a project requiring near-total contact coverage. Completeness should therefore be assessed relative to requirements.

Consistency

Consistency means that values do not conflict across fields, records, systems, or time. For example, an order marked “cancelled” should not simultaneously have a completed delivery date unless a clear business rule explains the situation.

Validity

Validity concerns conformity to rules, ranges, formats, or domains. A date such as 31 February is invalid; a percentage of 140 may be invalid if the variable is restricted to 0–100. A valid value is not necessarily accurate.

Timeliness and currency

Timeliness concerns availability when needed, while currency concerns how up to date the data are. Real-time fraud detection has different timeliness requirements from an annual historical report.

Uniqueness

Uniqueness concerns whether an entity or event has been recorded more than once. Duplicate records can inflate counts and distort rates.

Accessibility and interpretability

Data should be available to authorised users in usable form. Interpretability requires understandable definitions, units, codes, and context. A technically accessible data set with unexplained abbreviations is not practically useful.

Measuring quality

Quality checks should be linked to explicit rules. For example, a completeness rate for a required field can be expressed as:

Completeness rate = (number of non-missing required values ÷ total required values) × 100%

The numerator counts records with an available value, and the denominator counts records for which the field is required. This measure assumes that missingness can be identified reliably and that all records have equal relevance. A high completeness rate does not establish accuracy.

A project may also define acceptable thresholds, such as at least 98% valid dates or fewer than 1% duplicate transaction identifiers. Thresholds must reflect consequences and purpose rather than arbitrary perfection.

8. Bias and Fairness

Bias is a systematic tendency for data, measurement, sampling, processing, or interpretation to deviate from a fair or intended representation. Random error varies unpredictably; bias tends to push results in a particular direction.

Common sources include:

  • sampling bias: selected cases do not represent the target population;
  • coverage bias: parts of the population are absent from the sampling frame;
  • non-response bias: those who do not respond differ systematically from respondents;
  • measurement bias: the instrument or question records some groups less accurately;
  • historical bias: past decisions reflect unequal treatment or opportunity;
  • label bias: outcome labels are subjective, incomplete, or influenced by institutional practice;
  • survivorship bias: analysis includes only cases that remain visible or successful;
  • confirmation bias: analysts favour evidence supporting an existing belief.

Bias can enter before collection, during cleaning, through feature construction, in model training, or when results are interpreted. Removing a protected attribute does not necessarily remove bias because other variables may act as proxies. Fairness assessment requires attention to context, affected groups, legal duties, and the consequences of errors.

Ethically responsible practice includes data minimisation, informed and lawful collection, privacy protection, secure access, clear retention rules, documentation of assumptions, and meaningful human oversight. Sensitive data should not be collected merely because storage is possible. Applicable privacy and equality laws must be considered, and governance responsibilities should be assigned rather than left implicit.

9. Fitness for Purpose

Fitness for purpose means that data are sufficiently suitable for a clearly stated use. The same data may be acceptable for exploratory investigation but unsuitable for a high-stakes automated decision.

A fitness assessment should ask:

  1. What decision, question, or task will the data support?
  2. Who or what population does the data represent?
  3. Are definitions, units, time periods, and collection methods appropriate?
  4. Are the accuracy, completeness, timeliness, and granularity adequate?
  5. What biases, privacy risks, and restrictions exist?
  6. What are the consequences of error?
  7. Can limitations be communicated to users?

This approach prevents a common mistake: treating a large data set as automatically valuable. Volume does not compensate for irrelevant variables, poor coverage, outdated records, or unclear provenance.

10. An Applied Case: Municipal Service Requests

The following is an illustrative case.

Background

A city wants to predict which reported road defects require inspection within 24 hours. The available data include a structured service-request table, semi-structured mobile-app records, photographs, and free-text descriptions.

Problem

Initial analysis suggests that requests from some neighbourhoods are less likely to receive urgent attention. The city must determine whether this reflects genuine differences in road conditions, differences in reporting behaviour, or a problem in the data pipeline.

Analysis

The team creates a data dictionary for request date, location, defect type, severity, inspection time, and resolution status. It discovers that mobile-app users provide precise coordinates, while telephone reports often contain only a street name. Photographs are available mainly for digitally submitted requests. Some records are duplicated when a caller later submits an online report.

The team also finds that “severity” is assigned by different operators using inconsistent guidance. Historical records contain fewer requests from residents with limited internet access. Consequently, the data may underrepresent defects in areas with lower digital access, and apparent differences in severity may partly reflect reporting and labelling processes.

Approach and solution

The team standardises dates and locations, removes duplicates using documented rules, preserves original records, and records missingness reasons. It develops a common severity rubric and provides training. Rather than using urgency predictions as automatic decisions, the model is used to prioritise a review queue. Performance is evaluated separately across neighbourhoods and reporting channels. The city also accepts telephone and community-worker reports to improve coverage.

Outcome

The revised process improves location completeness and reduces duplicate counts. More importantly, the city learns that model accuracy alone is insufficient: unequal coverage could produce unequal service. The system now displays confidence and data limitations to staff, and periodic audits examine both data quality and service outcomes.

Learning points

  • Data structure and data quality are separate issues.
  • Missingness can reveal access inequalities.
  • Labels may reflect organisational practice rather than objective reality.
  • A model should be evaluated in relation to the decision and its consequences.
  • Provenance, documentation, human review, and monitoring are operational requirements.

11. A Practical Data-Quality Workflow

A professional workflow can proceed as follows:

  1. Define the purpose. State the decision, population, unit of analysis, and acceptable error.
  2. Inventory sources. Record owners, formats, update schedules, access conditions, and provenance.
  3. Profile the data. Examine types, ranges, missingness, duplicates, distributions, and unusual patterns.
  4. Check definitions. Compare field names with a data dictionary and confirm units, codes, and time zones.
  5. Assess bias and coverage. Identify excluded groups, selective response, historical influences, and proxy variables.
  6. Clean transparently. Keep raw data, document transformations, and avoid silent deletion or arbitrary replacement.
  7. Validate against rules or reference sources. Use range checks, cross-field checks, duplicate checks, and targeted manual review.
  8. Record limitations. State what the data can and cannot support.
  9. Monitor over time. Quality can deteriorate when systems, populations, definitions, or behaviours change.
  10. Review governance. Confirm lawful use, access control, retention, security, and accountability.

Automation is useful for repeatable checks, but automated validation cannot determine whether a definition is conceptually appropriate or whether a missing group matters ethically. Human judgement remains necessary.

12. Contemporary Developments

Modern data platforms increasingly combine databases, application programming interfaces, sensor streams, documents, and machine-generated content. Cloud systems make data easier to share, but they also increase the need for access controls, lineage, versioning, and cost management. Artificial intelligence can extract information from text, images, and audio, yet extraction errors and inherited bias must be measured rather than assumed away.

Data contracts are emerging as agreements between data producers and consumers about schemas, definitions, quality expectations, and change notifications. Data observability tools monitor freshness, volume, schema changes, and distribution shifts. These tools support governance but do not replace domain expertise. A sudden distribution change may be a genuine event, a system migration, or a change in how a variable is defined.

Chapter Summary

Data are recorded representations whose meaning depends on context, definitions, and metadata. Structured data use fixed schemas; semi-structured data use keys or tags; and unstructured data lack a consistent analytical schema. Variables can be quantitative or categorical and may serve different roles in a study. Nominal, ordinal, interval, and ratio scales determine which comparisons and operations are defensible.

Formats influence portability and information loss. Metadata, data dictionaries, schemas, provenance, and lineage make data interpretable and reproducible. Data quality includes accuracy, completeness, consistency, validity, timeliness, uniqueness, accessibility, and interpretability. Bias may arise through sampling, measurement, historical processes, labels, or system design. Fitness for purpose requires judging data against a specific decision, population, risk, and acceptable level of error. Responsible data work combines technical validation with ethical governance, documentation, monitoring, and human judgement.

Key Terms

Data: Recorded observations, measurements, events, or assertions.

Information: Data interpreted in a meaningful context.

Variable: A characteristic that can take different values across observations.

Observation: One recorded instance or case.

Structured data: Data organised according to a predefined schema.

Semi-structured data: Data organised with keys, tags, or other flexible markers.

Unstructured data: Data without a consistent predefined analytical schema.

Nominal scale: A scale of categories without order.

Ordinal scale: An ordered scale whose category intervals are not established as equal.

Interval scale: An ordered scale with equal intervals but no meaningful absolute zero.

Ratio scale: A scale with equal intervals and a meaningful zero.

Metadata: Data describing the meaning, origin, structure, or context of data.

Provenance: Information about the source and history of data.

Data quality: The degree to which data meet requirements for a use.

Completeness: The extent to which required data are present.

Validity: Conformity to specified rules or allowable values.

Bias: Systematic distortion from an intended representation or process.

Confounder: A variable that can create a misleading relationship between other variables.

Fitness for purpose: Suitability of data for a stated task or decision.

Data lineage: The traceable path of data through sources and transformations.

Review Questions

5 Short Answer Questions

  1. Distinguish structured, semi-structured, and unstructured data, giving one example of each.
  2. Why should an identification number generally not be averaged?
  3. What is the difference between accuracy and validity?
  4. State two purposes of metadata.
  5. Why is replacing every missing value with zero potentially misleading?

5 Long Answer Questions

  1. Explain the four measurement scales and discuss which types of comparison are appropriate for each.
  2. Describe the major dimensions of data quality and explain why quality must be evaluated relative to purpose.
  3. Explain how sampling, measurement, historical, and label bias can enter a data-science project.
  4. Compare CSV, JSON, and relational database tables in terms of structure, flexibility, and analytical use.
  5. Develop a data-quality workflow for a university student-performance data set, including governance considerations.

3 Analytical / Application Questions

  1. A hospital dataset has complete patient ages but uses both years and months without recording the unit. Analyse the quality problems and propose corrective actions.
  2. A customer-satisfaction survey has responses from 80% online users and 20% telephone users, while the customer population is known to have much lower internet access. Identify possible biases and explain how the results should be interpreted.
  3. A predictive model is intended to allocate emergency inspections. Design a fitness-for-purpose assessment covering data coverage, measurement, quality thresholds, fairness, human oversight, and monitoring.

Multiple Choice Questions with Answers

Question 1

Which characteristic best identifies semi-structured data?

A. It must be stored only in relational tables

B. It contains labels, keys, or tags but may vary between records

C. It contains no information that can be analysed

D. It always consists exclusively of numerical values

Correct Answer: B. It contains labels, keys, or tags but may vary between records

Question 2

Which measurement scale is represented by blood group categories?

A. Nominal

B. Ordinal

C. Interval

D. Ratio

Correct Answer: A. Nominal

Question 3

Why is Celsius temperature generally classified as an interval scale?

A. It has no ordering

B. Its values cannot be compared

C. It has equal intervals but zero is not an absolute absence of temperature

D. It supports meaningful statements that 20 °C is twice 10 °C

Correct Answer: C. It has equal intervals but zero is not an absolute absence of temperature

Question 4

Which item is metadata?

A. A customer’s purchase amount

B. A photograph of a product

C. The definition and unit of a field called purchase_amount

D. A randomly selected transaction

Correct Answer: C. The definition and unit of a field called purchase_amount

Question 5

A date value conforms to the required format but refers to the wrong event date. Which quality problem is most clearly present?

A. Inaccuracy

B. Uniqueness

C. Accessibility

D. Nominal scaling

Correct Answer: A. Inaccuracy

Question 6

If 900 of 1,000 required records contain a non-missing value, what is the completeness rate?

A. 9%

B. 10%

C. 90%

D. 900%

Correct Answer: C. 90%

Question 7

Which example best illustrates coverage bias?

A. A database stores the same transaction twice

B. An online survey excludes people without internet access

C. A date is entered in the wrong format

D. A report uses a clear data dictionary

Correct Answer: B. An online survey excludes people without internet access

Question 8

What does fitness for purpose require?

A. The largest possible volume of data

B. Perfect accuracy in every field regardless of use

C. Data suitability relative to a defined task, population, and consequences of error

D. Use of artificial intelligence for every analysis

Correct Answer: C. Data suitability relative to a defined task, population, and consequences of error

Question 9

Which practice best supports reproducibility?

A. Deleting the original data after cleaning

B. Keeping raw data and documenting transformations and assumptions

C. Changing field definitions without notification

D. Replacing all missing values with zero

Correct Answer: B. Keeping raw data and documenting transformations and assumptions

Question 10

Why can removing a protected attribute fail to remove unfairness from a model?

A. Protected attributes are always required for calculation

B. Other variables may act as proxies for the protected attribute

C. Models cannot use numerical variables

D. Fairness is unrelated to data quality

Correct Answer: B. Other variables may act as proxies for the protected attribute

Introduction to Data Science
Chapter 2 of 15