Sub topic 4
Cleaning and Exploring the Results
Assume you have basic familiarity with percentages and averages, understand how a press release is structured, and can open survey results in a spreadsheet or table. Before looking for a news angle, make sure the data is usable. Cleaning means finding and correcting problems in the survey file. Exploring means examining patterns without yet claiming that they prove anything.
Preserve the original and define the fields
Keep an unchanged copy of the original export. Work from a separate cleaned copy. Record each change in a log so another person can reproduce it.
Create a data dictionary. A data dictionary is a list that explains each column, its meaning, and its allowed values.
| Field | Meaning | Allowed values |
|---|---|---|
| `age_group` | Respondent's age category | `18-34`, `35-54`, `55+` |
| `support` | Supports the proposal | `Yes`, `No`, `Unsure` |
| `weight` | Adjustment applied to the response | Positive number |
Check that column names are consistent and that categories use one spelling. For example, Yes, yes, and Y should not become three separate answers.
Find missing, duplicate, and invalid records
A missing value is an unanswered or unavailable response. Do not automatically treat it as “No.” Report how many people answered each question and calculate percentages using the valid answers for that question.
A duplicate record is a response entered more than once. Use the survey platform's response ID when one exists. If no ID exists, inspect combinations such as timestamp, demographic fields, and answer patterns. Do not remove records only because two people gave the same answers.
Invalid records violate the survey rules. Examples include an age outside the eligible range, a response completed in zero seconds, or a value that is not one of the permitted choices. Document the rule used to exclude each record.
import csv
import io
from collections import Counter
csv_text = """response_id,age_group,support
101,18-34,Yes
102,35-54,No
103,18-34,Yes
104,55+,Unsure
105,18-34,
"""
rows = list(csv.DictReader(io.StringIO(csv_text)))
allowed_support = {"Yes", "No", "Unsure"}
valid_rows = [
row for row in rows
if row["support"] in allowed_support
]
counts = Counter(row["support"] for row in valid_rows)
total = len(valid_rows)
print("Valid responses:", total)
for answer in sorted(allowed_support):
count = counts[answer]
percent = count / total * 100 if total else 0
print(f"{answer}: {count} ({percent:.1f}%)")This script excludes the blank support response from the denominator. In a real project, also save the excluded response IDs and the reason for exclusion.
Explore the results systematically
Start with counts and percentages for each important question. Then compare results across meaningful groups, such as age or region. Always show the number of respondents behind a percentage. A group with 80% support from 15 people deserves more caution than a group with 52% support from 1,000 people.
Look for:
- Unexpectedly high or low missingness.
- Categories with very few responses.
- Differences between groups.
- Responses that contradict skip logic.
- Large changes from an earlier survey.
- Results that appear only after filtering or weighting.
Weighted results use adjustment factors so the sample better matches a target population. Explore both unweighted and weighted counts. A large difference between them is important context for the methodology note.
Separate patterns from stories
Exploration generates possible angles. It does not prove that a difference is meaningful or that one factor caused another. Mark findings as “check,” “promising,” or “ready for review.” Before publication, verify the denominator, wording of the question, fieldwork dates, weighting, and uncertainty.
A useful exploration table might include the finding, the calculation, the respondent count, and the follow-up needed.
Exercise
In a survey, 60 of 100 respondents in one group support a proposal, while 6 of 10 respondents in another group support it. What should you check before saying the groups differ?
Show answer
Check the group definitions, missing responses, weighting, question wording, and sample sizes. Both percentages are 60%, so the displayed counts do not show a difference.