Dear StataList,

I'm running an ophthalmic survival analysis for postoperative patients, who we want to assess for failure by either (i) intraocular pressure >21/<20% decrease from baseline (on 2 separate occasions), or (ii) re-operation.

We're using a retrospective database, and by 3 years, we only have IOP/re-operation follow-up data for ~15% of our original cohort.
My PI has subsequently asked me to "impute" the data for the missing people (on the assumption that no follow up data means they've not failed by either criteria, and are happy out in the community).
My understanding is that this will keep the denominator "n at risk" essentially the same at each point in the survival analysis - rather than an "n at risk" of ~15% of the original cohort size by 3 years - so failure % will be much smaller.

I'm concerned this may not be "best practice" for survival analysis, but if anyone has any advice re. how best to do this, I'd be grateful.

My dataex code is below, and excerpts from my own .do file, if helpful.
(Note - our patient cohorts are standalone MIGS surgery (i) with and (ii) without prior laser (SLT), and combined surgery (iii) with and (iv) without prior laser)

Thanks very much, William.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str32 patient_guid float(first_proc_date proc_date failure1_day_iop_criteria_op1_2x) byte failed1_iop_criteria_op1_2x float failure1_day_reop_criteria_op1 byte failed1_reop_criteria_op1 float(migsphaco_withslt_2yr migsnophaco_withslt_2yr)
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"00000fce9b964b7bbba0e45ca5acf6c7" 20870 20892 184 0  184 0 . .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"000049ec671d4da491f12738eb517ff6" 19490 19490 276 1 2004 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"00005f63385542f78f87378a11a10870" 19813 19813 949 1 1456 0 0 .
"0000b8b8d04046408e96445ac5694055" 21162 21162 142 0  142 0 0 .
"0000b8b8d04046408e96445ac5694055" 21162 21162 142 0  142 0 0 .
"0000b8b8d04046408e96445ac5694055" 21162 21162 142 0  142 0 0 .
"0000b8b8d04046408e96445ac5694055" 21162 21162 142 0  142 0 0 .
"0000b8b8d04046408e96445ac5694055" 21162 21162 142 0  142 0 0 .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0000c6d5083244a0a1028555fccb8966" 20510 20517 352 1  717 0 . .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001173042a24cb28834472bd087e9cc" 21191 21191 227 0  227 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0001df54663c4ed093efc3c5e2feddeb" 20764 20764  64 1  634 0 0 .
"0002584e0f8841fa89b1104e788db1ae" 19842 19842 225 0  225 0 0 .
"0002584e0f8841fa89b1104e788db1ae" 19842 19842 225 0  225 0 0 .
"0002584e0f8841fa89b1104e788db1ae" 19842 19842 225 0  225 0 0 .
"0002584e0f8841fa89b1104e788db1ae" 19842 19842 225 0  225 0 0 .
end
format %td first_proc_date
format %td proc_date
My own example code (where age/sex/ethnicity etc variables are not included in the above data excerpt)

Code:
stset failure1_day_iop_criteria_op1_2x, failure(failed1_iop_criteria_op1_2x==1) scale(1)
stcox migsnophaco_withslt_2yr _age i._sex i.race_ethnic i.glaucoma_type i.glauc_severity i.first_op baseline_iop_op1

stset failure1_day_reop_criteria_op1, failure(failed1_reop_criteria_op1==1) scale(1)
stcox migsnophaco_withslt_2yr _age i._sex i.race_ethnic i.glaucoma_type i.glauc_severity i.first_op baseline_iop_op1

stset failure1_day_iop_criteria_op1_2x, failure(failed1_iop_criteria_op1_2x==1)  scale(30.4) exit(time 1095) 

stset failure1_day_reop_criteria_op1, failure(failed1_reop_criteria_op1==1) scale(30.4) exit(time 1095)