Hi Statalist.

Using panel dataset with five waves, I group couples into a number of religious categories, however, I notice that the total number of observations for a given category is equal to the sum for a given category per wave, instead of the number of couples of a given pairing over all waves. Total obs will change as people change religions and new couples enter the survey but once a couple is in the survey and assuming they don't change their religion, then that pairing should only be counted once for the waves that this remains the case (e.g. a couple that are both Catholic and have been Catholic throughout the panel should contribute '1' to the number of obs for 'both Catholic' and not '5' (one for each wave they stated they were 'both Catholic)'.

Can anyone advise how I can address this please?
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long(id (respondent) p_id (their partner's id) byte wave (relevant waves are 4, 7, 10, 14, 18) float faith (different religious categories)
116  279  4  1
116  279  7  1
116  279 10  1
116  279 14  1
116  279 18  1
123  124  4  6
123  124  7  6
123  124  10  6
123  124 14  6
123  124 18  6
113  114  4  4
113  114  7  4
113  114 10  4
113  114 14  4
113  114 18  4
150  151  4  4
150  151  7  4
150  151 10  4
150  151 14  4
150  151 18  4
152  153  4  8
152  153  7  8
152  153 10  8
152  153 14  8
152  153 18  8
155  217  4  13
155  217  7  13
155  217 10  13
155  217 14  13
155  217 18  13
178  179  4  13
178  179  7  13
178  179  10  13
178  179  14  13
178  179  18  13
end
Using Stata v.15.1.