Skip to main content

Family links: parents, siblings and parents’ characteristics

Linking a child to its parents with BEF (the population register) and FTBARN (the child file of DST’s fertility database)

How to link a person to mother and father with mor_id and far_id in BEF, what the link means, which birth cohorts it covers, how to find siblings, and how to mark adoption with FTBARN.
Last modified

December 4, 2026

Use this page if your study needs to link a child to its parents, and from there to siblings or to a parent’s characteristics. It is the first step of a sibling design, and also of any study that needs the mother’s or father’s education, income or diagnoses.

Before this page: cohort and cohort_pnrs, your cohort and its pnr values (Comparison cohort).

Coverage by birth cohort

BEF takes mor_id and far_id from CPR. The shares below are for persons born in Denmark, from CPR as it stood in November 2005 (Pedersen et al. 2006). They are the nearest guide to what your delivery holds, but count the missing links in your own data.

Born in Denmark Link to a mother Link to a father
1950 8.0% 7.6%
1960 98.7% 95.7%
1970 99.9% 99.2%

The same paper says the links for persons born in Denmark in 1969 or later are “considered to be 100% correct”, and those for 1960-1968 “almost correct”, because the links for 1969-1978 were checked against the parish registers (Pedersen et al. 2006).

CPR started in 1968, and the parental links were first built from families living at the same address. Until 1978 a link was erased when the child moved away from home, when a parent moved, when the child had children or when the child turned 18. From 1978 links are kept permanently, and from then on they follow the legal relationship (Pedersen et al. 2006).

You may also read that everyone born in Denmark in 1960 or later has a complete link to both parents (Pedersen 2013). That is about the Family Relations Database, managed by the Danish Health Data Authority with the National Centre for Register-based Research (NCRR) as data processor, which keeps only the links it deems valid. It is not a description of mor_id and far_id in BEF.

For people born abroad the links are much rarer, because parent and child are not linked at immigration, and a parent needs a Danish CPR number to be linked at all (Pedersen et al. 2006; DST, Relatives, accuracy and reliability). In Pedersen et al., 29.8% of those born abroad in 1980 and 94.2% of those born in 1990 have a mother link. Expect a missing mor_id and far_id for most immigrants, and report the share.

For newborns, the second parent can be missing for up to half a year after the birth, because it takes that long to register. DST names this as most common for births in the second half of a year and for unmarried parents, and advises against studying the relatives of newborns in the latest reference year (DST, Relatives, accuracy and reliability).

Persons born before 1967 have too few registered parents and siblings, and for those born before 1935 the undercount may be very large (DST, Relatives, accuracy and reliability).

Step 1 - Take the link from BEF

BEF is a snapshot register (see DST pitfalls, 5), so the same child has one row per snapshot, and mor_id and far_id can differ between snapshots or be missing in some of them. A parent can be added to the child after the first snapshots, for example. There is no single correct value, so you have to pick a rule and write it in your methods.

The rule below takes, for each child, the first non-missing value from the snapshots at or after the child’s birth. For a child born before the first BEF snapshot (December 1985) that is the link as it stood in 1985 or later. The rule also decides which parents an adopted child gets: a child adopted before its first snapshot gets the adoptive parents, and a child adopted later gets the parents from before the adoption. Step 2 shows how to find adopted children. To see how often the link changes in your data, count the children whose mor_id takes more than one value across snapshots.

The rule is written as a function, because Step 3 runs it again for the siblings outside your cohort.

# Step 1: one mother and one father per child, from BEF ------------------------
library(fastreg) # read_register()
library(dplyr)   # the verbs are translated to SQL and run in DuckDB

# pnrs: the children you want parents for. Returns one row per child with at
# least one registered parent: pnr | foed_dag | mor_id | far_id
parents_from_bef <- function(pnrs) {
  bef <- read_register("bef") %>%
    rename_with(tolower) %>%
    semi_join(tibble(pnr = pnrs), by = "pnr", copy = TRUE) %>%
    # a missing id is an empty string, not NA, in parquet converted from SAS
    mutate(mor_id = na_if(mor_id, ""), far_id = na_if(far_id, ""))
  # Columns: pnr | foed_dag | mor_id | far_id | referencetid

  # The first non-missing mother id in a snapshot at or after birth
  mother <- bef %>%
    filter(referencetid >= foed_dag, !is.na(mor_id)) %>%
    group_by(pnr) %>%
    slice_min(referencetid, n = 1, with_ties = FALSE) %>%
    ungroup() %>%
    select(pnr, mor_id)

  father <- bef %>%
    filter(referencetid >= foed_dag, !is.na(far_id)) %>%
    group_by(pnr) %>%
    slice_min(referencetid, n = 1, with_ties = FALSE) %>%
    ungroup() %>%
    select(pnr, far_id)

  # BEF can correct a birth date between snapshots, so the birth date comes
  # from the child's latest snapshot, not from the snapshot the parent came from
  birth_date <- bef %>%
    group_by(pnr) %>%
    slice_max(referencetid, n = 1, with_ties = FALSE) %>%
    ungroup() %>%
    select(pnr, foed_dag)

  # full_join on pnr: a child with only one registered parent keeps its row,
  # with NA for the other
  mother %>%
    full_join(father, by = "pnr") %>%
    left_join(birth_date, by = "pnr") %>%
    select(pnr, foed_dag, mor_id, far_id) %>%
    collect()
}

