Epidemiology & Technology

Stata Code for eCSC and CSC calculations

WHO has identified WHO Effective Cataract Surgical Coverage (eCSC) as a key indicator for monitring Universal Eye Health. LINK

There is a slight change from the prior formulae used for eCSC in papers by Ramke et al and the one published by Keel et al.

Further, the original CSC estimation formula by Lindberg et al has also been recommended a change by McCormick et al

Using the RAAB 6 survey data, you can generate the various eCSC and CSC indicators using the code below.

Save the code as a Stata do file “eCSC_WHO_2022.do” in the same folder where your data is located and where you are running your analysis


/*
WHO 2022 [8]   a + b / x+y+z

a Individuals with unilateral operated cataract attaining PVA equal to, or 
 better than, 6/12 in the operated eye, who have BCVA worse than 6/12 in the other eye

b Individuals with bilateral operated cataract attaining PVA equal to, or better than, 6/12 
 in at least one eye.

x Individuals with unilateral operated cataract (regardless of visual acuity in the operated eye), 
who have BCVA worse than 6/12 in the other eye 

y Individuals with bilateral operated cataract, regardless of visual acuity - COMMON VARIABLE FOR CSC

z Individuals with BCVA worse than 6/12 in both eyes with cataract as 
 the main cause of vision impairment or blindness in one or both eyes
 
 
UNILATERAL OPERATED -  [ inlist(lere, 3,4,5) &  inlist(lele, 1,2) ]   or  [ inlist(lele, 3,4,5) &  inlist(lere, 1,2) ]
	exclude persons with no view of lens

*/


cap drop yblOp
gen yblOp = 0 if status==1
replace yblOp = 1 if status==1 & ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) )  // BL Op Cat

label var yblOp "Bilateral opetrated (y)"

cap program drop eCsc612Pva612 
program define eCsc612Pva612 
version 14
cap drop a612pva612
gen a612pva612 = 0
replace a612pva612 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2)   & inlist(pvare, 1) & inlist(bvale, 2,3,4,5,6,7) ) | /// /// Rt Op cat with PVA 612pva612 and Lt BVA < /612pva612
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2)   & inlist(pvale, 1) & inlist(bvare, 2,3,4,5,6,7) )

cap drop b612pva612
 gen b612pva612 = 0
 replace b612pva612 = 1 if ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// /// BL Op Cat
 (inlist(pvare, 1) | inlist(pvale, 1) ) // PVA equal to, or better than, 6/12 in at least one eye

 
 cap drop x612pva612
 gen x612pva612 = 0
 replace x612pva612 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) &  inlist(bvale, 2,3,4,5,6,7) ) | /// RT Op Cat Lt NOt operated , Lt BCVA worse than 612
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 2,3,4,5,6,7) )

