Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create a citing categorical variable

    Hi all,

    I have a database looking like this where basically newa_cited_docdb is a string with some docdb_family_ids:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long docdb_family_id strL paperid strL newa_cited_docdb
     569328 "no" "[  596005  1226468  22591458 24627241 24750476 26261826 26405611 27079105 27096884]"                                                               
     574660 "no"  "[ 5956195 1226468]"                                                                                                   
    1187498 "no"  "[ 5855196  7755392 11183886 22894980 24648618 27185399]"                                                                                                                                                                                             
    1226468 "yes" "[ 3573464  6279285 2185207]"                                                                                                   
    1236571 "no"  "[ 2777078  2826073  5944733 10484188 11052747 14682645 15688752 22333410 22614097 22646501 22783765 22978728 23231683 24259740 24605606 24839432 25492752 27009992 27044704]"                                                                                                                                                                                                                  
    1578920  "no" "[ 3030390  4484338  4509665  7066743  7211880 10243514 2267654 22569953 22909650 23371311 23959587 24559330]"                                                                                                                                       
    1763337 "yes" "[]"                                                                                                                                                                                                                        
    2185207  "yes" "[ 2706410 23548461 24021282]"                                                                                                                                                                                                                        
    2267654 "yes" "[24069082 24776141 24994002]"                                                                                                                                                                                                                        
    2410050 "no" "[22794937 23078461 1763337]"                                                                                                                                                                                    
    2456718 "no" "[ 3259455 2185207 24032200 24386230]"                                                                                                                                                                                                               
    end
    Basically whenver paperid is "yes" we have a cited docdb_family_id meaning a docdb_family_id that appears somewhere (i.e. appearing in some docdb_family_id) in the variable newa_cited_docdb.
    What I would lie to do is basically is to create a categorical variable taking the number of the docdb_family_id for those docdb_family_id citing it. So in our example we should endd up with something like this:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long docdb_family_id strL paperid strL newa_cited_docdb long  strL categorical_variable
     569328 "no" "[  596005  1226468  22591458 24627241 24750476 26261826 26405611 27079105 1763337]"     [1226468,1763337]                                                      
     574660 "no"  "[ 5956195 1226468]"                                                                                                                            [1226468 ]   
    1187498 "no"  "[ 5855196  7755392 11183886 22894980 24648618 1763337]"                                                         [1763337]                                                                                                                                               
    1226468 "yes" "[ 3573464  6279285 2185207]"                                                                                                               .
    1236571 "no"  "[ 2777078  2826073  5944733 10484188 11052747 2267654 25492752 27009992 27044704]"        [2267654]                                                                                                                                                                                                
    1578920  "no" "[ 3030390  4484338  4509665  7066743  7211880 10243514 2267654 22569953 22909650 23371311 23959587 24559330]"                       [ 2267654]                                                                                                               
    1763337 "yes" "[]"                                                         .                                                                                                                                                                           
    2185207  "yes" "[ 2706410 23548461 24021282]"                         .                                                                                                                                                                                                
    2267654 "yes" "[24069082 24776141 24994002]"                         .                                                                                                                                                                                               
    2410050 "no" "[22794937 23078461 1763337]"                          [1763337]                                                                                                                                                                   
    2456718 "no" "[ 3259455 2185207 24032200 24386230]"          [2185207]                                                                                                                                                                                           
    end
    thanks!
Working...
X