Export and repatriation
GDPR, output control and what may leave DST
You have built your dataset and run your analysis (Phases 1-14). What remains is the final step: getting your results safely out of DST.
Data from Statistics Denmark is microdata subject to GDPR. You cannot copy raw data out - everything must go through DST’s repatriation process, and the precise rules live in DST’s own guide.
This page is only an overview. DST’s own guide takes precedence - read and re-read it. DST - Rules for repatriation of analysis results →
What may leave DST?
Yes:
- Aggregated tables
- Graphs and figures
- Model output - coefficients, confidence intervals, p-values
No:
- Individual-level data in any form
- Small cells - see the threshold below
- Results that could identify individuals - directly or indirectly
- Screenshots or photographs of the screen. The ban on taking data out covers every route, including images of the research machine →
Scripts are also repatriated via the process - not freely. Code/scripts can be repatriated, but go through the same process as result files.
Which cell size applies to you
DST’s baseline is at least 3 observations per cell. Some registers are stricter and require at least 5, and which rule applies to your project is shown in the DDV App when the data is ordered. Check it there rather than assuming.
This page uses 5 throughout, because it is the safe side of both rules and because health register data is usually in the stricter group. If your project is on the baseline of 3, nothing here breaks: you are simply reporting more conservatively than required.
A hidden number must not be possible to work out
Hiding the small cells is not enough on its own. DST’s rules also say that a hidden number must not be possible to work out again from the rest of what you take home:
“Observationer, som er blevet aggregeret eller på anden vis sløret eller fjernet i en tabel, graf eller figur, må ikke kunne udledes ved tilbageregning eller krydslæsning. Hvis dette er muligt, skal der aggregeres yderligere.”
In English: observations that have been aggregated, blurred or removed in a table, graph or figure must not be possible to derive by back calculation or by reading tables against each other. If they can be, aggregate further. In plain words: no subtracting your way back to a hidden number, within one table or across tables.
The usual way it happens is a total. Take two rows of a Table 1 with an overall column:
| Age | Overall | Exposed (N = 282) | Unexposed (N = 1,218) |
|---|---|---|---|
| 70-89 | 165 | 35 | 130 |
| 90+ | 18 | 1 | 17 |
Only 1 exposed person is aged 90+, so you hide that number. But the row still shows 18 overall and 17 unexposed, and 18 - 17 = 1. So you must hide a second number in the same row, the 17. Now the column gives the 1 back instead: the exposed column shows N = 282 and every other age group, so the missing 1 is what is left over. So a number in the same column must go too, and then one more to close the square:
| Age | Overall | Exposed (N = 282) | Unexposed (N = 1,218) |
|---|---|---|---|
| 70-89 | 165 | .. | .. |
| 90+ | 18 | .. | .. |
A reader can still see that the four hidden numbers add up to 165 and 18 across, and to what is left of each column. But that fits every split from 0 to 18 exposed people aged 90+, so the 1 cannot be found.
The numbers you hide to protect a small one must not be small themselves. If you hid a 1 and a 3 in the same column, a reader could still see from N that they add up to 4, and 4 people is a small cell in its own right. Hide numbers so that the hidden ones in each row and each column add up to at least 5. Here they do: 165 and 18 across, 36 and 147 down.
Usually the better answer is the one DST’s rule itself points to: merge categories (“aggregeres yderligere”). Here a single 70+ group would leave nothing to hide.
Where to look for numbers that give a hidden one back:
- Totals, overall columns and N in the header. Each of them makes a sum that one hidden number can be subtracted from. A row or column with a total needs either no hidden number or at least two, and the hidden ones together must come to at least 5. As the example shows, the second one often pulls in more.
- Percentages. A percentage is a number of people in disguise: 0.4% of 282 is 1 person. If you hide a count, hide its percentage too.
- The same people in two tables. If Table 1 shows 18 people aged 90+ and Table 2 shows the 17 unexposed among them, the two tables together give the 1 back. Check every table you take home together, and the ones you took home earlier.
- Subgroups and sensitivity analyses. If the main analysis has 120 people and a sensitivity analysis on almost the same people has 118, a reader knows that 2 people are in one and not in the other. When the difference is below 5, do not give both sizes exactly. One way is to round them, for example to the nearest 10; another is to give only the main analysis’ size. The same goes for the exclusion boxes in a flowchart (Phase 10 - Build your study population).
- The mark you use for a hidden number. When you hide some numbers and show the rest exactly, a mix of marks gives the small one away: if it says
<5and the numbers hidden to protect it say.., a reader knows which one is 1 to 4, and next to a total that narrows it down, sometimes to a single value. Give every hidden number in a table the same neutral mark, such as..(a hidden 17 is not<5anyway). Saying in the methods that counts below 5 are hidden is fine, since DST’s threshold is public.
NB: min, max, percentiles and median can point to one person
min, max, percentiles and median reproduce concrete values from the dataset - a minimum or maximum value is one person’s actual figure. Only report them if at least 5 people have that value; otherwise the figure can point to a single individual.
If you are unsure about a descriptive table with min, max, percentiles or median, check the threshold in DST’s guide or with your data manager before repatriating it.
NB: missing values (NA) count too
A missing value is also a cell. If a category has fewer than 5 missing, that figure may not be repatriated either. Solutions: impute, merge categories, drop the category - or another solution agreed with your data manager.
Make a quick overview of missing values, so you see the small cells immediately instead of adding figures up in your head:
colSums(is.na(df)) # number of NAs per column - spot any 1–4 at a glance
table(df$income_cat, useNA = "always") # one column at a time; shows NA as its own category (otherwise hidden)table() hides NA by default - useNA = "always" forces the NA row out. See Phase 7 - table() hides NA.
How it works
The repatriation itself happens via “Hjemtag Filer” in the DDV app. The system automatically scans for potential microdata and flags risks. If a file is flagged, you add a comment that precisely describes what the file contains and why it is aggregated. Use descriptive filenames (table1_descriptive_n500.csv) - not generic names like output.csv.
The full step-by-step process and the rules in force are in DST’s guide - follow it.
Checklist before uploading
You have completed the full process
When your results have been repatriated, you have gone all the way - from research question and cohort to analysis-ready dataset and publication-ready results.
- Need to look up a function, a register or a pitfall? → Functions: overview · Overview of registers · DST pitfalls
- Working on DARTER / project 708421? → DARTER - overview and pipeline
Further depth in The Epidemiologist R Handbook: