← Back to Blog
final year project

How to Code and Clean Questionnaire Data for a Project

A project organising raw responses, analysis decisions and findings

Code and clean questionnaire data by preserving the raw responses, defining every variable, checking entries against the questionnaire and recording each change. Cleaning should make the data understandable and accurate. It should not make the findings more convenient.

Your cleaning decisions need to stay visible in the project you submit. UniDraft helps organise the methods, verified analysis outputs and instructions you confirm into an editable Word document. Start your project document, then compare every number and explanation with your checked files. The project workflow supports the written account; you perform the cleaning and analysis and keep confidential data protected.

Keep three separate records

Keep an untouched raw export, a working analysis file and a decision log. Restrict access to identifying information. Use participant IDs where appropriate, with any identity key stored separately and securely under your study's arrangements.

If you used Google Forms, retain the original export before editing headings, removing columns or recoding responses. A spreadsheet's undo history is not a durable explanation of your analysis.

Build a codebook before calculating anything

Illustrative coding scheme, not research data:

Variable Meaning Permitted values Missing or special handling
participant_id Non-identifying study record Unique ID such as P001 Check uniqueness; keep names out of the analysis file
q1_feedback_clear Agreement with the approved clarity item 1 strongly disagree to 5 strongly agree An unanswered item stays missing, not neutral
q2_feedback_used Whether the respondent used feedback 0 no; 1 yes Zero is a valid answer here, unlike a blank
q3_other Explanation in the respondent's words Text Review for identifying details before sharing

The same number can mean different things in different variables. A 1 is meaningless without its label. If the questionnaire uses another scale, document that scale rather than forcing this example onto it.

The UK Data Service's documentation guidance stresses explaining variable headings, codes and transformations. Your working codebook should let another authorised reader understand the file without guessing.

Check entries systematically

  1. Range: is a response outside the allowed options, such as 7 on a 1–5 item?
  2. Type: did a number become text, or a date become an unexpected format during import?
  3. Eligibility: does the case meet the study's documented inclusion criteria?
  4. Consistency: does a follow-up answer conflict with the route the participant should have taken?
  5. Possible duplicates: is there evidence of repeat submission under the study's defined procedure?

Flag a suspicious entry and investigate its source. Do not declare two respondents duplicates merely because they chose identical answers. Correct a transcription error only when the original record establishes the correct value; otherwise preserve uncertainty and document the decision.

Treat missing answers as missing information

Distinguish not answered, not asked because of routing, and not applicable. The distinction affects which denominator and analysis make sense. If you use a numeric missing-value code, define it as missing in the analysis software so that it is not averaged with valid answers.

IBM's missing-value documentation describes tools for examining incomplete data. It does not mean every undergraduate dataset should use imputation. Discuss the extent, likely reasons and suitable handling with your supervisor or statistician. Do not fill blanks with a mean or a preferred answer without a justified analysis plan.

Record a cleaning decision clearly

Teaching example: a value of 55 appears in a 1–5 response column. Check the original response. If it clearly says 5 and the extra digit was introduced during manual entry, record the correction from 55 to 5, the evidence and date. If the original cannot resolve it, do not guess 5 simply because it looks plausible.

Your log can use: record ID, variable, original value, issue, action, reason, supporting record and date. Keep the raw file unchanged.

Keep the cleaning log connected to a wider project data management plan. Record which original, working file and codebook version produced the submitted output, as well as the agreed access and handover responsibilities.

Analyse only after the checks

Summarise valid and missing counts for each relevant variable. Report the denominator used in a percentage. If the number of usable cases changes across analyses, explain why. Keep recoding and exclusions consistent with the method you report.

Connect that analysis file to the case-outcome and denominator worksheet. It helps explain the difference between a questionnaire returned, a case retained and an answer available for one particular table.

The statistical-test guide helps match a method to the question; the Chapter 4 guide helps present the resulting evidence. UniDraft can organise findings you confirm into the written project, but it cannot make invented or altered responses legitimate. Prepare your document from your actual work.

Frequently asked questions

What is questionnaire coding?

It gives each variable and response category a documented representation for analysis. A codebook should explain names, labels, valid values, missing responses and any derived variables.

Should missing answers be entered as zero?

Only if zero genuinely represents the measured answer. A missing response is different from zero, disagreement or not applicable. Document how your software treats missing values.

Can I delete responses that do not support my hypothesis?

No. Apply justified, documented eligibility and quality rules consistently. Do not exclude cases to obtain a preferred result or fabricate replacements for missing responses.