By the end of this chapter, you will be able to:
Mastering these skills will help you confidently plan and carry out scientific research, making you a valuable contributor in any laboratory or research environment.
Compiled by: Kevin Rotich
Data organisation is the work that turns the raw records of a study (notebook pages, instrument printouts, questionnaire sheets, interview recordings) into one structured dataset that can be analysed without error. It has three stages taken in order: formatting, cleaning and coding. Formatting gives every value a fixed place and type, cleaning finds and corrects errors without changing real results, and coding converts categories, responses and sample names into short symbols that software can count and protect.
Two rules apply to all three stages. First, the raw data are never overwritten: one untouched copy is kept as the record of what was measured, and every change is made on a working copy. Second, every change is written down, so that another researcher can follow the path from the raw record to the number used in the analysis. A technician who cannot show that path cannot defend a result when a supervisor, assessor or reviewer asks for it.
Data formatting is the arrangement of values in a table so that each row is one observation, each column is one variable, and each cell holds one value of a fixed type. A water-testing laboratory that records pH, turbidity, nitrate and coliform counts for twelve boreholes in a wet and a dry season produces 24 observations. If these are typed as a tidy table, a statistical package can read them directly. If they are typed as a report with merged cells and notes inside the numbers, hours go into repairing the sheet before any analysis can start.
Example of a tidy table for the borehole survey:
| Sample_ID | Borehole | Season | Sample_date | pH | Turbidity_NTU | Nitrate_mg_L | Coliforms_cfu_100mL |
|---|---|---|---|---|---|---|---|
| BH01-W-A | BH01 | Wet | 2026-04-14 | 7.12 | 3.2 | 8.4 | 0 |
| BH01-D-A | BH01 | Dry | 2026-09-08 | 7.25 | 1.9 | 11.7 | 0 |
| BH02-W-A | BH02 | Wet | 2026-04-14 | 6.88 | 5.6 | 14.2 | 12 |
| BH02-D-A | BH02 | Dry | 2026-09-08 | 7.01 | 3.1 | 17.9 | 4 |
The scale on which a variable is measured decides how it is formatted and which analysis is allowed later. A column of borehole names is not averaged, and a column of nitrate values is not treated as a list of labels.
| Scale | Meaning | Example | How it is stored |
|---|---|---|---|
| Nominal | Categories with no order | Borehole name, soil type | Text, or a code |
| Ordinal | Categories with an order but unequal gaps | Water appearance: clear, slightly cloudy, cloudy | Text, or ranked codes 1, 2, 3 |
| Interval | Equal gaps, no true zero | Water temperature in °C | Number |
| Ratio | Equal gaps and a true zero | Nitrate in mg/L, turbidity in NTU | Number |
In a wide layout each borehole has one row and each season has its own columns (pH_wet, pH_dry). In a long layout each borehole appears twice and a Season column says which reading is which. Most statistical software expects the long layout, because a new season or a new variable adds rows or columns without changing the structure. The wide layout is convenient for a paired comparison in a spreadsheet. Keep the long table as the master and build a wide table from it only when a procedure asks for it.
A spreadsheet can prevent errors at the moment of entry. The tools below are in current versions of Microsoft Excel and in most spreadsheet programs under similar names.
| Tool | Where to find it | Use |
|---|---|---|
| Freeze Panes | View tab | Keeps the header row visible while scrolling through long tables |
| Format as Table | Home tab (or Ctrl+T) | Gives each column a filter and makes formulas expand with new rows |
| Data Validation | Data tab | Refuses entries that break a rule |
| Text to Columns | Data tab | Splits one column holding two variables, such as "7.12 pH" |
| Number Format | Home tab | Fixes the number of decimal places and the date pattern |
| Conditional Formatting | Home tab | Highlights values outside an expected range for checking |
Examples of validation rules for the borehole table:
| Column | Rule | Message to the person typing |
|---|---|---|
| pH | Decimal between 0 and 14 | pH must be between 0 and 14 |
| Season | List: Wet, Dry | Choose Wet or Dry |
| Sample_date | Date within the sampling period | Enter a date in the study period |
| Turbidity_NTU | Decimal greater than or equal to 0 | Turbidity cannot be negative |
A data dictionary is a separate sheet that describes every column so that the table can be understood without its author. It lists the variable name, a plain description, the unit, the type, the allowed values and the method or instrument used.
| Variable | Description | Unit | Type | Allowed values | Method |
|---|---|---|---|---|---|
| Nitrate_mg_L | Nitrate in water, reported as nitrate | mg/L | Number | 0 or more | Spectrophotometric method in the laboratory SOP |
| Season | Season of sampling | None | Text | Wet, Dry | Sampling plan |
| Coliforms_cfu_100mL | Coliform colonies counted | cfu per 100 mL | Whole number | 0 or more | Membrane filtration |
Data cleaning is the screening of a formatted dataset to find values that are wrong, missing, repeated or inconsistent, and the correction or documented handling of each one. Its aim is a dataset that records what was measured, not one that looks neat. A value is never changed because it spoils a trend. It is changed only when evidence, such as the notebook or the instrument printout, shows that the entry differs from what was measured.
| Problem | Example | How it is found | Usual action |
|---|---|---|---|
| Entry error | Moisture entered as 124 instead of 12.4 | Range check, sort, validation rule | Compare with the notebook and correct |
| Missing value | A blank in a pH cell | Count blanks in each column | Handle as described below |
| Duplicate record | Sample BH02-W-A entered twice | Sort by Sample_ID, or highlight duplicate values with Conditional Formatting | Confirm both lines are identical, keep one |
| Inconsistent label | "BH 1", "bh01" and "BH01" | Filter the column to see its distinct entries | Replace with one agreed label |
| Inconsistent unit | Some nitrate values in µg/L | Compare the size of values with the header | Convert (1 mg/L = 1000 µg/L) |
| Impossible value | pH of 17 | Validation rule, minimum and maximum | Check the source and correct or mark missing |
| Suspect value | One replicate far from the others | Plot, Q test | Investigate before any decision |
The cleaning log is a table that records each change, so that the cleaned file can be traced back to the raw file.
| Record | Variable | Original value | Action | New value | Reason | Initials and date |
|---|---|---|---|---|---|---|
| FQ-017 | Moisture_pct | 124 | Corrected | 12.4 | Decimal slip, notebook page 31 shows 12.4 | AM, 2026-10-03 |
| FQ-022 | Moisture_pct | blank | Marked missing | NA | Sample spilled, no result recorded | AM, 2026-10-03 |
| FQ-031 | Batch | bh 4 | Standardised | BH04 | Label format | AM, 2026-10-03 |
A value can be missing because the sample was lost, the instrument failed, the result was invalid, the question did not apply, or the result was below the limit the method can detect. These reasons are recorded, because they are different problems. In a spreadsheet a missing value is a blank cell or the letters NA, used the same way everywhere. A number such as 0 or -99 typed into a numeric column is read as data and will distort every mean unless it is filtered out.
Common ways of handling missing values:
Worked example (soil-testing laboratory): the pH of five plots was measured as 6.2, 6.5, missing, 6.4 and 6.3.
Mean of the four values present = (6.2 + 6.5 + 6.4 + 6.3) ÷ 4 = 25.4 ÷ 4 = 6.35
Standard deviation of the four values (sample, n - 1) = 0.129
If 6.35 is substituted for the gap, the mean stays 6.35 but the standard deviation of the five values falls to 0.112. The spread has shrunk by about 13 per cent because the new value sits exactly at the centre, so any test that uses it will be slightly too confident. The log must state that one value was substituted and why.
A result reported as "less than 0.01 mg/L" is not zero and not missing: the method could not distinguish it from nothing. Enter it as text in a separate column or mark it with a flag column (Below_DL = Yes), and keep the detection limit in the data dictionary. Some laboratories substitute half the detection limit for the calculation, and a few use specialised statistical methods. Whichever is chosen is written in the methods and applied to all values below the limit.
An outlier is a value that lies far from the rest of its group. It may be a recording error, a real extreme or a sign of a procedural fault, so it is investigated, not deleted. For a small group of replicates (3 to 10 values) analytical laboratories commonly use the Dixon Q test.
Q = (gap between the suspect value and its nearest neighbour) ÷ (range of all values)
Critical values of Q at 95 per cent confidence for one suspect value:
| n | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|
| Q critical | 0.970 | 0.829 | 0.710 | 0.625 | 0.568 | 0.526 | 0.493 | 0.466 |
If the calculated Q is larger than the critical value for n, the suspect value is flagged as a statistical outlier. The test is applied once to a set, assumes data that are roughly normal, and does not prove that the value is wrong. Larger sets use other tests, such as the Grubbs test, or a box plot.
Worked example (food-quality laboratory): five replicate moisture contents of one lot of maize flour, in per cent, are 12.1, 12.3, 12.2, 12.4 and 13.4.
Arrange in order: 12.1, 12.2, 12.3, 12.4, 13.4
Gap = 13.4 - 12.4 = 1.0
Range = 13.4 - 12.1 = 1.3
Q = 1.0 ÷ 1.3 = 0.769
The critical value for n = 5 is 0.710. Because 0.769 is greater than 0.710, the value 13.4 is flagged. The technician then checks the notebook for a cause such as a sample left uncovered before weighing or a wrong crucible number. If a cause is found, the value is excluded or corrected and the reason is logged. If no cause is found, the value stays in the dataset and the report gives the mean both ways.
Mean with all five values = 62.4 ÷ 5 = 12.48 per cent
Mean without 13.4 = 49.0 ÷ 4 = 12.25 per cent
The difference of 0.23 percentage points shows how much one value moves a small group, which is why the decision is documented.
Data coding is the assignment of numbers, short labels or theme names to categories, responses, text passages and samples so that they can be counted, compared and, where needed, anonymised. A column that holds "Wet" and "Dry" can be analysed, but a code of 1 and 2, or 0 and 1, lets the software use it in a calculation. Coding rules are written in a codebook before data entry, not invented while typing.
Sample codes carry information and can hide it. In an industrial quality-control laboratory a code such as L2-1103-B07 can mean production line 2, produced on 11 March, batch 07. When the analyst must not know which treatment or supplier a sample came from, the sample is given a random code and the key linking the code to the source is stored by another person until the analysis is finished. This is called blind coding and it prevents expectation from influencing the reading. A good code is unique, short, free of spaces and free of names of people or places that would reveal a participant.
Qualitative data are words, such as interview transcripts, open answers and observation notes. Coding labels the passages that carry an idea, so that the ideas can be grouped and counted.
Example (research laboratory, interviews with analysts about why results reach the client late):
| Excerpt | Code |
|---|---|
| "The balance is often under service, so we queue for the one that works." | Equipment unavailable |
| "We wait for the reagent order and sometimes borrow from another bench." | Reagent supply delay |
| "I write the result in the notebook and again in the spreadsheet, and it takes time." | Duplicate recording |
| Code | Definition | Include | Exclude | Example |
|---|---|---|---|---|
| Equipment unavailable | An instrument cannot be used when it is needed | Breakdown, service or calibration downtime, queueing for a shared instrument | Delay caused by staff absence | "The balance is under service." |
| Reagent supply delay | Work waits for materials to arrive | Late orders, borrowing from another bench | Cost of reagents | "We wait for the reagent order." |
| Duplicate recording | The same result is written more than once | Notebook entry followed by spreadsheet entry | Checking of a result by a second person | "I write the result twice." |
Two people who code the same sample of excerpts should reach similar results. The simplest measure is percentage agreement, but it counts agreement that happens by chance. Cohen's kappa corrects for chance:
kappa = (Po - Pe) ÷ (1 - Pe)
where Po is the observed proportion of agreement and Pe is the proportion expected by chance from each coder's totals.
Worked example: two coders classify 20 excerpts as Theme A or Theme B. Both choose A for 9 excerpts and both choose B for 7. Coder 1 chooses A and coder 2 chooses B for 2 excerpts, and the reverse for 2 excerpts.
Po = (9 + 7) ÷ 20 = 0.80
Coder 1 chose A 11 times and B 9 times. Coder 2 chose A 11 times and B 9 times.
Pe = (11 ÷ 20) × (11 ÷ 20) + (9 ÷ 20) × (9 ÷ 20) = 0.3025 + 0.2025 = 0.505
kappa = (0.80 - 0.505) ÷ (1 - 0.505) = 0.295 ÷ 0.495 = 0.596
Agreement of 80 per cent looks high, but after correcting for chance the kappa is about 0.60, which many researchers describe as moderate. Researchers often aim for 0.61 or more, the band Landis and Koch called substantial. The coders discuss each disagreement, sharpen the code definitions in the codebook, and code a fresh sample again.
A spreadsheet with one column for the excerpt and one for the code is enough for a small study. Dedicated qualitative software, such as NVivo or the free Taguette, stores the codes, retrieves every passage under a code and keeps the codebook with the data. Whatever tool is used, the codebook and a copy of the coded data are stored with the dataset.
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountType: Individual
| Tools & Equipment | Materials |
|---|---|
| Lab coat | Lab coat |
| Closed shoes | Closed shoes |
| Hand gloves | Hand gloves |
| Answer booklet | Answer booklet |
| Writing materials | Writing materials |
| Scientific calculator | Scientific calculator |
| Research site map (A4 printout) | Research site map (A4 printout) |
| Reference textbooks on scientific research | Reference textbooks on scientific research |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Lab coat | 1 Pc per Candidate |
| 2 | Closed shoes | 1 Pair per Candidate |
| 3 | Hand gloves | 1 Pair per Candidate |
| 4 | Answer booklet | 1 Pc per Candidate |
| 5 | Writing materials | 1 Set per Candidate |
| 6 | Scientific calculator | 1 Pc per Candidate |
| 7 | Research site map (A4 printout) | 1 Pc per Candidate |
| 8 | Reference textbooks on scientific research | Access per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Identification and Formulation of Research Problem | |||
| Donned PPEs (lab coat, closed shoes, gloves) as per workplace safety procedures (Award 1 mark for each correctly donned PPE: lab coat, closed shoes, gloves x 3 = 3 Marks) | 3 | ||
| Reviewed reference textbooks to select a relevant scientific research topic (Award 2 marks for correctly selecting and referencing a suitable scientific research topic; zero if not relevant) | 2 | ||
| Examined provided site map and identified a suitable study site for the research topic (Award 2 marks for correctly identifying and marking a suitable study site on the map; zero if not relevant to topic) | 2 | ||
| Formulated a clear research problem statement based on the selected topic and site (Award 4 marks for a concise, relevant, and scientifically valid research problem; zero if vague or unrelated) | 4 | ||
| Stated at least two specific and measurable research objectives aligned with the research problem (Award 2 marks per valid research objective; zero if objectives are not clear or measurable x 2 = 4 Marks) | 4 | ||
| Sub-Total | 15 | ||
| PRODUCT CHECKLIST | |||
| Research proposal includes a clearly stated scientific topic (Award 2 marks for a topic relevant to scientific research; zero if missing/irrelevant) | 2 | ||
| Study site accurately specified and marked on the provided site map (Award 2 marks for clear site identification and marking; zero if missing or not matching topic) | 2 | ||
| Research problem is precise, relevant, and scientifically valid (Award 3 marks for a problem statement that is concise, relevant, and scientifically valid; zero if vague or unrelated) | 3 | ||
| At least two research objectives are stated, each specific and measurable (Award 1.5 marks per valid objective; zero if not specific or measurable x 2 = 3 Marks) | 3 | ||
| Proposal is well structured, clear, and free from major errors (Award 2 marks for clear, logical structure and correct spelling/grammar; zero if poorly organized or unclear) | 2 | ||
| Sub-Total | 12 | ||
| GRAND TOTAL | 27 | ||
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Lab coat | Research problem brief |
| Closed shoes | A4 ruled paper |
| Writing materials (pen, pencil, eraser) | Answer booklet |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Lab coat | 1 Pc per Candidate |
| 2 | Closed shoes | 1 Pair per Candidate |
| 3 | Research problem brief | 1 Pc per Candidate |
| 4 | Writing materials (pen, pencil, eraser) | 1 Set per Candidate |
| 5 | A4 ruled paper | 5 Sheets per Candidate |
| 6 | Answer booklet | 1 Pc per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Preparation and Development of Research Questions | |||
| Wore PPEs (lab coat, closed shoes) as per laboratory safety procedures (Award 1 mark for each PPE correctly worn or 0) | 2 | ||
| Read and understood the provided research problem and objectives (Award 2 marks or 0 for comprehensively reviewing and noting the research problem and objectives) | 2 | ||
| Organized writing materials and workspace appropriately (Award 1 mark for arranging all materials and workspace in a neat and organized manner or 0) | 1 | ||
| Drafted at least five research questions on A4 paper (Award 1 mark per attempted draft research question up to 5 marks) | 5 | ||
| Sub-Total | 10 | ||
| PRODUCT CHECKLIST | |||
| All five research questions are directly aligned with the provided research problem (Award 1 mark per correctly aligned question) | 5 | ||
| Each question is specific (clearly defines what will be addressed) (Award 1 mark per question that is specific) | 5 | ||
| Each question is measurable (can be answered by data or observation) (Award 1 mark per question that is measurable) | 5 | ||
| Each question is relevant to the stated objectives (Award 1 mark per question that is relevant) | 5 | ||
| Questions are presented in a clear, logical, and grammatically correct manner (Award 5 marks if all questions are clearly and grammatically presented; deduct 1 mark for each unclear or grammatically incorrect question) | 5 | ||
| Sub-Total | 25 | ||
| GRAND TOTAL | 35 | ||
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.