A master’s student uses a national household survey to estimate preschool enrolment by region. His figures differ by several percentage points from the official report based on the same dataset. The cause: he ignored the sampling weights, even though the survey deliberately oversampled sparsely populated regions to get enough observations there. On top of that, the code 98 (“don’t know”) had been treated as a real number.
Secondary data are data collected by someone else for another purpose. They let students and early-career researchers work with sample sizes and coverage they could never collect themselves. The price is that you must understand how the data were produced before you touch them.
When secondary data are a good choice
- Your question needs a large representative sample or many years of follow-up.
- New data collection would be too costly or too burdensome for a vulnerable group.
- You want cross-country comparisons with a harmonised instrument.
The limitation: you do not get to choose the questions. If your central concept has no suitable measure, do not force a roughly similar variable into its place. Browse the variable list first, then finalise your research question, not the other way round.
Finding sources and access conditions
Common sources include national statistics office archives, international programmes such as the Demographic and Health Surveys (DHS), social science archives such as ICPSR or the UK Data Service, open data portals of international organisations, and repositories holding data behind published papers (Dryad, Zenodo, OSF).
Access comes in three tiers: open download; registration with a statement of purpose; and a signed data use agreement with conditions on storage and publication. The third tier can take weeks, so apply as soon as your topic is settled. Read the agreement closely: many prohibit redistributing the original files or attempting re-identification, and some ask for a copy of any publication.
Read the codebook before opening the data
The codebook and the methodology report are required reading. Look for:
- Unit of observation: is each row a person, a household or a facility? Many datasets split levels into separate files linked by identifiers.
- Original question wording for each variable, plus interviewer instructions.
- Skip patterns: who was asked this question? “Hours of overtime” may only be asked of employed respondents, so blanks for unemployed people are not missing data.
- Special codes: 97, 98, 99, −9 or 9999 often mean refused, don’t know or not applicable.
- Sample design: stratification, clustering, the name of the weight variable and which analyses it is meant for.
Missing-value codes: the costliest silent error
Software does not know that 98 means “don’t know”. If an age variable contains a few 98s coded as “unknown”, the mean age rises and nothing warns you. Before any analysis, run frequency tables for every variable you use and look for odd values at both ends. Then recode them to missing explicitly in your analysis script, never by editing the file by hand.
Weights and complex survey design
Large surveys are rarely simple random samples. They stratify by region, sample clusters of addresses and oversample small groups. The consequences:
| If you ignore | What goes wrong | What to do |
|---|---|---|
| Sampling weights | Proportions and means are biased towards oversampled groups | Apply the weight variable the codebook specifies |
| Strata and clusters | Standard errors too small, p values artificially low | Declare the design: the survey package in R, svy commands in Stata, Complex Samples in SPSS |
| Subgroup analysis | Dropping cases before declaring the design distorts variance | Use the survey package’s subset functions instead of deleting rows |
Some surveys supply several weights: household, individual, and one for a module asked of only part of the sample. Using the wrong weight is as bad as using none.
Combining survey waves
To study trends over time you will meet reworded questions, scales that change from five to four points, shifting administrative boundaries and occupation codes updated to new classifications. Build a harmonisation table: one row per variable, one column per wave, recording the original variable name, question text, value codes and how you recoded them. Put it in an appendix.
Distinguish repeated cross-sections (a fresh sample each wave) from panel data (the same people followed). Only panel data let you talk about change at the individual level.
A reproducible workflow
- Keep the original files untouched in a read-only folder.
- Do every cleaning, recoding and merging step in a script (R, Stata, Python or SPSS syntax), never by pointing and clicking.
- Record the dataset name, version and download date at the top of the script.
- Check your output against a figure in the official report. If you can reproduce that number, your weights and design are right.
Step 4 is the cheapest and most reliable test you have. If your figure does not match, stop and find out why before running any model.
Citing data and writing the methods section
Datasets should be cited like publications, usually with a DOI or the citation format the provider specifies. Your methods section should state the source and version, the original sample design, the analytic sample after exclusions and why, how missing data were handled, the weight used and how standard errors were estimated. If the agreement forbids sharing the files, share your analysis code so that others with access can reproduce your work.
This week: download the codebook for the dataset you plan to use, find your five core variables, and read the original wording and skip pattern for each. If one does not measure your concept, now is the time to adjust the research question, not after the models have run.
Câu hỏi thường gặp
What is secondary data analysis?
It is the analysis of data that someone else collected for their own purposes, reused to answer a new research question. Typical examples are national surveys, administrative records and open datasets published with papers.
Is a dissertation using secondary data less valuable?
Not necessarily. The value lies in the question and the quality of the analysis. You do need to show that you understand how the data were collected and that you handled the sample design correctly.
What happens if I don’t use survey weights?
Estimates such as proportions and means can be biased towards groups that were oversampled, and standard errors can be wrong. Use the weight variable and design information the codebook specifies.
What does a codebook contain?
Typically variable names and labels, original question wording, value codes and their meanings, missing-value codes, skip conditions and information on the sample design. Read it before you open the data file.
Do I need ethics approval for secondary data analysis?
It depends on your institution and the data. Publicly available anonymised data are often exempt or get a light review, but data with sensitive or potentially identifiable information usually need approval. Check with your ethics committee.