MARK5827 Chap.3 Data Preparation and Measurement
Data Preparation and Measurement
Data preparation begins by asking whether the sample and variables can answer the business objective. This chapter covers representative and stratified sampling, respondent relevance, range and logic checks, outliers, missing responses, categorical measurement, dummy coding and reproducible repair decisions.
It emphasises that a perfectly cleaned file can still be unsuitable when the wrong population was observed, and that numeric storage does not make a customer ID or postcode a metric variable. Sample design comes first because cell-level repair cannot restore customers excluded by the extraction rule.
Measurement comes next: binary flags must respect their definitions, categorical labels need an encoding that does not invent distance, and durations or balances need plausible business ranges. Missingness is treated as a decision rather than an empty cell. Neutral substitution, model-based imputation, casewise deletion and pairwise deletion each change variation, sample composition or comparability.
The analyst should compare results before and after a material treatment, test sensitivity where several choices are defensible, and retain an audit trail that explains rather than hides each repair.
What this chapter covers
- 01
Target population and sample fitness
- 02
Random and stratified sampling choices
- 03
Range, logic and extreme-value checks
- 04
Missing-value deletion and imputation trade-offs
- 05
Nominal, ordinal and metric measurement
- 06
K minus one dummy-variable recoding
Worked example · free
Diagnose five fields before modelling
- 1Trace the invalid product flag to its coding definition or original record.
- 1Check whether negative spend represents a legitimate return before changing it.
- 1Recompute relationship duration from validated dates because 96 years is implausible.
- 1Treat region as categorical and use three reference-coded indicators when all four categories are retained.
- 1Investigate the missingness pattern before choosing deletion or imputation for income.
Key terms
- Representative Sample
- A sample whose selection and coverage suit the population required by the research objective.
- Casewise Deletion
- Removal of an observation when any required variable is missing.
- Pairwise Deletion
- Use of available complete pairs for each calculation rather than one shared complete sample.
- Variable Respecification
- Creation or recoding of variables so they better represent the research objective.
Data Preparation and Measurement FAQ
Can cleaning fix an unrepresentative sample?
No. Cleaning can correct or document recorded values, but it cannot restore customers who were excluded by the selection rule. If the sample covers only premium or active customers, redesign the extraction before making claims about all customers or inactive groups.
Why should numeric codes not be treated as continuous?
A numeric postcode, customer ID or category label often lacks meaningful order and distance. Arithmetic on those codes invents relationships that do not exist. Use indicators, a justified ordinal treatment or a theoretically meaningful aggregation based on the variable definition.
How should missing values be handled?
Begin by examining why values are absent and whether missingness differs across groups or outcomes. Mean substitution, model-based imputation, casewise deletion and pairwise deletion each alter variation, sample size or comparability. Select and document the method that best fits the decision.
What should a cleaning audit trail record?
Record the original definition, observed issue, explanation considered, evidence checked, treatment chosen, number of affected rows and change in important summaries. This allows another analyst to reproduce the decision and prevents an unusual but legitimate customer from being silently converted into an error.
Assessment move
Use a fixed audit order: objective, population, sampling rule, variable definition, range, logical consistency, missingness, transformation and documentation. Practise on small tables by identifying the field, naming the violated rule and specifying the next check. Memorise the K minus one reference-coding rule, but do not apply it blindly when a theoretically meaningful grouping is available.
In R, rerun the preparation script from a clean session and compare row counts and summaries before and after every material treatment. Create a three-column audit sheet with observed issue, possible explanation and decision required. An extreme negative balance may be an error, a reversal or a legitimate business event; the next step differs for each explanation.
For missing data, compare rates across groups and the target outcome before choosing deletion or imputation. Record whether a transformation changes units, meaning or only representation. At the end, explain how the cleaned data could still mislead the decision. This final challenge keeps sampling and measurement quality visible after the script runs successfully.
Preserve one untouched input extract and a compact decision log so another analyst can reproduce every exclusion, recode and transformation without relying on memory.
Working through Data Preparation and Measurement in MARK5827? Sia is AskSia’s AI Marketing tutor — ask any MARK5827 Data Preparation and Measurement question and get a clear, step-by-step explanation grounded in how MARK5827 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.