Hi all,
I have a database made as follows: it has an id variable (docdb_family_id) and a list of ids cited by the id variable (cited_ids):
Now what I would like to obtain is the number of times that an id present in the docdb_family_id variable is present in the list cited_ids. In other words, the output variable (nr_green) should be:
where, for instance, the nr_green associate with docdb_family_id 1187498 is 3 because in the list cited_ids appear three indices present in docdb_family_id, namely: 1334478,1239277 and 1187498.
Thank you
I have a database made as follows: it has an id variable (docdb_family_id) and a list of ids cited by the id variable (cited_ids):
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long strL docdb_family_id cited_ids 569328 [1239483.0, 340820.0, 1340488.0, 19383012.0] 574660 [1239483.0, 563839.0] 1187498 [679028.0, 1334478.0, 1239277.0, 3801039130.0, 73193891.0, 1187498.0] 1226468 [1334478.0, 569328.0] 1236571 [] 1239098 [39201329.0, 8281.0, 3993093.0, 3793247.0, 37818738.0, 38913793.0, 38239238.0, 218173923.0, 13893701.0] 1239277 [1239622.0] 1239483 [] 1239622 [574660.0, 1226468.0, 19383012.0] 1239624 [1239749.0,1187498.0, 230983290.0, 11039932.0, 33298230.0, 329083.0] 1239749 [1226468.0] 1334478 [] end
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long strL int docdb_family_id cited_ids nr_green 569328 [1239483.0, 340820.0, 1340488.0, 19383012.0] 2 574660 [1239483.0, 563839.0] 1 1187498 [679028.0, 1334478.0, 1239277.0, 3801039130.0, 73193891.0, 1187498.0] 3 1226468 [1334478.0, 569328.0] 2 1236571 [] 1239098 [39201329.0, 8281.0, 3993093.0, 3793247.0, 37818738.0, 38913793.0, 38239238.0, 218173923.0, 13893701.0] 0 1239277 [1239622.0] 1 1239483 [] 1239622 [574660.0, 1226468.0, 19383012.0] 2 1239624 [1239749.0,1187498.0, 230983290.0, 11039932.0, 33298230.0, 329083.0] 2 1239749 [1226468.0] 1 1334478 [] end
Thank you
Comment