Hello team.
Would you please help me figure out the STATA commands for this variable? I am trying to see the safety of combining two medical procedures on the same day.
We searched the database for hospitalizations of people who underwent the first medical procedure (Code: 02L73DK ).Hospitalizations that matched the criteria were divided into two groups based on whether an additional medical procedure (code:0DJ08ZZ) was performed on the same day.
i made two variables:
generate time_to_first_medical_procedure=.
foreach var of numlist 1/25 {
replace time_to_first_medical_procedure=PRDAY`var' if I10_PR`var' == "02L73DK"
}
generate time_to_other_procedure=.
foreach var of numlist 1/25 {
replace time_to_other_procedure=PRDAY`var' if I10_PR`var' == "0DJ08ZZ"
}
Now, I need to get a final variable that tells me if both procedures were performed at the same day:
generate same_day=0
replace same_day=1 if [[[[[ time_to_first_medical_procedure = time_to_other_procedure ]]]]]
Thanks in advance
Would you please help me figure out the STATA commands for this variable? I am trying to see the safety of combining two medical procedures on the same day.
We searched the database for hospitalizations of people who underwent the first medical procedure (Code: 02L73DK ).Hospitalizations that matched the criteria were divided into two groups based on whether an additional medical procedure (code:0DJ08ZZ) was performed on the same day.
i made two variables:
generate time_to_first_medical_procedure=.
foreach var of numlist 1/25 {
replace time_to_first_medical_procedure=PRDAY`var' if I10_PR`var' == "02L73DK"
}
generate time_to_other_procedure=.
foreach var of numlist 1/25 {
replace time_to_other_procedure=PRDAY`var' if I10_PR`var' == "0DJ08ZZ"
}
Now, I need to get a final variable that tells me if both procedures were performed at the same day:
generate same_day=0
replace same_day=1 if [[[[[ time_to_first_medical_procedure = time_to_other_procedure ]]]]]
Thanks in advance
Comment