I have a database with 2 kinds of variables:
DT1_OMS, PDT2_OMS...(1 to 5): instrumentation (you can have up to 5, and there are 5 different instrumentations)
PDT1_DIA : nÂș of days you have used this instrumentation
I would like to create a new variable in wich sum all PDT*_DIA, but only for an specific instrumentations.
I know how to do creating some other variables, but I wonder if it is possible to do it directly:
egen float d_su = rowtotal(PDT1_DIA if PDT1_OMS=="57.94", PDT2_DIA if PDT2_OMS=="57.94", ...)
This program does not work, but it is possible to do something like that?
Thank you in advance
DT1_OMS, PDT2_OMS...(1 to 5): instrumentation (you can have up to 5, and there are 5 different instrumentations)
PDT1_DIA : nÂș of days you have used this instrumentation
I would like to create a new variable in wich sum all PDT*_DIA, but only for an specific instrumentations.
I know how to do creating some other variables, but I wonder if it is possible to do it directly:
egen float d_su = rowtotal(PDT1_DIA if PDT1_OMS=="57.94", PDT2_DIA if PDT2_OMS=="57.94", ...)
This program does not work, but it is possible to do something like that?
Thank you in advance
Comment