Statistics Quest

Customer records (cleaned)

The cleaned counterpart of customers_messy for the fictional retailer Rimal Living: the same records after applying six documented cleaning rules. Use it to check your own cleaning decisions — and to discuss the ones that are judgement calls (setting impossible ages to missing rather than guessing, converting halala entries rather than dropping them).

Rows
679
Columns
8
One row is
one customer
Version
v1

Data dictionary

ColumnTypeUnitSummaryDescription
customer_id
Customer
idCustomer identifier (unique after de-duplication).
signup_date
Signup date
dateDate the customer account was opened.
city
City
category5 levels: Riyadh, Jeddah, Dammam, Khobar, Abha; 7 missingCity of residence, standardised to one spelling.Missing: Null where the city was not recorded.
segment
Segment
category2 levels: Individual, Small businessCustomer segment.
age
Age
integeryearsmean 36.85, median 35, SD 11.29, range 19–82; 23 missingAge in years; impossible values were set to null.Missing: Null where not recorded or where the recorded value was impossible (< 16 or > 110).
annual_spend_sar
Annual spend
numberSARmean 5481, median 3519, SD 5928, range 319.8–60000; 16 missingSpend over the last 12 months in SAR (halala entries converted, negative entries removed).Missing: Null where not recorded or where the recorded value was negative.
referral_source
Referral source
category5 levels: Search, Friend, Social media, Store visit, Advertisement; 28 missingHow the customer heard about the shop.Missing: Null where the raw value was a placeholder ('N/A', 'unknown', '-').
email_opt_in
Email opt-in
boolean2 levelsTrue if the customer agreed to receive marketing emails.

What it is good for

  • Verify a cleaning pipeline by comparing your output with a reference result.
  • Quantify how cleaning changes summaries (row count, mean spend, missingness).
  • Discuss which cleaning steps are rules and which are judgement calls.

Methods: data validation, missing-data summaries, before/after comparison.

Data quality notes

  • 679 rows (the 21 exact duplicates removed).
  • Nulls: age 23 (18 originally missing + 5 impossible), city 7, annual_spend_sar 16 (12 missing + 4 negative), referral_source 28 (placeholders).
  • 6 halala entries converted to SAR; 45 city spellings standardised; 8 referral values trimmed.
  • Remaining missing values are genuine unknowns; they were not imputed.

Provenance and licence

Generated by running the customers_messy generator and then applying, in order: (1) drop exact duplicate rows, keeping the first occurrence; (2) city: trim spaces, lower-case and map spellings and aliases to one canonical name (Riyadh, Jeddah, Dammam, Khobar, Abha); (3) referral_source: trim spaces and turn placeholders "N/A", "unknown", "-" (any case) into null; (4) age outside 16–110 → null; (5) negative annual_spend_sar → null; (6) annual_spend_sar above 100,000 → divided by 100 (halalas to SAR).

Synthetic data · CC0-1.0 (synthetic data generated by Statistics Quest) · generated deterministically (seed 20241025). It does not describe real people or organisations; any resemblance is coincidental.

Preview

Dataset

Customer records (cleaned)

679 rows · one row = one customer · synthetic data

CustomerSignup dateCitySegmentAge (years)Annual spend (SAR)Referral sourceEmail opt-in
C00012024-02-28RiyadhSmall business315716.7Advertisementtrue
C00022021-07-15JeddahIndividual204679.64Friendtrue
C00032024-08-12DammamSmall business303027.49Advertisementfalse
C00042022-11-14RiyadhIndividual345440.72Searchfalse
C00052022-12-01RiyadhIndividual471382.89Social mediafalse
C00062023-11-01KhobarIndividual374162.73Store visitfalse
C00072022-12-06JeddahIndividual364146.99Friendfalse
C00082023-10-20RiyadhIndividual242789.46Searchfalse
C00092024-08-30KhobarIndividualmissing2828.16Searchfalse
C00102022-12-19JeddahIndividual371536.23Searchtrue
C00112021-10-24JeddahIndividual3210629.29Searchfalse
C00122022-09-06DammamSmall business718058.07Social mediatrue

Used in