Hi Stata folks,
I have a question, and am not even sure how to search on it (google and the search function here haven't helped - but most likely because I don't know how to articulate my question concisely!).
I have a long text field of author names from manuscripts, a variable called 'author'. My data set has about 600 records (each record is one manuscript). The names within the variable 'author' are separated by semicolons ';' and I'd like to be able to create X new variables, each with the first author, second author, third author, etc. where X = the longest list (for example, generate a variable named: author_number_`x'). The most authors I have listed in my data set is one paper with 73 authors - a large scientific network publication.
Then from this list, I would like to create another variable, "last_author" that takes the name from the last, non-missing data point from author_number_`x'.
Perhaps my coffee was inadequate today, but I'm stuck. Any suggestions? Much thanks in advance.
I have a question, and am not even sure how to search on it (google and the search function here haven't helped - but most likely because I don't know how to articulate my question concisely!).
I have a long text field of author names from manuscripts, a variable called 'author'. My data set has about 600 records (each record is one manuscript). The names within the variable 'author' are separated by semicolons ';' and I'd like to be able to create X new variables, each with the first author, second author, third author, etc. where X = the longest list (for example, generate a variable named: author_number_`x'). The most authors I have listed in my data set is one paper with 73 authors - a large scientific network publication.
Then from this list, I would like to create another variable, "last_author" that takes the name from the last, non-missing data point from author_number_`x'.
Perhaps my coffee was inadequate today, but I'm stuck. Any suggestions? Much thanks in advance.
Comment