cap drop z612pva612
gen z612pva612 = 0
replace z612pva612 = 1 if ///
 (inlist(bvare, 2,3,4,5,6,7) & inlist(bvale, 2,3,4,5,6,7) & /// /// BCVA worse than 6/12 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye

cap drop denom612pva612
gen denom612pva612 = x612pva612 ==1 | yblOp==1 | z612pva612==1 if status==1
cap drop denom612pva612_grp
egen denom612pva612_grp = group(x612pva612 yblOp z612pva612) if status==1, lab
cap drop num612pva612_grp
egen num612pva612_grp = group(a612pva612 b612pva612 ) if denom612pva612==1, lab

cap drop eCSC612pva612
gen eCSC612pva612 = a612pva612 ==1 | b612pva612==1 if denom612pva612==1
tab eCSC612pva612
label var eCSC612pva612 "eCSC, Operable Cataract 6/12, Outcome 6/12"
label var a612pva612 "U/L operated cataract with PVA >= 6/12 in operated eye, and BCVA < 6/12 in other eye"
label var b612pva612 "B/L operated cataract with PVA >= 6/12 in at least 1 eye"
label var x612pva612 "U/L operated cataract, and BCVA < 6/12 in other eye"
label var z612pva612 "BCVA < 6/12 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end





// Operable cataract at BVA 6/18, Outcome PVA at 6/12
cap program drop eCsc618Pva612 
program define eCsc618Pva612
 version 14
 cap drop a618pva612
 gen a618pva612 = 0
 replace a618pva612 = 1 if ///
  (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1) & inlist(bvale, 3,4,5,6,7) ) | /// Rt Op cat with PVA 612 and Lt BVA < /618 
  (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1) & inlist(bvare, 3,4,5,6,7) )  // Lt Op cat with PVA 612 and Rt BVA < /618 

 cap drop b618pva612
 gen b618pva612 = 0
 replace b618pva612 = 1 if ///
  (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// BL Op Cat
  (inlist(pvare, 1) | inlist(pvale, 1) ) // PVA equal to, or better than, 6/12 in at least one eye
cap drop x618pva612
gen x618pva612 = 0
replace x618pva612 = 1 if ///
  (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 3,4,5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 618
  (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 3,4,5,6,7) ) // LT Op Cat , RT BCVA worse than 618
cap drop z618pva612
gen z618pva612 = 0
replace z618pva612 = 1 if ///
  (inlist(bvare, 3,4,5,6,7) & inlist(bvale, 3,4,5,6,7) & /// BCVA worse than 6/18 in both eyes
  (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye

cap drop denom618pva612
gen denom618pva612 = x618pva612 ==1 | yblOp==1 | z618pva612==1 if status==1
egen denom618pva612_grp = group(x618pva612 yblOp z618pva612) if status==1, lab
egen num618pva612_grp = group(a618pva612 b618pva612 ) if denom618pva612==1, lab
   
cap drop eCSC618pva612
gen eCSC618pva612 = a618pva612 ==1 | b618pva612==1 if denom618pva612==1
 
// drop a618pva612 b618pva612 x618pva612 y618pva612 z618pva612  num618pva612_grp
tab eCSC618pva612
label var eCSC618pva612 "eCSC, Operable Cataract 6/18, Outcome 6/12"
label var a618pva612 "U/L operated cataract with PVA >= 6/12 in operated eye, and BCVA < 6/18 in other eye"
label var b618pva612 "B/L operated cataract with PVA >= 6/12 in at least 1 eye"
label var x618pva612 "U/L operated cataract, and BCVA < 6/18 in other eye"
label var z618pva612 "BCVA < 6/18 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end



// Operable cataract at BVA 6/18, Outcome PVA at 6/18
cap program drop eCsc618Pva618 
program define eCsc618Pva618
version 14
cap drop a618pva618
gen a618pva618 = 0
replace a618pva618 = 1 if ///
  (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1, 2) & inlist(bvale, 3,4,5,6,7) ) | /// Rt Op cat with PVA 618 and Lt BVA < /618 
  (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1, 2) & inlist(bvare, 3,4,5,6,7) )  // Lt Op cat with PVA 618 and Rt BVA < /618 
cap drop b618pva618
gen b618pva618 = 0
replace b618pva618 = 1 if ///
  (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// BL Op Cat
  (inlist(pvare, 1, 2) | inlist(pvale, 1, 2) ) // PVA equal to, or better than, 6/18 in at least one eye
cap drop x618pva618
gen x618pva618 = 0
replace x618pva618 = 1 if ///
  (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 3,4,5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 618
  (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 3,4,5,6,7) ) // LT Op Cat , RT BCVA worse than 618
cap drop z618pva618
gen z618pva618 = 0
replace z618pva618 = 1 if ///
 (inlist(bvare, 3,4,5,6,7) & inlist(bvale, 3,4,5,6,7) & /// BCVA worse than 6/18 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
cap drop denom618pva618
gen denom618pva618 = x618pva618 ==1 | yblOp==1 | z618pva618==1 if status==1
egen denom618pva618_grp = group(x618pva618 yblOp z618pva618) if status==1, lab
egen num618pva618_grp = group(a618pva618 b618pva618 ) if denom618pva618==1, lab
cap drop eCSC618pva618
gen eCSC618pva618 = a618pva618 ==1 | b618pva618==1 if denom618pva618==1
tab eCSC618pva618
label var eCSC618pva618 "eCSC, Operable Cataract 6/18, Outcome 6/18"
label var a618pva618 "U/L operated cataract with PVA >= 6/18 in operated eye, and BCVA < 6/18 in other eye"
label var b618pva618 "B/L operated cataract with PVA >= 6/18 in at least 1 eye"
label var x618pva618 "U/L operated cataract, and BCVA < 6/18 in other eye"
label var z618pva618 "BCVA < 6/18 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end


// Operable cataract at BVA 6/60, Outcome PVA at 6/12
cap program drop eCsc660Pva612 
program define eCsc660Pva612 
version 14
cap drop a660pva612
gen a660pva612 = 0
replace a660pva612 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1) & inlist(bvale, 4,5,6,7) ) | /// Rt Op cat with PVA 612 and Lt BVA < /660 
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1) & inlist(bvare, 4,5,6,7) )  // Lt Op cat with PVA 612 and Rt BVA < /660 
// cap drop b660pva612
gen b660pva612 = 0
replace b660pva612 = 1 if ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// BL Op Cat
 (inlist(pvare, 1) | inlist(pvale, 1) ) // PVA equal to, or better than, 612 in at least one eye
