Bookmark and Share

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

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

st: Creating variables from a matched pair

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


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:
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:

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