{ unmet need variables } pregnant = V213; amenor = V405; xusing = ( V312 <> 0 ); whenwant = notappl; fail = 0; infert = 0; if pregnant then { Determines if current pregnancy} box V225 => whenwant; { or last birth was wanted } 1-3 => V225; => 2; endbox; elseif sOccurs(REC41) then box M10(1) => whenwant; 1-3 => M10(1); => 2; endbox; endif; i = V018; if amenor then { find last birth in calendar } do i = V018 while i <= vcallen & !pos(VCAL(1)[i:1], "B") enddo; i = i + 1; endif; if pregnant | amenor then { Determines failure of method } { loop until the month before current/last pregnancy } while i <= vcallen & pos(VCAL(1)[i:1], "P") do i = i + 1; enddo; { check if "became pregnant while using" as discontinuation cause in calendar column 2 VCAL(2) } if i <= vcallen & pos(VCAL(1)[i:1],vcalmeth) & pos(VCAL(2)[i:1], "1") then fail = 1; endif; endif; if !pregnant & !amenor then { Determines infertility } box A239U : A239N => lper; : missing => 0; { Assumes less than 6 months } : 94-96 => 99; { Assumes more than 6 months } : >90 => 0; 1 : => int(A239N/30); 2 : => int(A239N/4.3); 3 : => A239N; 4 : => A239N*12; : => 0; endbox; if lper >= 6 then infert = 1 endif; endif; { !!! this code to be used in case that calendar wasn't used by country or that } { either no column 3 (marital history) was used and/or column 1 didn't } { collect information on use of methods } { !!! use V302 instead of V302A if ever used asked in the contraceptive table } { infert = married once, 5+ years ago, no children, not pregnant and never used } if V503 = 1 & V512 >= 5 & !V208 & !pregnant & (V302 = 0 | V302A = 0) then infert = 1 endif; { !!! notice that this definition requires the use of calendar columns 1 & 3: } { column 1 to know if no methods were used in the past 5 years } { column 3 to know if continuously married during the past 5 years } { If either column is not present or if methods weren't collected in } { column 1, use the definition given after the comment { !!! } below } x = 60; if V019 < x then x = V019 endif; { short calendar } do i = V018 while i < V018+x & pos(VCAL(3)[i:1],"X") & { cont. married } pos(VCAL(1)[i:1],"BPT0") { not using } enddo; if i >= V018+x then { continuously married and not using for five years } if !V208 & !pregnant then infert = 1; endif; endif; { !!! } infert2 = infert; { !!! use V302 instead of V302A if ever used asked in the contraceptive table } { infert2 = married 5+ years ago, no children, not pregnant and never used } if V512 >= 5 & !V208 & !pregnant & (V302 = 0 | V302A = 0) then infert2 = 1 endif; { !!! } if V602 = 5 | V376 = 23 | V3A08D = 1 then { Can't get pregnant or menopausal } infert2 = 1 endif; { Exposure } box pregnant : amenor : infert => V623; 1 : : => 1; { Pregnant } : 1 : => 2; { Amenorrheic } : : 1 => 3; { Infertile } : : => 0; { Fecund } endbox; { Exposure (definition 2) } box pregnant : amenor : infert2 => V625; 1 : : => 1; { Pregnant } : 1 : => 2; { Amenorrheic } : : 1 => 3; { Infertile } : : => 0; { Fecund } endbox; box V502 : V528 => sexst; 1 : => 1; { Currently married or } : <31 => 1; { Sex in last month or } : 95 => 1; { Sex in last 4 weeks (special code) } : notappl => 0; { Never had sex } : => 2; { Not currently married, and } { not had sex in last month } endbox; { Unmet need } { variable "fail" may not exist, if no discontinuation column in calendar } box xusing: sexst : V623 : fail : whenwant : V605 => V624; 1 : : : : : 5-7 => 4; { Users - limit } 1 : : : : : => 3; { Users - space } : : 1,2 : 1 : 3 : => 6; { Fail - limit } : : 1,2 : 1 : : => 5; { Fail - space } : 1 : 1,2 : : 2 : => 1; { P/A Need - space } : 1 : 1,2 : : 3 : => 2; { P/A Need - limit } : : 3 : : : => 9; { Infecund } : 1 : 0 : : : 2-4 => 1; { Need - space } : 1 : 0 : : : 5 => 2; { Need - limit } : 0 : : : : => 0; { Never had sex } : 2 : : : : => 8; { No sex last month} : : 1,2 : : 1 : => 7; { P/A No need } : : : : : 1 => 7; { No need } : : : : : => missing; endbox; { Unmet need (definition 2) } { whether it'll be a problem if pregnant in next few weeks not in DHS-VI and forward } box xusing: sexst : V625 : fail : whenwant : V605 => V626; 1 : : : : : 5-7 => 4; { Users - limit } 1 : : : : : => 3; { Users - space } : : 1,2 : 1 : 3 : 1-3 => 5; { Fail - space } : : 1,2 : 1 : 3 : => 6; { Fail - limit } : : 1,2 : 1 : : => 5; { Fail - space } : 1 : 1,2 : : 2 : => 1; { P/A Need - space } : 1 : 1,2 : : 3 : 1-3 => 1; { P/A Need - space } : 1 : 1,2 : : 3 : => 2; { P/A Need - limit } : : 3 : : : => 9; { Infecund } : 1 : 0 : : : 2 => 1; { Need - space } : 1 : 0 : : : 3-4 => 1; { Need - space } : 1 : 0 : : : 5 => 2; { Need - limit } : 0 : : : : => 0; { Never had sex } : 2 : : : : => 8; { No sex last month } : : 1,2 : : 1 : => 7; { P/A No need } : : : : : 1 => 7; { No need } : : : : : => missing; endbox; { Unmet need (definition 3) } { Definition of V625A and V626A for the revised unmet need definition - Bradley/Croft/Fishel } { Check that all variables used in the calculation below exist - if not the indicator may not be calculatable Also check for any special codes on the variables below that are not in the standard questionnaire !!! } { unmet need variables } pregnant = V213; amenor = V405; xusing = ( V312 <> 0 ); whenwant = notappl; cutoff = 24; amenor24 = ( V405 & V222 < cutoff ); { amenorrhea up to cutoff (V222 is time between last birth and interview - months)} { Computation of last period } box V215 : V208 : amenor => lper3; missing : : => 0; { Considered fecund } 993 : : => 9999; { Hysterectomy - considered infecund (separate from 994 in some surveys) } 994 : : => 9999; { In menopause/hysterectomy - considered infecund } 996 : >0 : => (-1); { Never menstruated, but had a birth in the last five years - considered fecund } 996 : : => 9999; { Never menstruated - considered infecund } 995 : >0 : => (-2); { Before last birth, but had birth in last 5 years - considered fecund - flagged cases on V227 if not amenorrheic} 995 : : => 9997; { Considered infecund if last birth > than cutoff, otherwise should be caught as amenorrheic (although some are not - see V227 for flag) } >990 : : => 0; { Special values not considered as infecund } 100-490 : : 1 => (-3); { Amenorrheic 24-59 months - time since last birth duration given - considered fecund } 100-190 : : => int((V215-100)/30); { days } 200-290 : : => int((V215-200)/4.3); { weeks } 300-390 : : => V215-300; { months } 400-490 : : => (V215-400)*12; { years } : : => (-4); { Other special values not considered as infecund } endbox; { fixes for handling inconsistencies - only affects cases where not reported amenorrheic, reported time since last period and this is before last birth, and birth in the last 5 years } if !amenor24 & ( soccurs(REC41) = 0 | M6(1) in 97,99,missing ) & V208 > 0 & ( lper3 in 1:990 & lper3 > V222 | V215 = 995 ) then amenor = 1; if V222 < cutoff then amenor24 = 1 endif; if V215 = 995 then errmsg("Not reported as amenorrheic on M6 but last period before last birth and V215 = 995 - treating this case as amenorrheic") summary; else errmsg("Not reported as amenorrheic on M6 but last period before last birth (V215=%d V222=%d)",V215,V222); endif; endif; infec1 = 0; { married 5+ years ago, no children in past 5 years, not pregnant, and never used } infec3 = 0; { "Can't get pregnant" on future intentions or "menopausal/hysterectomy" on {DHSVI} reason not currently using a contraceptive method/{DHSII-DHSV} reason not intending to use a contraceptive method in the future } infec4 = 0; { Time since last birth >= 6 months or menopausal/hysterectomy or never menstruated or last period before last birth } { Whether/when the current pregnancy or the last birth was wanted } x = notappl; if pregnant then { Determines if current pregnancy wanted ... } x = V225; elseif amenor24 then { ... or last birth was wanted } x = M10(1); endif; box x => whenwant; notappl => notappl; 1-3 => x; 4,8 => 8; { Cases of don't know or "up to God treated as code 8 here } => 9; { Other codes treated as missing (instead of to space (2) as in the old version) } endbox; { infec1 = married 5+ years ago, no children in past 5 years, not pregnant, and never used contraception } if V502 = 1 & V512 >= 5 & !V208 & !pregnant & ({ V302 = 0 } V302A = 0 ) then { !!! comment out V302 or V302A depending on which exists !!! } infec1 = 1 endif; { infec3 = Not pregnant and not amenorrheic (up to cutoff) and says a) she can't get pregnant on future desires, or b) she is menopausal or had hysterectomy on reason not using contraception (was reason not intending to use in the future in DHSII-V) } if !pregnant & !amenor24 then if V602 = 5 | { Can't get pregnant } V3A08D = 1 { or menopausal/hysterectomy - DHSVI: reason not currently using a contraceptive method } { V376 = 23 } { - DHSIII-DHSV: reason not intending to use a contraceptive method in the future } { not active - use this line if V3A08D does not exist !!! } then infec3 = 1 endif; endif; { infec4 = Not pregnant and not amenorrheic (up to cutoff) and a) she is menopausal or had hysterectomy on "time since last birth" (V215 = 994 [or 993]), or b) she never menstruated on "time since last birth" (V215 = 996), or c) last period was before last birth and last birth was more than 60 months ago, or d) not amenorrheic 24-59 months and last period was 6+ months ago } if !pregnant & !amenor24 then { Determines infecundity based on last period } if lper3 >= 9990 then infec4 = 1 { infec4a } elseif lper3 >= 6 & !amenor then infec4 = 1 endif; { infec4b } { Logic below is for checking the time since last period variable - please review with Trevor } if V502=1 then if lper3 = (-1) then errmsg("lper3=(-1)") summary; elseif lper3 = (-2) then errmsg("V222=%d cutoff=%d V215=%d V227=%d M6=%d lper3=%d",V222,cutoff,V215,V227,M6(1),lper3) summary; elseif lper3 = (-3) then errmsg("lper3=(-3)") summary; elseif lper3 = (-4) then errmsg("lper3=(-4) V215=%d",V215); elseif lper3 >= 6 then errmsg("lper3>=6" ) summary; elseif lper3 = 9999 then errmsg("lper3=9999") summary; elseif lper3 = 9998 then errmsg("lper3=9998") summary; elseif lper3 = 9997 then if sOccurs(REC41) then errmsg("lper3=%d V222=%d cutoff=%d V215=%d V227=%d M6=%d",lper3,V222,cutoff,V215,V227,M6(1)); else errmsg("lper=9997") summary; endif; endif; endif; endif; { Not pregnant and not amenorrheic } { combine infecundity groups } infec = (infec1 | infec3 | infec4); { Exposure (revised definition - Bradley/Croft/Fishel) } box pregnant : amenor24 : infec => V625A; { Pregnant, Amenorrheic, Infecund, or Fecund } 1 : : => 1; { Pregnant } : 1 : => 2; { Amenorrheic } : : 1 => 3; { Infecund } : : => 0; { Fecund } endbox; box V502 : V528 => sexst; { Sexually active status } 1 : => 1; { Currently married or } : <31 => 1; { Sex in last month or } : 95 => 1; { Sex in last 4 weeks (special code) } : notappl => 0; { Never had sex } : => 2; { Not currently married, and not had sex in last month } endbox; { Unmet need (revised definition - Bradley/Croft/Fishel) } box xusing: sexst : V625A : whenwant : V605 => V626A; 1 : : : : 5-7 => 4; { Users - limit } 1 : : : : => 3; { Users - space } : : 1,2 : 2 : => 1; { P/A Need - space } : : 1,2 : 3 : => 2; { P/A Need - limit } : : 1,2 : 8 : => 1; { P/A Need - space - if 'not sure' on whenwant (some surveys) } : : 1,2 : 9 : => 99; { Missing } : : 1,2 : 1 : => 7; { P/A No need } : 1 : 0 : : 2 => 1; { Need - space } : 1 : 0 : : 3-4 => 1; { Need - space } : 1 : 0 : : 5 => 2; { Need - limit } : 1 : 0 : : 1 => 7; { No need } : : 3 : : => 9; { Infecund } : 0 : : : => 0; { Never had sex } : 2 : : : => 8; { No sex last month } : : : : 1 => 7; { No need } : : : : => 999; endbox; if V626A in 99,999 then errmsg("V626A=%d V602=%d V605=%d",V626A,V602,V605); V626A=missing endif;