// cap drop x660pva612
gen x660pva612 = 0
replace x660pva612 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 4,5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 660
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 4,5,6,7) ) // LT Op Cat , RT BCVA worse than 660
// cap drop z660pva612
gen z660pva612 = 0
replace z660pva612 = 1 if ///
 (inlist(bvare, 4,5,6,7) & inlist(bvale, 4,5,6,7) & /// BCVA worse than 660 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
cap drop denom660pva612
gen denom660pva612 = x660pva612 ==1 | yblOp==1 | z660pva612==1 if status==1
egen denom660pva612_grp = group(x660pva612 yblOp z660pva612) if status==1, lab
egen num660pva612_grp = group(a660pva612 yblOp ) if denom660pva612==1, lab
cap drop eCSC660pva612
gen eCSC660pva612 = a660pva612 ==1 | b660pva612==1 if denom660pva612==1
// drop a660pva612 b660pva612 x660pva612 y660pva612 z660pva612  num660pva612_grp
tab eCSC660pva612
label var eCSC660pva612 "eCSC, Operable Cataract 6/60, Outcome 6/12"
label var a660pva612 "U/L operated cataract with PVA >= 6/12 in operated eye, and BCVA < 6/60 in other eye"
label var b660pva612 "B/L operated cataract with PVA >= 6/12 in at least 1 eye"
label var x660pva612 "U/L operated cataract, and BCVA < 6/60 in other eye"
label var z660pva612 "BCVA < 6/60 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end

// Operable cataract at BVA 6/60, Outcome PVA at 6/18
cap program drop eCsc660Pva618 
program define eCsc660Pva618 
version 14
cap drop a660pva618
gen a660pva618 = 0
replace a660pva618 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1, 2) & inlist(bvale, 4,5,6,7) ) | /// Rt Op cat with PVA 618 and Lt BVA < /660 
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1, 2) & inlist(bvare, 4,5,6,7) )  // Lt Op cat with PVA 618 and Rt BVA < /660 
cap drop b660pva618
gen b660pva618 = 0
replace b660pva618 = 1 if ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// BL Op Cat
 (inlist(pvare, 1, 2) | inlist(pvale, 1, 2) ) // PVA equal to, or better than, 618 in at least one eye
cap drop x660pva618
gen x660pva618 = 0
replace x660pva618 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 4,5,6,7) ) | /// RT Op Cat , Lt BCVA unop worse than 660
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 4,5,6,7) ) // LT Op Cat , RT BCVA unop  worse than 660
cap drop z660pva618
gen z660pva618 = 0
replace z660pva618 = 1 if ///
 (inlist(bvare, 4,5,6,7) & inlist(bvale, 4,5,6,7) & /// BCVA worse than 660 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye

cap drop denom660pva618
gen denom660pva618 = x660pva618 ==1 | yblOp==1 | z660pva618==1 if status==1
egen denom660pva618_grp = group(x660pva618 yblOp z660pva618) if status==1, lab
egen num660pva618_grp = group(a660pva618 b660pva618 ) if denom660pva618==1, lab
cap drop eCSC660pva618
gen eCSC660pva618 = a660pva618 ==1 | b660pva618==1 if denom660pva618==1
tab eCSC660pva618
label var eCSC660pva618 "eCSC, Operable Cataract 6/60, Outcome 6/18"
label var a660pva618 "U/L operated cataract with PVA >= 6/18 in operated eye, and BCVA < 6/60 in other eye"
label var b660pva618 "B/L operated cataract with PVA >= 6/18 in at least 1 eye"
label var x660pva618 "U/L operated cataract, and BCVA < 6/60 in other eye"
label var z660pva618 "BCVA < 6/60 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end


// Operable cataract at BVA 3/60, Outcome PVA at 6/12
cap program drop eCsc360Pva612 
program define eCsc360Pva612 
version 14
cap drop a360pva612
gen a360pva612 = 0
replace a360pva612 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1) & inlist(bvale, 5,6,7) ) | /// Rt Op cat with PVA 612 and Lt BVA < /360 
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1) & inlist(bvare, 5,6,7) )  // Lt Op cat with PVA 612 and Rt BVA < /360 
cap drop b360pva612
gen b360pva612 = 0
replace b360pva612 = 1 if ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// BL Op Cat
 (inlist(pvare, 1) | inlist(pvale, 1) ) // PVA equal to, or better than, 612 in at least one eye