# cohort_pnrs: the pnr of the people in your cohort
parents <- parents_from_bef(cohort_pnrs)

A child with no link in BEF to either parent is not in parents at all, so join parents back onto your cohort and count the children without one:

library(dplyr) # left_join, count

# cohort: one row per child in your cohort, with pnr and birth_year
cohort_parents <- cohort %>%
  left_join(parents, by = "pnr") # children with no parent in BEF get NA for both

count(cohort_parents, birth_year, no_parent = is.na(mor_id) & is.na(far_id))

Report how many children each analysis loses on that account. Without the na_if() line in the function, a missing id stays an empty string, and every child without a registered father would share the father id "".

The rule in the function, the first snapshot with an id, is one choice. The most frequent value or the latest snapshot is equally valid if you state it. What matters is that the rule is the same for every child.

Some deliveries have no referencetid. Order the snapshots by the year column the parquet conversion adds instead: drop referencetid >= foed_dag from the two filters, and write slice_min(year, n = 1, with_ties = FALSE). A child is in BEF only from birth, so this takes the first year with an id. If your delivery has several snapshots a year, keep one per year first, as under “Check your BEF” in Socioeconomic variables.

The mother at birth: the Medical Birth Register

BEF holds the legal parents at each snapshot. The Medical Birth Register (MFR) holds, for each birth in Denmark, the (assumed) biological parents (Bliddal et al. 2018). Sundhedsdatastyrelsen takes the link between mother and child from CPR (“udtræk fra CPR som giver den fornødne kobling mellem mor og barn”, register declaration, section 0.7), and Bliddal et al. describe the identification of the mother for linkage as “virtually complete and … of very high validity”.

MFR is the better source of the mother when:

  • the child may have been adopted, because BEF’s later snapshots then hold the adoptive parents;
  • the child was stillborn or died soon after birth. The register has every birth, live or stillborn (register declaration, section 1.1), and a child who died before the next BEF snapshot is in no snapshot at all. At DST, though, the 1997-2018 births are split in two: mfr is titled live births and the stillbirths are in mfrdfoed. A stillborn child has had a CPR number only since 2002 (Bliddal et al. 2018), so before that there is no child id to join on;
  • you need twins and other multiple births, which MFR records (barnsnummer_flerfoldsfoedsel).

DST has no MFR table for births from 1973 to 1996. For those years FTBARN’s mor1, the first mother registered in CPR, is the nearest equivalent (see Adoption).

Two limits:

  • Births in Denmark only, and until 2018 only to mothers with a Danish CPR number. From 2019 a birth counts even if the mother has no Danish CPR number, but only if the birth was reported to the Danish Health Data Authority (Sundhedsdatastyrelsen, SDS) (SDS, documentation from 2019, sheet “Register”). Check ErCPRnummerGyldigt_Mor before you join on the mother’s number.
  • The declaration says where the mother’s link comes from, not the father’s. Compare cpr_fader with far_id in BEF before you rely on it.
Births Table Child Mother Father
1997-2018 mfr cpr_barn cpr_moder cpr_fader
2019 and later mfr_nyfoedte CPRnummer_Barn CPRnummer_Mor CPRnummer_Far
# The parents at birth from MFR (births 1997-2018), beside BEF's -------------
mfr_parents <- read_register("mfr") %>%
  rename_with(tolower) %>%
  select(pnr = cpr_barn, mor_mfr = cpr_moder, far_mfr = cpr_fader) %>%
  semi_join(tibble(pnr = cohort_pnrs), by = "pnr", copy = TRUE) %>%
  collect() %>%
  # a missing id can be "" in parquet converted from SAS: make it NA, or every
  # blank would count as the same mother
  mutate(mor_mfr = na_if(mor_mfr, ""), far_mfr = na_if(far_mfr, ""))

