MODULE 2 ยท LESSON 2.4
Cleaning Health Data
Estimated time: 25โ30 minutes
WRITTEN ON THE BOARD
Lesson 2.4 is about cleaning health
READ COMPLETE NOTES
2.4.1 What is data cleaning?
Data cleaning is the process of identifying and addressing problems that could affect the reliability of a dataset.
- Missing values.
- Duplicate records.
- Inconsistent names.
- Incorrect formats.
- Invalid entries.
- Values that require investigation.
Cleaning does not mean changing any value that looks unusual. A value might be correct even if it is unexpected. The analyst must investigate before correcting or removing information.
2.4.2 Missing values
| Facility | Month | Patients |
|---|---|---|
| Central Clinic | January | 120 |
| Riverside Clinic | January | (blank) |
| Hilltop Clinic | January | 110 |
The patient count for Riverside Clinic is missing. We do not know whether the facility did not submit its report, the report was submitted but the value was omitted, the service was not provided, or the value was lost during data entry.
2.4.3 Duplicate records
| Facility | Month | Patients |
|---|---|---|
| Central Clinic | January | 120 |
| Central Clinic | January | 120 |
These rows might be duplicates, but we cannot be certain from the table alone. Before deleting a record, check the source document or the dataset's record-identification rules. Two identical-looking records might represent legitimate separate submissions, depending on how the data was collected.
Remove Duplicates, then check the result
Excel can find repeated rows. Use it on a copy of the file, after you have decided which columns define a duplicate.
- Save a copy of the workbook. Leave the original untouched.
- Select the whole data table, including the header row.
- Open the Data tab and choose Remove Duplicates.
- Tick only the columns that should match, such as Facility and Month. Leave Patients unticked if two different counts for the same facility and month should stay visible for investigation.
- Confirm. Excel reports how many duplicate rows it removed.
- Compare the result with the source documents before you treat the cleaned sheet as final.
TRIM for extra spaces
A facility name can look the same and still fail a filter because of a space at the end. TRIM removes spaces at the beginning and end of text, and reduces repeated spaces inside the text.
- In a new column, enter =TRIM(A2) if the facility name is in A2.
- Fill the formula down the column.
- Check that the cleaned names look right.
- Copy the new column and Paste Values over the original names only after you have compared them.
- TRIM does not decide that Riverside and Riverside Clinic are the same facility. That still needs an approved facility list.
2.4.4 Inconsistent text
- Central Clinic
- central clinic
- Central clinic
These values may refer to the same facility. Use an approved facility list or unique facility identifier to standardise the names. Avoid making assumptions based only on similar spelling.
2.4.5 Implausible values
Suppose a monthly report records 9,000 patient visits at a small clinic that usually records around 100. That value deserves investigation. It might be a typing error, a misplaced digit, a legitimate unusual event, or a difference in how visits were counted.
2.4.6 A practical data-cleaning workflow
- Preserve the original dataset.
- Examine the column headings and structure.
- Check missing values.
- Investigate possible duplicates.
- Review inconsistent names and formats.
- Flag implausible or invalid values.
- Verify suspected errors against appropriate source information.
- Make documented corrections.
- Record unresolved issues.
- Recheck the cleaned dataset.
Lesson 2.4 exercise
| Facility | Month | Patients |
|---|---|---|
| Central Clinic | January | 120 |
| central clinic | January | 120 |
| Riverside Clinic | January | (blank) |
| Hilltop Clinic | January | 1100 |
Identify three items that require investigation.
Suggested answer
- What needs investigation?