Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating variables from a matched pair


From   "Kopsic, Jessica" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: Creating variables from a matched pair
Date   Mon, 8 Oct 2012 18:15:57 +0000

Hello, 

I have a dataset with matched pairs, and I'd like to create a dataset where each person's partner's observations are variables.  So like this:
Partner A: DOB Partner A, DOB Partner B, Sex Partner A, Sex Partner B  

Currently everything is in this format:
Partner A: DOB Partner A, Sex Partner A
Partner B: DOB Partner B, Sex Partner B

The ID numbers are structured like this:
1A01
1B01
1A02
1B02
2A01
2B01
2A02
2B02
The numbers at the beginning are rounds. Then partner A or B. Then numbers that match the pair together. The number sets got reused for each round so numbers may or may not be unique throughout the whole dataset, but they are restricted to one set of partners for each round. (So IDs are unique throughout the whole dataset.)

This dataset will be used in other programs, so I'd like to create the dataset up front rather than match during analyses. I'm flummoxed by this one and came up empty searching archives. Thank you. 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index