help dyadid

Title

dyadid -- Create dyads using linked IDs

Syntax

dyadid egoID alterID, gen(index)

Description

dyadid links records in a file using IDs. Where a file
contains records about multiple individuals within groups (e.g., persons
within households), it creates an index variable to create specific
dyads, such as spouse pairs.

egoID is the main ID variable. alterID is the variable
containing the ID of the other element of the dyad (e.g., the spouse).
The values of alterID should be unique (this is not tested: if not
unique the last record will be used). The gen option creates a new
variable that is the case number of the linked record. The index
variable can then be used to create variables with values drawn from the
linked record (see example below).

See ancillary files dyadsim.dta and dyadsim.do.

Author

Brendan Halpin, brendan.halpin@ul.ie

Examples

Using the ancillary file dyadsim.dta:

. use dyadsim

. dyadid id sid, gen(sidx)

. gen spage = age[sidx]

. ttest spage == age if sex==1