# How often is BEF's mother not the mother at birth?
parents %>%
  inner_join(mfr_parents, by = "pnr") %>%
  count(same_mother = mor_id == mor_mfr)

Step 2 - Check for adoption with FTBARN

Do this before you build siblings. BEF holds the legal parents, so once BEF holds the adoptive parents, an adopted child shares mor_id and far_id with its adoptive parents’ other children, and Step 3 would make them siblings. BEF cannot tell you whether the relation is adoptive. FTBARN, the child file of the fertility database, can. It has one row per child from 1973 and, besides the parents (mor1, far1), two columns that mark the relation: mor_foed_adop for the mother and far_foed_adop for the father.

DST describes them as marking whether information in the background registers (the Adoption Register, CPR and the Medical Birth Register) points to an adoptive or other non-biological relation. Codes 11 to 18 are a presumed non-biological relation, codes 21 to 23 a presumed biological one, and 30 to 39 cover children born abroad, children born before 1973 and relations with no sign of adoption or early registration. For the father the year in that last group is 1991, not 1973: DST’s grouping for far_foed_adop puts children born before 1991 in 30 to 39 (DST, FAR_FOED_ADOP). Code 33’s own label still says “born before 1973”, so check how your delivery codes fathers of children born before 1991, with count(ftbarn, foedaar < 1991, far_foed_adop). If it follows the grouping text, codes 21 to 23 mark a presumed biological father only for children born from 1991. In the code below the father of an earlier child is then “unknown” even when nothing suggests an adoption, so excluding children with an “unknown” father would drop most children born before 1991. The full list is in the value sets under FTBARN.

Four points from DST’s own documentation:

  • It is presumed, not known. DST: “A biological relation can only be determined with a DNA test, which is not available in the background registers” (our translation). A child conceived with donor sperm or donor egg looks like a biological relation in the registers.
  • Do not count adoptions with it. DST: “It makes no sense to count the number of adopted or biological relations from the variable” (our translation). Use it to select or exclude, not to estimate how many.
  • Code 14 is not an adoption. It marks a parent of the other sex than the column, so a co-mother is registered in the father’s column with code 14.
  • Code 12 can concern the other parent. The child is in the Adoption Register, but the adoptive relation may be to the other parent.

In FTBARN, mor1 is the first mother valid in CPR, and mor2 the latest one when it differs. The relation of mor1 to the child is in mor_foed_adop.

WarningNo adoption markers for 2019-2023, and wrong ones in older deliveries

DST changed the adoption columns in a correction of 30 October 2025. Version 2 of the fertility tables for reference years up to 2023 sets mor_foed_adop and far_foed_adop to unknown (99) for 2019 to 2023, because data are missing to form new adoption markers for those years. Version 1 held other values by mistake. For children born in 2019 to 2023 adoption therefore cannot be identified in FTBARN, and a delivery made before the correction has wrong values for those years (DST, FTBARN register history). Check the version column in your delivery.

The code below sorts each parent into DST’s groups. Codes 31 to 39, 99 and a missing value all become “unknown”: a child in those groups is not non-biological, it is a child the registers cannot say anything about.

# Step 2: adoption markers for the cohort (FTBARN) ------------------------------
ftbarn <- read_register("ftbarn") %>%
  rename_with(tolower) %>%
  semi_join(tibble(pnr = cohort_pnrs), by = "pnr", copy = TRUE) %>%
  select(pnr, mor1, far1, mor_foed_adop, far_foed_adop) %>%
  collect()

# DST's groups for the codes in mor_foed_adop and far_foed_adop
foed_adop_group <- function(code) {
  code <- as.integer(code)
  case_when(
    code %in% 21:23 ~ "presumed biological",
    code %in% 11:18 ~ "presumed non-biological",
    code == 0       ~ "no parent",
    .default        = "unknown"   # 31-39, 99 (2019-2023) and missing;
                                  # for fathers, probably most children born before 1991
  )
}

ftbarn <- ftbarn %>%
  mutate(
    mother_relation = foed_adop_group(mor_foed_adop),
    father_relation = foed_adop_group(far_foed_adop)
  )

State in your methods that the group is presumed biological, and how many children were “unknown”. If your cohort has children born before 1991, their fathers are “unknown” because of DST’s rule, not because of an adoption, so say how you treat them.

Step 3 - Siblings

Siblings are children with the same parent id, and the type depends on how many parents they share:

  • Full siblings share both mother and father.
  • Maternal half-siblings share the mother only, and paternal half-siblings share the father only.

