Data Preparation and Descriptive AnalysisIntroductionMarketing research rarely produces analysis-ready data. Responses may contain inconsistent codes, missing answers, duplicate cases, impossible values, inattentive respondents, and variables recorded in forms unsuitable for analysis. Data preparation converts raw observations into a documented, defensible analytical dataset. Descriptive analysis then organizes and summarizes that dataset so that researchers and managers can understand who responded, what respondents reported, how responses vary, and whether patterns appear commercially meaningful. Data preparation is not a merely technical stage. Decisions about deleting cases, imputing values, recoding scales, or treating extreme observations can change findings. Consequently, every decision should be guided by the research design, documented in a data-processing log, and evaluated for possible bias. Learning ObjectivesBy the end of this chapter, students should be able to: - Construct coding schemes and data dictionaries for marketing variables.
- Clean, transform, merge, and validate survey and secondary data.
- Diagnose missing values, outliers, duplicate records, and poor response quality.
- Select suitable descriptive statistics and visualizations.
- Interpret distributions, measures of central tendency, variability, cross-tabulations, confidence intervals, and practical effect sizes.
- Explain the ethical and managerial consequences of data-preparation decisions.
1. From Raw Responses to an Analytical DatasetA dataset is usually organized as a rectangular matrix. Rows represent cases—such as customers, households, stores, or transactions—and columns represent variables. A cell contains the observed value for one variable in one case. A useful workflow is: - Preserve the raw file as read-only.
- Create a working copy and assign a unique case identifier.
- Build a codebook and data dictionary.
- Check ranges, formats, skips, duplicates, and logical consistency.
- Identify missing, invalid, and low-quality responses.
- Recode or transform variables where justified.
- Integrate approved data sources using documented keys.
- Produce tables, graphs, and descriptive statistics.
- Save a cleaning log and an analysis-ready version.
The raw dataset should never be overwritten. A reproducible project commonly contains a raw-data folder, syntax or code files, a cleaned dataset, an output folder, and a decision log. Reproducibility means that another analyst can understand and repeat the process. Units of analysis and variablesThe unit of analysis must be clear. A customer-level dataset should not be mixed carelessly with transaction-level records. If one customer appears once per purchase, calculating the percentage of “customers” from rows will overrepresent frequent buyers. Analysts must distinguish observational units, sampling units, and reporting units. Variables may be classified as: - Nominal: categories without order, such as region or payment method.
- Ordinal: ordered categories whose intervals are not necessarily equal, such as satisfaction categories.
- Interval: numerical scales with equal intervals but no meaningful zero, such as some attitude scales.
- Ratio: numerical measures with equal intervals and a meaningful zero, such as revenue, units sold, or age.
The measurement level influences permissible summaries. A nominal variable is summarized with counts and percentages; a ratio variable can additionally be summarized with means, standard deviations, and percentiles. A single Likert item is formally ordinal, although a multi-item, approximately symmetric scale is often treated as interval for practical analysis when justified. 2. Coding Schemes and Data DictionariesA coding scheme specifies how observations are represented numerically or textually. Codes should be mutually exclusive, collectively exhaustive for the intended population, and documented. For example, gender categories may include “Woman,” “Man,” “Non-binary,” “Prefer to self-describe,” and “Prefer not to say.” A code of 99 should not silently mean both “not applicable” and “refused.” A data dictionary provides metadata for every variable. A compact example is shown below. | Variable | Description | Type/level | Valid codes or range | Missing codes | Derivation/notes |
|---|
| respondent_id | Unique respondent identifier | Nominal | Unique alphanumeric | None | Assigned by system | | age_years | Respondent age | Ratio | 18–99 | 999 | Self-reported; verify eligibility | | region | Residence region | Nominal | 1 North; 2 South; 3 East; 4 West | 98, 99 | 98 = not applicable; 99 = refused | | sat_q1 | Satisfaction with delivery | Ordinal | 1 Very dissatisfied–5 Very satisfied | 97–99 | Original item | | sat_index | Mean satisfaction index | Approximately interval | 1.00–5.00 | System missing | Mean of valid sat items if at least 3 of 4 answered | | spend_30d | Spending in previous 30 days | Ratio | ≥ 0 currency units | 999999 | Check against transaction file |
Coding principlesUse meaningful labels. A table showing “3” is difficult to interpret; “Satisfied” is clearer. Statistical software can store numeric codes while displaying labels. Separate missing-value reasons. “Don’t know,” “refused,” “not applicable,” and “not reached because of a skip pattern” have different meanings. They may later be combined for a particular analysis, but their original distinctions should be retained. Avoid ambiguous codes. Codes such as 0, 9, or 99 can be legitimate values. For example, zero purchases is different from missing purchases. Missing codes should be outside the valid range whenever possible. Record transformations. If age is grouped into categories, retain the original age variable. Derived variables should have names and definitions that reveal how they were created. Use consistent direction. If high values indicate favorable attitudes, reverse-code negatively worded items before computing an index. For a five-point item, the reverse score is: xreverse = (k + 1) − x where x is the original score and k is the maximum scale value. For a 1–5 scale, a score of 1 becomes 5, 2 becomes 4, and so forth. This transformation assumes that the item categories are equally spaced for the intended analysis. 3. Data Cleaning and ValidationRange and validity checksA range check identifies values outside the permitted domain. Age of 240, a five-point satisfaction response of 8, or negative quantity sold requires investigation. An invalid value may reflect a typing error, a coding error, or a genuine but unusual observation. It should not be changed automatically. Logic and skip-pattern checksLogical checks examine relationships among variables. A respondent who indicates “I have never used the brand” should not have a valid rating for “my last purchase from the brand,” unless the questionnaire explicitly allowed hypothetical evaluation. A respondent who reports zero household members should trigger review if household income is collected. Duplicate recordsDuplicates can arise from repeated submissions, merged files, or multiple transactions. Exact duplicates may be removed after verification. Near duplicates require comparison of identifiers, timestamps, contact information, or response patterns. Removing a duplicate without a rule can introduce arbitrary selection bias. Consistency and integrationWhen merging files, confirm that the join key is unique where it should be unique. A one-to-many merge can unintentionally multiply rows. After integration, compare record counts before and after the merge and calculate matched, unmatched, and multiply matched cases. Units, currencies, dates, and category definitions must also be harmonized. A sales file in dollars cannot be combined with a survey file in euros without a stated conversion rule and relevant date. Data transformationsCommon transformations include: - grouping age or income into analytically meaningful bands;
- converting text dates into a standard date format;
- calculating total expenditure from quantity and unit price;
- creating indicator variables, such as repeat buyer = 1 and non-repeat buyer = 0;
- standardizing units, such as grams to kilograms;
- computing composite scales from several items.
A composite mean for m items can be written as: \bar{x}scale = \frac{1}{m}\sumj=1m xj where xj is the score on item j. The rule for allowable missing items must be stated. For example, an index might be calculated only when at least three of four items are answered. A composite should also be conceptually coherent; statistical convenience does not establish that items measure one construct. 4. Missing ValuesMissingness may be caused by refusal, lack of knowledge, questionnaire routing, technical failure, or accidental omission. Its pattern matters as much as its amount. Three common assumptions are: - MCAR (Missing Completely at Random): missingness is unrelated to observed and unobserved values.
- MAR (Missing at Random): after accounting for observed variables, missingness does not depend on the missing value itself.
- MNAR (Missing Not at Random): missingness depends on the unobserved value or another unmeasured process.
These are assumptions about a data-generating process, not labels that can be proven solely by a statistical test. For example, high-income respondents may be more likely to refuse an income question, suggesting that missingness could be related to the unreported value. StrategiesListwise deletion removes a case from an analysis if it is missing any variable used in that analysis. It is simple but reduces sample size and can bias results when missingness is systematic. Pairwise deletion uses all available pairs for particular calculations. It retains more information but can produce different sample sizes and problematic correlation matrices. Single imputation replaces missing values with a mean, median, regression prediction, or similar value. It is easy but tends to understate uncertainty and variability. Multiple imputation creates several plausible completed datasets, analyzes each, and combines results so that imputation uncertainty is reflected. It is generally preferable to simplistic replacement when missingness is substantial and assumptions are credible, but it requires appropriate modelling and expertise. For descriptive reporting, always state the denominator. If 180 of 200 respondents answered a question, the percentage based on valid responses is 180’s denominator, not necessarily 200. Report both the valid n and the treatment of missing cases. 5. Response Quality and OutliersResponse-quality problemsPoor-quality responses can include: - extremely rapid completion;
- straight-lining, where every matrix item receives the same response;
- contradictory answers;
- nonsensical open-text responses;
- repeated identical submissions;
- failed attention checks;
- patterned or random clicking;
- implausible demographic combinations.
No single indicator is conclusive. A fast respondent may be efficient, and a straight pattern may be genuine. Quality flags should be combined with study-specific evidence, and exclusion rules should be set before inspecting outcomes where possible. Analysts should report how many cases were flagged, how many were removed, and why. OutliersAn outlier is an observation unusually distant from other observations. It may be an error, a special but valid customer, or evidence of a highly skewed market. An outlier should be investigated rather than automatically deleted. For a numerical variable, the interquartile range is: IQR = Q3 − Q1 where Q1 and Q3 are the first and third quartiles. A common exploratory rule flags values below Q1 − 1.5(IQR) or above Q3 + 1.5(IQR). This is a screening convention, not proof of error. For approximately normal data, a z-score is: zi = \frac{xi − \bar{x}}{s} where xi is an observation, \bar{x} is the sample mean, and s is the sample standard deviation. Large absolute z-scores may prompt investigation, but the appropriate threshold depends on sample size, distribution, and purpose. Possible responses include correcting a verified entry error, retaining a valid value, analyzing with a robust statistic, transforming a highly skewed variable, or conducting a sensitivity analysis with and without the observation. Winsorization—replacing extreme values with specified percentile cutoffs—must be explicitly justified because it changes the data. 6. Describing DistributionsA distribution describes the values a variable takes and how frequently they occur. Analysts should inspect both numerical summaries and visual displays. Frequency distributions and proportionsFor category k, the sample proportion is: pk = \frac{nk}{n} where nk is the number of cases in category k and n is the relevant total. A percentage is 100pk. Categories should normally sum to 100%, allowing for rounding and explicitly excluded missing values. Central tendencyThe arithmetic mean is: \bar{x} = \frac{1}{n}\sumi=1nxi It uses every observation and is sensitive to extreme values. The median is the middle ordered value, or the average of the two middle values when the sample size is even. The mode is the most frequent value or category. The median is often preferable for income, spending, or waiting time when distributions are strongly skewed. VariabilityThe sample variance is: s2 = \frac{\sumi=1n(xi − \bar{x})2}{n − 1} and the sample standard deviation is s = √s2. The denominator n − 1 provides an unbiased estimator of population variance under random sampling assumptions. Standard deviation is expressed in the same units as the variable. The range is maximum minus minimum, while the interquartile range describes the middle 50% and is less affected by extremes. The coefficient of variation is: CV = \frac{s}{\bar{x}} × 100\% It compares relative dispersion when the variable has a meaningful zero and a positive mean. It is inappropriate for variables measured on arbitrary scales or when the mean is zero or near zero. Shape and visualizationSkewness describes asymmetry. A right-skewed spending distribution has many modest values and a small number of very large values; its mean may exceed its median. A histogram shows the shape of a numerical distribution. A boxplot displays the median, quartiles, whiskers, and potential outliers. A bar chart is appropriate for categorical frequencies, while a line chart is generally suited to ordered time observations. A scatterplot can reveal association, clusters, curvature, and influential observations between two numerical variables. Graphs require honest scales, clear labels, units, meaningful category order, and visible sample sizes. Truncated axes can exaggerate differences, while three-dimensional effects usually reduce readability. 7. Confidence Intervals and Practical ImportanceA sample statistic is an estimate, not an exact population truth. A confidence interval communicates sampling uncertainty. For a sample mean, a commonly used interval is: \bar{x} ± t1−α/2,\,n−1\frac{s}{√n} where t1−α/2,\,n−1 is the appropriate t critical value, α is the significance level, s is the sample standard deviation, and n is the sample size. The formula assumes independent observations and is most reliable when the sampling design supports inference and the sampling distribution of the mean is approximately normal. With a complex sample design, weights and design effects may be required. A 95% confidence interval does not mean there is a 95% probability that a fixed population parameter lies inside this particular interval. In repeated sampling under the same procedure, approximately 95% of constructed intervals would contain the parameter. For a proportion, a simple large-sample interval is: p̂ ± z1−α/2√\frac{p̂(1−p̂)}{n} where p̂ is the sample proportion. This approximation can perform poorly with small samples or proportions close to 0 or 1; Wilson or exact methods may be preferable. Statistical significance does not equal managerial importance. A practical effect size describes the magnitude of a difference or relationship. For two independent group means, Cohen’s d is commonly expressed as: d = \frac{\bar{x}1 − \bar{x}2}{sp} where sp is the pooled standard deviation under the assumption of comparable population variances. For a 2 × 2 table, the risk difference is p1 − p2, the relative risk is p1/p2, and the odds ratio is (p1/(1−p1))/(p2/(1−p2)). These measures answer different managerial questions and should not be treated as interchangeable. 8. Cross-TabulationsA cross-tabulation summarizes the joint distribution of two categorical variables. For example, purchase channel can be displayed by age group. Percentages must be labelled as row percentages, column percentages, or total percentages. Row percentages answer “within each channel, what share belongs to each age group?” Column percentages answer “within each age group, what share uses each channel?” Confusing these interpretations is a frequent reporting error. A chi-square test may assess whether two categorical variables are statistically associated, but it does not establish causality. Expected cell counts should be examined; sparse tables may require category consolidation or an exact method. The phi coefficient for a 2 × 2 table and Cramér’s V for larger tables provide association measures, with values bounded between 0 and 1. Their interpretation depends on context, table size, and field norms rather than universal cutoffs. 9. Worked Example: Launch Survey for a Subscription ServiceA fictional subscription retailer surveys 200 eligible adults after a trial campaign. The team wants to estimate satisfaction, compare acquisition channels, and decide whether a service redesign is warranted. PreparationThe questionnaire records channel, four satisfaction items scored 1–5, monthly spending, age, completion time, and an attention-check item. The data dictionary identifies 97 as “not applicable” and 99 as “refused.” The team finds 6 duplicate submissions, 4 ineligible respondents, and 5 cases that fail two independent quality criteria. According to a pre-specified rule, these 15 cases are excluded, leaving 185 eligible, unique, quality-approved cases. The raw file and exclusion log are retained. Three respondents have missing answers on one satisfaction item. Because each answered at least three items, the documented scale rule computes their individual mean from valid items. The resulting satisfaction index has a mean of 3.86, a median of 4.00, and a standard deviation of 0.74. The median suggests that a typical respondent is satisfied, while the standard deviation indicates meaningful variation rather than universal approval. Distribution and uncertaintySuppose 112 of the 185 respondents rate the service 4 or 5. The estimated proportion is: p̂ = 112/185 = 0.605 \approx 60.5\% Using a 95% large-sample approximation, the standard error is approximately 0.036. With a critical value of 1.96, the margin of error is approximately 0.071, producing an interval of about 53.4% to 67.6%. Because this is a simple illustrative calculation, the team should use a more suitable interval method in software and account for weighting or complex sampling if applicable. Channel comparisonThe cross-tabulation shows that 68% of social-media-acquired customers rate the service 4 or 5, compared with 55% of search-acquired customers. The 13-percentage-point difference may be commercially relevant, but the team should inspect group sizes, confidence intervals, and possible confounding. Social-media customers may be younger or exposed to a different offer. The descriptive result supports further investigation; it does not prove that the channel caused higher satisfaction. DecisionThe retailer retains the service but prioritizes investigation of lower-scoring delivery items. It does not remove high-spending respondents merely because they increase the mean. Instead, it reports median spending, examines the distribution, and conducts a sensitivity analysis. The report clearly distinguishes cleaned descriptive evidence from causal claims. 10. Ethical, Governance, and Professional IssuesData preparation involves decisions about people’s representation. Researchers should minimize unnecessary collection, protect identifiers, restrict access, and follow institutional policies and applicable privacy law. Personally identifying information should be separated from analytical variables where possible. Derived scores must not be used to make high-stakes decisions without validation and fairness assessment. Analysts should not delete inconvenient cases, change codes to obtain a preferred result, or present exploratory analyses as confirmatory findings. Automated quality flags and AI-assisted cleaning can improve efficiency, but they may reproduce biases, misclassify unusual legitimate respondents, or obscure decision logic. Human review, version control, audit trails, and disclosure of automated procedures are essential. Best-Practice Checklist- Define the unit of analysis before analysis begins.
- Preserve raw data and document every transformation.
- Use a complete, accessible data dictionary.
- Distinguish valid, missing, invalid, and not-applicable values.
- Establish quality and exclusion rules before inspecting outcomes.
- Investigate outliers rather than deleting them automatically.
- Report denominators, missing-data treatment, and sample exclusions.
- Match statistics and charts to measurement level and distribution shape.
- Report uncertainty and practical magnitude, not only p-values.
- Check merged-file row counts and key uniqueness.
- Protect personal data and communicate limitations honestly.
Chapter SummaryData preparation transforms raw marketing information into a reliable analytical resource. Coding schemes and data dictionaries make variables interpretable and support reproducibility. Cleaning requires range checks, skip-pattern validation, duplicate detection, careful integration, and transparent transformations. Missingness should be understood in relation to MCAR, MAR, and MNAR assumptions; no single treatment is universally correct. Outliers and response-quality problems require investigation and documented criteria rather than automatic deletion. Descriptive analysis summarizes categorical variables with frequencies and proportions and numerical variables with measures of central tendency, variability, and distribution shape. Histograms, boxplots, bar charts, and scatterplots provide complementary views. Cross-tabulations reveal categorical patterns, while confidence intervals communicate sampling uncertainty. Effect sizes and percentage-point differences help managers judge practical importance. Ethical practice requires privacy protection, auditability, fair treatment of unusual cases, and clear separation between descriptive association and causal inference. Key TermsData dictionary: A structured description of variables, codes, formats, ranges, and derivations. Coding scheme: Rules for representing responses as categories or numerical values. Unit of analysis: The entity about which a conclusion is made. Nominal measurement: Classification into categories without order. Ordinal measurement: Ordered categories without guaranteed equal intervals. Ratio measurement: Numerical measurement with equal intervals and a meaningful zero. Data cleaning: Detecting and correcting, documenting, or managing data problems. Skip pattern: Questionnaire routing that determines which questions a respondent receives. Missing data: Values not observed or not recorded for a case and variable. MCAR: Missing completely at random. MAR: Missing at random conditional on observed information. MNAR: Missing not at random. Outlier: An observation unusually distant from the rest of a distribution. Interquartile range: The difference between the third and first quartiles. Standard deviation: A measure of dispersion around the sample mean. Cross-tabulation: A table showing the joint frequencies of categorical variables. Confidence interval: An interval produced by a procedure designed to capture a population parameter at a stated long-run rate. Effect size: A measure of the magnitude of a difference or relationship. Data provenance: A record of where data came from and how it was changed. Response quality: The extent to which responses are attentive, valid, and usable. Review QuestionsShort Answer Questions- What is the purpose of a data dictionary?
- Distinguish nominal, ordinal, and ratio measurement.
- Why should missing-value reasons be coded separately?
- What does the interquartile range measure?
- Why does statistical significance not necessarily imply managerial importance?
Long Answer Questions- Explain a complete workflow for converting raw survey responses into an analysis-ready dataset.
- Compare listwise deletion, single imputation, and multiple imputation, including their limitations.
- Explain how an analyst should investigate and report outliers.
- Discuss how row, column, and total percentages lead to different interpretations of a cross-tabulation.
- Explain the meaning and assumptions of a confidence interval for a sample mean.
Analytical / Application Questions- A brand survey records satisfaction on a 1–5 scale, but 12 respondents have values of 0 and 99. Design a coding, validation, and reporting procedure.
- A retailer finds that the mean monthly spending is much higher than the median. Identify likely distributional explanations and recommend descriptive statistics and visualizations.
- Social-media customers show a 13-percentage-point higher recommendation rate than search customers. Describe the additional analyses needed before making a budget-allocation recommendation.
Multiple Choice Questions with AnswersQuestion 1Which document specifies a variable’s meaning, valid values, missing codes, and derivation rules? A. A data dictionary B. A sampling frame C. A sales forecast D. A respondent incentive schedule Correct Answer: A. A data dictionary Question 2For a strongly right-skewed income distribution, which measure of central tendency is generally least affected by extreme high incomes? A. Mean B. Median C. Range D. Variance Correct Answer: B. Median Question 3What does the interquartile range represent? A. The distance between the minimum and maximum B. The average distance from the mean C. The difference between the third and first quartiles D. The percentage of missing observations Correct Answer: C. The difference between the third and first quartiles Question 4A code of 99 is used for both “refused” and a valid value in a dataset. What is the principal problem? A. The sample is necessarily too small B. The code is ambiguous and can misclassify observations C. The variable must be ratio level D. The mean will always equal the median Correct Answer: B. The code is ambiguous and can misclassify observations Question 5Which statement about an outlier is most appropriate? A. It must always be deleted B. It is always a data-entry error C. It should be investigated and may be retained if valid D. It can be ignored when calculating percentages Correct Answer: C. It should be investigated and may be retained if valid Question 6A researcher wants to show the shape of customers’ spending values. Which display is most appropriate? A. Histogram B. Pie chart C. Organizational chart D. Cross-tabulation only Correct Answer: A. Histogram Question 7If 112 of 185 respondents give a favorable rating, the sample proportion is approximately: A. 40.5% B. 53.4% C. 60.5% D. 71.2% Correct Answer: C. 60.5% Question 8What does a 95% confidence interval describe under its repeated-sampling interpretation? A. A 95% probability that the fixed parameter moves between its endpoints B. The procedure’s long-run rate of capturing the population parameter C. The percentage of respondents who answered correctly D. The probability that the sample contains no outliers Correct Answer: B. The procedure’s long-run rate of capturing the population parameter Question 9Which percentage in a cross-tabulation answers “within each row category, how are cases distributed across columns?” A. Row percentage B. Column percentage C. Total percentage D. Missing percentage Correct Answer: A. Row percentage Question 10Why should practical effect sizes accompany significance tests? A. They identify the questionnaire’s font size B. They show the magnitude and possible managerial importance of a result C. They eliminate all sampling error D. They prove that an association is causal Correct Answer: B. They show the magnitude and possible managerial importance of a result
|