cap drop x360pva612
gen x360pva612 = 0
replace x360pva612 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 360
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 5,6,7) ) // LT Op Cat , RT BCVA worse than 360
cap drop z360pva612
gen z360pva612 = 0
replace z360pva612 = 1 if ///
 (inlist(bvare, 5,6,7) & inlist(bvale, 5,6,7) & /// BCVA worse than 360 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
cap drop denom360pva612
gen denom360pva612 = x360pva612 ==1 | yblOp==1 | z360pva612==1 if status==1
egen denom360pva612_grp = group(x360pva612 yblOp z360pva612) if status==1, lab
egen num360pva612_grp = group(a360pva612 yblOp ) if denom360pva612==1, lab
cap drop eCSC360pva612
gen eCSC360pva612 = a360pva612 ==1 | b360pva612==1 if denom360pva612==1
tab eCSC360pva612
label var eCSC360pva612 "eCSC, Operable Cataract 3/60, Outcome 6/12"
label var a360pva612 "U/L operated cataract with PVA >= 6/12 in operated eye, and BCVA < 3/60 in other eye"
label var b360pva612 "B/L operated cataract with PVA >= 6/12 in at least 1 eye"
label var x360pva612 "U/L operated cataract, and BCVA < 3/60 in other eye"
label var z360pva612 "BCVA < 3/60 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end

// Operable cataract at BVA 3/60, Outcome PVA at 6/18
cap program drop eCsc360Pva618 
program define eCsc360Pva618 
version 14
cap drop a360pva618
gen a360pva618 = 0
replace a360pva618 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1, 2) & inlist(bvale, 5,6,7) ) | /// Rt Op cat with PVA 618 and Lt BVA < /360 
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1, 2) & inlist(bvare, 5,6,7) )  // Lt Op cat with PVA 618 and Rt BVA < /360 
cap drop b360pva618
gen b360pva618 = 0
replace b360pva618 = 1 if ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// BL Op Cat
 (inlist(pvare, 1, 2) | inlist(pvale, 1, 2) ) // PVA equal to, or better than, 618 in at least one eye
cap drop x360pva618
 gen x360pva618 = 0
 replace x360pva618 = 1 if ///
  (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 360
  (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 5,6,7) ) // LT Op Cat , RT BCVA worse than 360
