impera Open Impera

AP Computer Science Principles · Data

Extracting information from data

1Data and information

Data are raw values; information is what we learn when data is processed and interpreted. Programs and people turn large data sets into information by finding patterns and trends.

Examples: sales data reveals which products sell best in winter; traffic sensor data shows when roads are busiest.

Large data sets can reveal insights that small samples cannot, but they bring challenges of storage, processing time and accuracy.

Check yourself

Which is an example of information extracted from data?

  • Most library loans happen on Mondays

  • The file name of a spreadsheet

  • A list of the dates of all loans

  • The number 742 in a spreadsheet cell

Show the answer

Most library loans happen on Mondays

A pattern found in the data.

2Metadata

Metadata is data about data. For a photo, metadata includes the date taken, location, camera settings and file size.

  • Metadata helps find, organise and manage data (e.g. searching photos by date).
  • Changing or deleting metadata does not change the main data (the photo itself).
  • Metadata can reveal private information, such as where a photo was taken.
Check yourself

Which is metadata for a song file?

  • The melody

  • The lyrics sung

  • The sound waves themselves

  • The artist's name and track length

Show the answer

The artist's name and track length

Data about the song.

3Cleaning and processing data

Raw data often needs cleaning before it is useful:

  • Inconsistent entries ("NY", "New York", "new york") must be standardised.
  • Missing or invalid values must be handled.
  • Duplicates must be removed.

Tools: filtering (keep only rows meeting a condition), sorting, combining data sets, transforming (e.g. converting units), and visualising with charts.

Worked example

a survey of favourite sports.

  1. Clean: change "soccer", "Soccer" and "football (soccer)" to one category.
  2. Filter: keep responses from students aged 14–18.
  3. Visualise: bar chart of counts per sport.
  4. Information: basketball is most popular among 16-year-olds.

Data must be cleaned and filtered before it gives reliable information

Check yourself

Why must data be cleaned before analysis?

  • Inconsistent or invalid values lead to wrong conclusions

  • Cleaning adds new information that was not collected

  • It is required before any data can be compressed

  • Clean data takes more storage space than raw data

Show the answer

Inconsistent or invalid values lead to wrong conclusions

Garbage in, garbage out.

4Correlation, bias and limits

  • A correlation between two variables does not mean one causes the other. Ice cream sales and sunburn both rise in summer because of heat.
  • Bias in how data is collected (e.g. only surveying people online) affects conclusions, and more data does not remove bias.
  • Data may be incomplete, and some questions cannot be answered with the data available.
  • Large data sets may require parallel or distributed systems to process in reasonable time.
Check yourself

Two variables are strongly correlated. This shows:

  • One variable definitely causes the other to change

  • The data has been compressed with a lossy method

  • The data is biased and cannot be used at all

  • They are associated, but not necessarily that one causes the other

Show the answer

They are associated, but not necessarily that one causes the other

Correlation ≠ causation.

5Going deeper: from raw data to trustworthy conclusions

Data and information: data are raw facts and measurements. Information is the meaning drawn from them: patterns, trends and answers. A list of ten million purchases is data; "sales of umbrellas triple in the week after the first autumn storm" is information.

What data can reveal

  • Trends: change over time.
  • Patterns: regular associations.
  • Correlations: two quantities that rise or fall together.
  • Outliers: unusual values, which may be errors or the most interesting cases.

More data usually reveal more, but only with tools to process them.

Correlation is not causation. Two things moving together does not show that one causes the other.

  • Ice-cream sales and drownings both rise in summer: the cause of both is hot weather.
  • Further research, ideally an experiment, is needed to establish cause.

Metadata: data about data.

  • A photograph's metadata: date, time, camera model, exposure and often GPS location.
  • A document: author, date created, file size.
  • A song: artist, album, duration.
  • A phone call: who called whom, when and for how long, though not what was said.

Metadata help to find, sort, organize and manage data. Changing or deleting metadata does not change the primary data. Metadata can also reveal a great deal, raising privacy concerns: the locations in a person's photos can show where they live.

Cleaning data: making data uniform without changing their meaning. Real data are messy.

  • Inconsistent formats: "NY", "New York" and "new york"; dates written 03/04/25 and 4 March 2025.
  • Abbreviations, misspellings and different capitalization.
  • Missing or incomplete entries.
  • Duplicates.
  • Invalid values: an age of 250.
  • Different units.

Cleaning comes before analysis; uncleaned data give wrong counts and averages.

Worked example (why cleaning matters): a survey asks for favorite subject. Responses include "Math", "math", "Maths", "mathematics" and "Mth".

  1. A program counting exact matches reports five different subjects.
  2. After cleaning, all five become one category.
  3. Without cleaning, mathematics would look far less popular than it is.

Bias in data: the way data are collected can make them unrepresentative.

  • A survey posted only online misses people without internet access.
  • Reviews are written mostly by people with strong opinions.
  • A sensor placed in sunlight reads too high.

Collecting more data of the same biased kind does not remove the bias. Ask who and what is missing.

Large data sets

  • They are too large to inspect by hand; programs are needed to filter, sort, combine and summarize them.
  • Processing may need parallel systems, and the ability to scale up affects what can be analyzed.
  • They may be incomplete or come from several sources that record things differently.
  • Combining sources can give insights that neither offers alone, and can also expose private information.

Visualization: tables, bar charts, line graphs, scatter plots, histograms and maps make patterns visible that are hidden in rows of numbers. Choose the type to suit the question: a line graph for change over time; a scatter plot for a relationship between two quantities; a bar chart for comparing categories.

Worked example (reading a claim critically): a fitness app reports that users who log meals lose more weight than those who do not.

  1. This is a correlation.
  2. People who log meals may already be more motivated: a different cause of both.
  3. The sample includes only people who chose the app: not representative of everyone.
  4. A fair conclusion: "logging is associated with weight loss among users"; not "logging causes weight loss."

Limits: data cannot answer every question. A single source may lack what is needed; apparent patterns can arise by chance, especially when many comparisons are tried.

Common mistakes

  • Treating a correlation as proof of cause.
  • Defining metadata as "extra data" without saying it describes other data.
  • Thinking cleaning means deleting inconvenient results.
  • Believing a bigger data set is automatically unbiased.
  • Confusing data with information.
Check yourself

Which is an example of metadata for a digital photograph?

  • The colors of the pixels that make up the image

  • The people who are shown in the photograph

  • The date and location at which it was taken

  • A compressed copy of the image in another file

Show the answer

The date and location at which it was taken

Metadata describe the data; they are not the content itself.

6For top marks

  • Use the precise words: data, information, metadata, cleaning, filtering, correlation.
  • When asked what can be learned from a data set, state a specific pattern and say whether the data can actually support it.
  • Explain why bias cannot be fixed just by collecting more of the same kind of data.
  • Recognise that metadata can identify people (location, timestamps).
Example

"The data shows a correlation between hours of screen time and lower test scores, but it cannot show that screen time causes lower scores, because other factors such as sleep may be involved."

Check yourself

Collecting more data from the same biased source will:

  • Remove the bias

  • Not remove the bias

  • Turn correlation into causation

  • Delete metadata

Show the answer

Not remove the bias

Same bias at a larger scale.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera