clear cd "Z:\pma\admin\presentations\Webinar_2022" use pma_00240.dta tab resultfq_2 resultfq_1, miss //Keep only women who completed their Phase 2 and Phase 1 keep if resultfq_2 == 1 keep if resultfq_1 == 1 //In PMA panel reports, only the de facto population is used as the analytical sample tab resident_1 tab resident_1, nolabel keep if (resident_1 == 11 | resident_1 == 22) & (resident_2 == 11 | resident_2 == 22) //Starting FP between Phase 1 and Phase 2 tab cp_1 cp_2 if cp_1 < 90 & cp_2 < 90, row gen fp_start = . replace fp_start = 0 if cp_1 == 0 replace fp_start = 1 if cp_1 == 0 & cp_2 == 1 tab country fp_start, row //Now to set our weight as a survey weight with a primary sampling unit for clustered standard errors svyset [pw=panelweight], psu(eaid_2) svy: tab country fp_start, row //Uptake of FP after pregnancy svy: tab country fp_start if pregnant_1 == 1, row //Method switching gen samemethod = . replace samemethod = 1 if cp_1 == 1 & cp_2 == 1 & fpcurreffmeth_1 == fpcurreffmeth_2 replace samemethod = 0 if cp_1 == 1 & cp_2 == 1 & fpcurreffmeth_1 != fpcurreffmeth_2 svy: tab country samemethod, row