Hi all,
I am working with the following dataset:
Each ID and voucher ID is unique. I need to convert these string variables into numeric variables to calculate RDS weights (STATA command rds_network and rds). I used "encode/real/destring" command but i am getting duplicate numeric values (e.g., PART_ID==7; GIVEN_VOUCHER1=42 GIVEN_VOUCHER2=325; GIVEN_VOUCHER3=7 or PART_ID==12; GIVEN_VOUCHER1=442 GIVEN_VOUCHER2=48; GIVEN_VOUCHER3=48) .
How can I create unique values for each ID and each voucher? Thanks in advance.
Best,
Syed
I am working with the following dataset:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str30(PART_ID GIVEN_VOUCHER1 GIVEN_VOUCHER2 GIVEN_VOUCHER3) "M0001" "M1158" "M9817" "M6879" "M0002" "M3584" "M2138" "M4076" "M0003" "M6562" "M6584" "M2333" "M0004" "M2646" "M9405" "M5265" "M0005" "M6299" "M1237" "M1848" end
How can I create unique values for each ID and each voucher? Thanks in advance.
Best,
Syed
Comment