Derivation
variable: p0intdate (table[s]: all_vaccination_records [derived table])
variable: p0yn (table[s]: all_vaccination_records [derived table])
*calculate first interview date where card seen and vaccine recorded as yes
bys ident: egen tempC=min(`vacc'intdate) if card==1 & `vacc'yn==1
bys ident: egen tempNC=min(`vacc'intdate) if card==2 & `vacc'yn==1
bys ident: egen `vacc'fyintdate=min(tempC)
bys ident: egen tempNCd=min(tempNC)
replace `vacc'fyintdate=tempNCd if `vacc'fyintdate==. & tempNCd~=.