Dear StataList,

I'm looking for advice re. creating a control cohort matched 1:1 on baseline demographic features to their respective intervention cohort, for an ophthalmic survival analysis.

We have 4 cohorts in our dataset, those undergoing either:

(i) standalone minimally-invasive glaucoma surgery (MIGS), no prior selective laser trabeculoplasty (SLT) (control), vs
(ii) standalone MIGS, with prior SLT (intervention)

and

(iii) combined phacoemulsification + MIGS, no prior SLT (control), vs
(iv) combined phacoemulsification + MIGS, with prior SLT (intervention).

Intervention and control groups have different baseline demographics, and there are substantially fewer participants in the intervention cohort.
We're wanting to form a control cohort, with the same n, matched 1:1 by the following 5 demographics features to those in the intervention cohort: age, sex, race/ethnicity, glaucoma type, and glaucoma severity.

Below is an example of the data.

"migsnophaco_withslt_2yr" are groups (i) and (ii) (where 1 = with prior SLT), and "migsphaco_withslt_2yr" are groups (iii) and (iv) (where 1 = with prior SLT).

Thanks for your help.
Really looking forward to any advice.

William

Code:
 
 * Example generated by -dataex-. To install: ssc install dataex clear input str43 id_no float(glaucoma_type glauc_severity) long _sex float(race_ethnic _age migsphaco_withslt_2yr migsnophaco_withslt_2yr) "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "00000fce9b964b7bbba0e45ca5acf6c7Left"  . . 2 1 51 . . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "000049ec671d4da491f12738eb517ff6Right" . . 1 1 71 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "00005f63385542f78f87378a11a10870Right" . . 2 1 73 0 . "0000b8b8d04046408e96445ac5694055Right" . . 1 1 81 0 . "0000b8b8d04046408e96445ac5694055Right" . . 1 1 81 0 . "0000b8b8d04046408e96445ac5694055Right" . . 1 1 81 0 . "0000b8b8d04046408e96445ac5694055Right" . . 1 1 81 0 . "0000b8b8d04046408e96445ac5694055Right" . . 1 1 81 0 . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0000c6d5083244a0a1028555fccb8966Left"  . . 1 3 64 . . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001173042a24cb28834472bd087e9ccRight" . . 1 1 65 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 1 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 1 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 1 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 1 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0001df54663c4ed093efc3c5e2feddebRight" 2 . 2 1 80 0 . "0002584e0f8841fa89b1104e788db1aeLeft"  . . 2 1 80 0 . "0002584e0f8841fa89b1104e788db1aeRight" . . 2 1 80 0 . "0002584e0f8841fa89b1104e788db1aeRight" . . 2 1 80 0 . "0002584e0f8841fa89b1104e788db1aeRight" . . 2 1 80 0 . "0002584e0f8841fa89b1104e788db1aeRight" . . 2 1 80 0 . end label values glaucoma_type _glaucoma_diagosis label def _glaucoma_diagosis 1 "suspect", modify label def _glaucoma_diagosis 2 "poag", modify label values glauc_severity _severity label def _severity 1 "mild", modify label values _sex _sex label def _sex 1 "Female", modify label def _sex 2 "Male", modify label values race_ethnic _race_ethnic label def _race_ethnic 1 "NH White", modify label def _race_ethnic 3 "Hispanic/Latino", modify