cap drop z360pva618
gen z360pva618 = 0
replace z360pva618 = 1 if ///
 (inlist(bvare, 5,6,7) & inlist(bvale, 5,6,7) & /// BCVA worse than 360 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
cap drop denom360pva618
gen denom360pva618 = x360pva618 ==1 | yblOp==1 | z360pva618==1 if status==1
egen denom360pva618_grp = group(x360pva618 yblOp z360pva618) if status==1, lab
egen num360pva618_grp = group(a360pva618 b360pva618 ) if denom360pva618==1, lab
cap drop eCSC360pva618
gen eCSC360pva618 = a360pva618 ==1 | b360pva618==1 if denom360pva618==1
tab eCSC360pva618
label var eCSC360pva618 "eCSC, Operable Cataract 3/60, Outcome 6/18"
label var a360pva618 "U/L operated cataract with PVA >= 6/18 in operated eye, and BCVA < 3/60 in other eye"
label var b360pva618 "B/L operated cataract with PVA >= 6/18 in at least 1 eye"
label var x360pva618 "U/L operated cataract, and BCVA < 3/60 in other eye"
label var z360pva618 "BCVA < 3/60 in both eyes with cataract as main cause of vision impairment or blindness in one or both eyes"
end

/* csc 2021 McCormick
CSC  x + y / x+y+z
x Individuals with unilateral operated cataract (regardless of visual acuity in the operated eye), 
 who have BCVA worse than 6/12 in the other eye
y Individuals with bilateral operated cataract, regardless of visual acuity
z Individuals with BCVA worse than 6/12 in both eyes with cataract as 
 the main cause of vision impairment or blindness in one or both eyes
*/


cap program drop csc612 
program define csc612 
version 14
gen x612 = 0
replace x612 = 1 if ///
 (inlist(lere, 3,4,5) &   inlist(lele, 1,2) & inlist(bvale, 2,3,4,5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 612
 (inlist(lele, 3,4,5) &   inlist(lere, 1,2) & inlist(bvare, 2,3,4,5,6,7) )
gen z612 = 0
replace z612 = 1 if ///
 (inlist(bvare, 2,3,4,5,6,7) & inlist(bvale, 2,3,4,5,6,7) & /// /// BCVA worse than 6/12 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
gen denom612 = x612 ==1 | yblOp==1 | z612==1 if status==1
egen denom612_grp = group(x612 yblOp z612) if status==1, lab 
egen num612_grp = group(x612 yblOp ) if denom612==1, lab
gen cSC612 = x612 ==1 | yblOp==1 if denom612==1
tab cSC612
label var cSC612 "CSC, Operable Cataract 6/12"
end


cap program drop csc618 
program define csc618 
version 14
gen x618 = 0
replace x618 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 3,4,5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 618
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 3,4,5,6,7) )
gen z618 = 0
replace z618 = 1 if ///
 (inlist(bvare, 3,4,5,6,7) & inlist(bvale, 3,4,5,6,7) & /// /// BCVA worse than 618 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
gen denom618 = x618 ==1 | yblOp==1 | z618==1 if status==1
egen denom618_grp = group(x618 yblOp z618) if status==1, lab 
egen num618_grp = group(x618 yblOp ) if denom618==1, lab
gen cSC618 = x618 ==1 | yblOp==1 if denom618==1
tab cSC618
label var cSC618 "CSC, Operable Cataract 6/18"
end


cap program drop csc660 
program define csc660 
version 14
gen x660 = 0
replace x660 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 4,5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 660
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 4,5,6,7) )
gen z660 = 0
replace z660 = 1 if ///
 (inlist(bvare, 4,5,6,7) & inlist(bvale, 4,5,6,7) & /// /// BCVA worse than 660 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
gen denom660 = x660 ==1 | yblOp==1 | z660==1 if status==1
egen denom660_grp = group(x660 yblOp z660) if status==1, lab 
egen num660_grp = group(x660 yblOp ) if denom660==1, lab
gen cSC660 = x660 ==1 | yblOp==1 if denom660==1
tab cSC660
label var cSC660 "CSC, Operable Cataract 6/60"
end


cap program drop csc360 
program define csc360 
version 14
gen x360 = 0
replace x360 = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 5,6,7) ) | /// RT Op Cat , Lt BCVA worse than 360
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 5,6,7) )
gen z360 = 0
replace z360 = 1 if ///
 (inlist(bvare, 5,6,7) & inlist(bvale, 5,6,7) & /// /// BCVA worse than 360 in both eyes
 (causere ==3 | causele ==3 ) ) // Cat as main cause of VI in any eye
gen denom360 = x360 ==1 | yblOp==1 | z360==1 if status==1
egen denom360_grp = group(x360 yblOp z360) if status==1, lab 
egen num360_grp = group(x360 yblOp ) if denom360==1, lab
gen cSC360 = x360 ==1 | yblOp==1 if denom360==1
tab cSC360
label var cSC360 "CSC, Operable Cataract 3/60"
end


/* Classical CSC  CSC (people) = (x + y/x + y + z) × 100, where
 x = number of people with (pseudo)aphakia in one eye and operable cataract in the other; 
 y = number of people with bilateral (pseudo)aphakia; and 
 z = number of people with bilateral operable cataract.   */
cap program drop csc660Classical 
program define csc660Classical 
version 14
gen x660Classical = 0
replace x660Classical = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 4,5,6,7) & inlist(lele, 2) ) | /// 
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 4,5,6,7) & inlist(lere, 2) )
gen z660Classical = 0
replace z660Classical = 1 if ///
 (inlist(bvare, 4,5,6,7) & inlist(bvale, 4,5,6,7) & /// 
 (causere ==3 & causele ==3 ) ) 
