Derivation
variable: sepdate (table[s]: all_spouse_pairs_full [derived table])
variable: rmardate (table[s]: all_spouse_pairs_full [derived table])
variable: rsepdate (table[s]: all_spouse_pairs_full [derived table])
variable: w_firstdead (table[s]: all_spouse_pairs_full [derived table])
variable: h_firstdead (table[s]: all_spouse_pairs_full [derived table])
the mode of the reported separation dates is taken first (this is the date estimated from the marriage end year reported by either partner). It is updated to the latest co-residency date [if the reason for the end of the co-res episode was divorce] if this is later or in the same year but different date. If there is a residency date where they are still thought to be married after the separation date the sepdate is deleted. If the sepdate or stillmardate is on or after the death date for either partner, the sepdate is updated to the death date.