Do not count a pair as full siblings when one of the fathers is missing. The pair shares a mother, so it is at least a maternal half-sibling pair, and the father is unknown. The code below gives those pairs their own type (“maternal, father unknown”). Say in your methods how you handle them, and run the analysis both ways if there are many of them.

The siblings you need are not only the ones in your cohort. If the exposed child has a brother who is not in the cohort, he is still a sibling. So first find everyone in BEF who has the same mother or father as someone in your cohort, and run the rule from Step 1 for them too.

If your design needs biological siblings, use the groups from Step 2 to decide which children to keep, for example only children whose mother and father are both “presumed biological”, and say so in your methods.

# Step 3: sibling pairs and their type ----------------------------------------

# 3a: everyone who has the same mother or father as someone in the cohort
parent_ids <- tibble(id = unique(c(na.omit(parents$mor_id), na.omit(parents$far_id))))
bef_all    <- read_register("bef") %>% rename_with(tolower)
family_pnrs <- union(
  bef_all %>% semi_join(parent_ids, by = c("mor_id" = "id"), copy = TRUE) %>% distinct(pnr),
  bef_all %>% semi_join(parent_ids, by = c("far_id" = "id"), copy = TRUE) %>% distinct(pnr)
) %>%
  collect() %>%
  pull(pnr)

# 3b: the same rule as in Step 1, for the cohort and their siblings
family <- parents_from_bef(union(cohort_pnrs, family_pnrs))

# 3c: pairs of children with the same id in `key` (mor_id or far_id)
pairs_by <- function(key) {
  a <- family %>% rename_with(~ paste0(.x, "_a"))
  b <- family %>% rename_with(~ paste0(.x, "_b"))
  by <- setNames(paste0(key, "_b"), paste0(key, "_a"))
  a %>%
    filter(!is.na(.data[[paste0(key, "_a")]])) %>%
    # keep = TRUE: both id columns stay. many-to-many: a mother with three
    # children matches each child three times, which is what we want here.
    inner_join(b, by = by, keep = TRUE, relationship = "many-to-many") %>%
    filter(pnr_a < pnr_b)
}

# 3d: the type of each pair. A pair found through both parents appears twice,
# with the same type, and distinct() keeps one.
sibling_pairs <- bind_rows(pairs_by("mor_id"), pairs_by("far_id")) %>%
  mutate(
    same_mother = coalesce(mor_id_a == mor_id_b, FALSE),
    same_father = coalesce(far_id_a == far_id_b, FALSE),
    father_unknown = is.na(far_id_a) | is.na(far_id_b),
    mother_unknown = is.na(mor_id_a) | is.na(mor_id_b),
    type = case_when(
      same_mother & same_father    ~ "full",
      same_mother & father_unknown ~ "maternal, father unknown",
      same_father & mother_unknown ~ "paternal, mother unknown",
      same_mother                  ~ "maternal half",
      same_father                  ~ "paternal half"
    )
  ) %>%
  distinct(pnr_a, pnr_b, type)

The famnet package by Luke Johnston finds sibling pairs with fmn_siblings(), labelling each pair “sibling” without the split into full and half siblings above. It is on GitHub only, so it may not install on your project. See Algorithms and packages.

For a sibling analysis you also need a family id for the strata. For full siblings the mother and father ids together identify the family. With half-siblings in the data, a person can belong to more than one family, so decide how the strata are formed and state it.

Step 4 - A parent’s characteristic at the child’s birth

Use mor_id or far_id as the pnr of the parent, and look the parent up in the register that holds the characteristic, in the year that matters. That could be the mother’s education, income or employment at the child’s birth, or her diagnoses before it. The year rule is the one for any other person, so it is not repeated here. See When each dimension is measured for education, employment and income.

Before you do this, check that the parent ids match the person ids in the registers you look them up in. Most non-missing mor_id values should appear as a pnr in BEF. If they do not, the ids are not comparable in your project and the lookup will return nothing.

A parent who was not living in Denmark in the year, or who died before it, will have no row. That is a missing value in your analysis, so handle it as one (see Missing data).

What to write in your methods

  • The source of the link (BEF mor_id and far_id, MFR for the parents at birth, FTBARN if you use it) and the rule for choosing between snapshots.
  • That the link is the legal, administrative relation in CPR.
  • The birth cohorts you include and the share with a missing parent link, by birth year, and how immigrants were handled.
  • How half-siblings and pairs with a missing parent were handled.
  • If you use the adoption markers, which codes you used and that the relation is presumed.

Further information

See also

Back to top