Behind every meaningful health statistic, like infant mortality rates or contraceptive prevalence figures, lies a tedious but crucial process of preparing raw survey data for analysis. When researchers collect information from thousands of households about nutrition, maternal care, or family planning, the responses arrive in messy, inconsistent forms. Transforming these scribbled questionnaires and recorded interviews into clean, analyzable datasets requires three interconnected steps: coding, editing, and feeding. Skip any of these, and even the most rigorous study can produce misleading conclusions that affect health policies and millions of lives.
Table of Contents
- What is data coding?
- Pre-coding versus post-coding
- Building a codebook
- Coding qualitative data
- Editing and cleaning data
- Types of editing
- What editors look for
- Data cleaning in the digital age
- Data feeding techniques
- Manual data entry
- Computerized and electronic data capture
- Using Excel for data feeding
- Using SPSS for accurate data entry
- Principles of effective data preparation
- Why this matters for health outcomes
What is data coding?
Data coding is the systematic process of converting raw responses, whether numerical, textual, or categorical, into standardized symbols or numbers that statistical software can read and analyze. Coding essentially reduces a large mass of heterogeneous responses into meaningful categories, making tabulation and analysis manageable.
Consider a question from a family health survey asking, “What method of contraception do you currently use?” Respondents may answer “pills,” “IUD,” “condoms,” “sterilization,” or “none.” During coding, each response is assigned a numerical value: 1 for pills, 2 for IUD, 3 for condoms, 4 for sterilization, 5 for none, and perhaps 99 for missing data. The software no longer sees words; it sees numbers it can count, compare, and cross-tabulate.
Pre-coding versus post-coding
Coding can happen at two stages. Pre-coding is built into the questionnaire itself, where closed-ended questions already have numerical codes printed next to each answer option. This works well for structured surveys like the National Family Health Survey (NFHS), which uses standardized questionnaires translated into multiple Indian languages.
Post-coding is necessary for open-ended responses where participants answer in their own words. If someone is asked, “Why did you stop breastfeeding before six months?”, responses might range from “milk dried up” to “had to return to work” to “doctor advised formula.” Researchers then group similar responses into thematic categories and assign codes after data collection.
Building a codebook
A codebook is the master document that lists every variable in the dataset, its possible values, what each code means, and how missing data is treated. For a question on educational attainment, the codebook might specify: 0 = no education, 1 = primary, 2 = secondary, 3 = higher secondary, 4 = graduate and above, 9 = don’t know, 99 = missing. Without a codebook, the dataset becomes meaningless to anyone except the person who created it.
Coding qualitative data
Qualitative information from interviews or focus group discussions requires a different approach. Researchers often use techniques developed in grounded theory, where open coding breaks data into its smallest meaningful components, followed by axial coding to identify relationships, and selective coding to develop core themes. This is common in studies exploring sensitive topics like adolescent reproductive health or barriers to immunization.
Editing and cleaning data
Editing is the process of examining collected data to detect errors, omissions, and inconsistencies before analysis begins. A questionnaire filled out by an interviewer in a remote village may have skipped questions, illegible handwriting, or contradictory answers. For instance, a respondent might be recorded as a 25-year-old with seven children all aged above 10 years, an impossibility that signals either a recording error or a misunderstanding during the interview.
Types of editing
Field editing happens immediately after the interview, often the same day. Field supervisors review questionnaires for completeness, legibility, and obvious errors while the interviewer can still recall the conversation or revisit the respondent. The NFHS protocol, for example, requires field editors to examine every completed questionnaire in the field before sending them to research organization headquarters for re-editing by trained office editors.
Office editing or central editing is more systematic. Once all questionnaires reach the central office, a team of editors works under uniform rules to check for consistency across the entire dataset. They look for patterns that suggest fabrication, identify outliers, and decide how to handle missing values.
What editors look for
Good editors check for several common issues. Completeness ensures every applicable question has an answer. Accuracy involves cross-checking related responses, such as age at marriage being lower than current age. Consistency flags contradictions, like a respondent reporting no children but listing details for three. Uniformity ensures measurement units are standardized; one interviewer may record weight in kilograms while another uses pounds.
Data cleaning in the digital age
Once data is entered into a computer, cleaning becomes more sophisticated. Researchers run range checks to identify impossible values (a person aged 250), logic checks to catch contradictions, and consistency checks across linked variables. Studies using web-based surveys now employ systematic data cleaning that reviews survey completion speed, identifies consecutive identical responses, flags contradictory answers, and assesses the quality of open-ended responses. These checks help remove fraudulent or careless submissions that would otherwise distort results.
Missing data deserves special attention. Should you delete the entire case, impute the missing value using statistical methods, or treat it as a separate category? The answer depends on how much data is missing and whether the gaps appear random or systematic. If younger women consistently skip questions about contraception while older women answer them, the missing pattern itself reveals something important.
Data feeding techniques
Data feeding, or data entry, is the process of transferring information from paper questionnaires or other sources into a digital format ready for analysis. This step is deceptively simple. A single typo, like entering 55 instead of 5 for a child’s age, can skew an entire analysis if not caught later.
Manual data entry
Manual entry involves a human operator typing each response into a spreadsheet or database. While slower and prone to fatigue-related errors, manual entry remains common in research settings with limited resources or paper-based surveys. To minimize errors, researchers use double entry, where two operators independently enter the same data, and the software flags discrepancies. Studies show double entry can reduce error rates dramatically compared to single entry.
Best practices for manual entry include using structured entry forms that mirror the questionnaire layout, building in validation rules that reject impossible values, and entering data in batches with regular verification rather than processing thousands of records at once.
Computerized and electronic data capture
Increasingly, surveys use computer-assisted personal interviewing (CAPI), where interviewers record responses directly on tablets or laptops. The NFHS has transitioned from paper questionnaires to tablet-based electronic data capture, enabling real-time quality control with automated consistency checks during interviews. This eliminates the separate data entry step and catches errors at the source.
Earlier rounds of large surveys often used specialized software like CSPro for NFHS-3 data entry, with verification and secondary editing performed at research organizations before final cleaning at the International Institute for Population Sciences.
Using Excel for data feeding
Microsoft Excel is often the first tool students and small research teams use because it is widely available and intuitive. Each row represents a case (one respondent), and each column represents a variable (one question). Excel allows basic validation through data validation rules, conditional formatting to highlight outliers, and filters to spot patterns.
However, Excel has limitations. It struggles with very large datasets, lacks dedicated tools for handling missing values, and offers limited statistical capabilities. For serious analysis, data entered in Excel is typically exported to specialized software.
Using SPSS for accurate data entry
The Statistical Package for the Social Sciences (SPSS) is widely used in population and family health research. SPSS organizes data through two views: Data View, where actual values are entered row by row for each case, and Variable View, where the properties of each variable are defined.
In Variable View, researchers define each variable’s name (no spaces or special characters), type (numeric, string, date), label (a longer description of what the variable measures), values (the codes and their meanings, like 1 = male, 2 = female), missing values, and measure (nominal, ordinal, or scale). Correctly specifying the measurement level matters because it determines which statistical tests SPSS will allow.
For multiple-response questions common in health surveys, such as “Which chronic illnesses do you have? (Tick all that apply),” each option becomes a separate binary variable coded 1 if ticked and 0 if unticked. SPSS handles these through its multiple response sets feature, enabling researchers to analyze patterns of co-occurring conditions like hypertension and diabetes.
Principles of effective data preparation
Regardless of the tools used, certain principles apply across all data preparation work. Standardization means using consistent protocols, codes, and entry conventions throughout the project. Documentation involves maintaining detailed codebooks and recording every decision made during editing. Audit trails track all changes so that the original data can always be reconstructed. Regular backups protect against accidental loss at every stage.
Training matters enormously. Even the best software cannot compensate for poorly trained data entry operators. Large surveys like the NFHS invest weeks in training field investigators and health workers, requiring them to pass written examinations before joining the main fieldwork.
Why this matters for health outcomes
The stakes of data preparation in population and family health studies extend far beyond academic accuracy. NFHS data informs decisions about resource allocation for maternal health programs, immunization drives, and nutrition interventions. The high quality of NFHS data has given policymakers and programme planners confidence in using it as a key source, often the only source, of relevant data for state and district-level planning. A coding error that misclassifies stunted children as healthy, or a data entry mistake that inflates contraceptive use figures, can ripple through policy decisions affecting millions.
This is why population health researchers treat data preparation not as a chore to rush through but as a craft that demands the same rigor as study design or statistical modeling. The numbers that eventually appear in journal articles and policy briefs are only as trustworthy as the coding, editing, and feeding that brought them into being.
What do you think? If you were designing a household health survey in a rural district with limited internet access, would you choose paper-based questionnaires with manual data entry or invest in tablets with electronic data capture, and what trade-offs would shape your decision? How might errors introduced during data coding or feeding distort the conclusions of studies that go on to influence national health policy?
References
- https://ebooks.inflibnet.ac.in/hsp16/chapter/processing-operation-editing-coding-classification/
- https://www.nfhsiips.in/nfhsuser/assets/pdf/NFHS%20data%20quality%20assurance.pdf
- https://sociology.institute/research-methodologies-methods/key-steps-data-presentation-editing-coding-transcribing/
- https://microdata.worldbank.org/index.php/catalog/1406
- https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9264135/
- https://libguides.library.kent.edu/SPSS/CreateData
- https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9550650/

Leave a Reply