|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Generating an ID
Hi Maria,
In my opinion, you could reshape your data into wide version:
(where a twin pair is only one line)
name / Twin name / TwinID
Helena Harris / Joanne Moore / 1
Kevin Dedman / Tom Dedman / 2
Freya Lamb / Sandra Scott / 3
Please see -reshape -
And then generate twinID. And then reshape it back into long version.
Mandy
Maria Garden wrote:
>Dear Stata list,
>
>I have the following problem: I have data where people had been asked
>to provide their name and the name of their twin.
>
>I would like to generate an identifier for each twin pair. How can I
>do that without really search for each name? I have a couple of
>hundred people.
>
>My data looks like this:
>
>name / Twin name / TwinID
>Helena Harris / Joanne Moore / 1
>Kevin Dedman / Tom Dedman / 2
>Freya Lamb / Sandra Scott / 3
>
>Sandra Scott / Freya Lamb / 3
>Tom Dedman / Kevin Dedman / 2
>Joanne Moore / Helena Harris / 1
>
>How can I generate the variable TwinID? Can anyone help?
>
>Thank you very much.
>
>Maria
>*
>* For searches and help try:
>* http://www.stata.com/help.cgi?search
>* http://www.stata.com/support/statalist/faq
>* http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/