gen denom660Classical = x660Classical ==1 | yblOp==1 | z660Classical==1 if status==1
egen denom660_grpClassical = group(x660Classical yblOp z660Classical) if status==1, lab 
egen num660_grpClassical = group(x660Classical yblOp ) if denom660Classical==1, lab
gen cSC660Classical = x660Classical ==1 | yblOp==1 if denom660Classical==1
tab cSC660Classical
label var cSC660Classical "Classical CSC, Operable Cataract 6/60"
end


/*
OLDER eCSC  KEEL a + b / x+y+z
• a=individuals with unilateral operated cataract attaining PVA ≥6/12 in the operated eye, 
who have BCVA <6/12 with cataract as the main cause of vision impairment or blindness in the other eye 
• b=individuals with bilateral operated cataract attaining PVA ≥6/12 in at least one eye 
• x=individuals with unilateral operated cataract (regardless of visual acuity in the operated eye), 
who have BCVA <6/12 with cataract as the main cause of vision impairment or blindness in the other eye 
• y=individuals with bilateral operated cataract, regardless of visual acuity 
• z=individuals with BCVA <6/12 with cataract as the main cause of vision impairment or blindness in both eyes
*/

cap program drop eCsc612Keel2020 
program define eCsc612Keel2020 
version 14
cap drop a612pva612Keel
gen a612pva612Keel = 0
replace a612pva612Keel = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(pvare, 1) & inlist(bvale, 2,3,4,5,6,7) & inlist(lele, 2) & inlist(causele, 2) ) | ///
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(pvale, 1) & inlist(bvare, 2,3,4,5,6,7) & inlist(lere, 2) & inlist(causere, 2) )
gen b612pva612Keel = 0
replace b612pva612Keel = 1 if ///
 (inlist(lere, 3,4,5) & inlist(lele, 3,4,5) ) & /// 
 (inlist(pvare, 1) | inlist(pvale, 1) ) 
gen x612pva612Keel = 0
replace x612pva612Keel = 1 if ///
 (inlist(lere, 3,4,5) &  inlist(lele, 1,2) & inlist(bvale, 2,3,4,5,6,7) & inlist(lele, 2) & inlist(causele, 2) ) | /// 
 (inlist(lele, 3,4,5) &  inlist(lere, 1,2) & inlist(bvare, 2,3,4,5,6,7) & inlist(lere, 2) & inlist(causere, 2) )
gen z612pva612Keel = 0
replace z612pva612Keel = 1 if ///
 (inlist(bvare, 2,3,4,5,6,7) & inlist(bvale, 2,3,4,5,6,7) & ///   
 (causere ==3 & causele ==3 ) ) 
gen denom612pva612Keel = x612pva612Keel ==1 | yblOp==1 | z612pva612Keel==1 if status==1
egen denom612pva612Keel_grp = group(x612pva612Keel yblOp z612pva612Keel) if status==1, lab
egen num612pva612Keel_grp = group(a612pva612Keel b612pva612Keel ) if denom612pva612Keel==1, lab
gen eCSC612pva612Keel = a612pva612Keel ==1 | b612pva612Keel==1 if denom612pva612Keel==1
tab eCSC612pva612Keel
label var eCSC612pva612Keel "KeeL eCSC, Operable Cataract 6/12, Outcome 6/12"
label var a612pva612Keel "KeeL U/L operated cataract with PVA >= 6/12 in operated eye, and BCVA < 6/12 due to cataract in other eye"
label var b612pva612Keel "KeeL B/L operated cataract with PVA >= 6/12 in at least 1 eye"
label var x612pva612Keel "KeeL U/L operated cataract, and BCVA < 6/12 due to cataract in other eye"
label var z612pva612Keel "KeeL BCVA < 6/12 in both eyes with cataract as main cause of vision impairment or blindness in both eyes"
end



Code language: Stata (stata)

To use the code, simply load your RAAB 6 data in stata. Call the do file containing this code and then execute the specific program defined in this code that you are interested in estimating


// LOAD PROGRAM Macros for estimating eCSCs
do "eCSC_WHO_2022.do"

// Execute the programs
di as error "Generating WHO 2022 based eCSC variables for 6/12"

eCsc612Pva612
eCsc618Pva612
eCsc618Pva618
eCsc660Pva612
eCsc660Pva618

eCsc360Pva612
eCsc360Pva618

csc618
csc612
csc660
csc360
Code language: JavaScript (javascript)

Related Posts