BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello

I am looking for help to be able to create a group-id number
I have the following information for the persons in my dataset:

- Person identification number
- Father identification number (i.e. ID-number for the father of each of the persons in my dataset)
- Mother Identification number (i.e. (i.e. ID-number for the mother of each of the persons in my dataset)

I would like to make a group-id for each sibling-pair in my dataset (for both half and full siblings). Some of the persons in my dataset will have more than one sibling, but I wish all of the siblings to be included as pairs.

Does anyone know how to do this?

Thank you!
3 REPLIES 3
Patrick
Opal | Level 21
Hi

Does a sibling have both parents in common or is one parent (i.e. same father) enough?

If it's both parents then creating a group id is easy: Just sort by father_id and mother_id and generate a group_id for all records sharing the same mother_id (using first and last and a retained variable group_id).

If "half" siblings are also siblings then the story becomes more complicated and a simple group_id is no more possible (as A can be sibling of B, and B sibling of C, but A and C are not related).

With "half" siblings you'll end up with a network and one would have to create an association table. The way you would create a datamart (having all information in one table) depends then on what you want to do with the data ("multiple records" for one child or a "relationship array").

HTH
Patrick
deleted_user
Not applicable
Hi,

Thank you for your response! Very helpful to know what the next step is.
I will start wokring on the association table.
Patrick
Opal | Level 21
Hi Grethe

The association table is for storing and maintaining the data. For reporting purposes you might be better off to create a data mart shaped to the kind of reports you intend to create.

If - and only if - you don't have too many data then the reporting datamart(s) could also be implemented as views which query the underlying tables using an association table.

The data model with the association table could look as follows:

PERSON{PersonID,...variables containing attributs of this person}
RELATIONSHIP{PersonID,RelatedPersonID,RelationshipID,...additional attributes}
RELATIONSHIP_TYPE{RelationshipID,RelationshipDescription}

PERSON has a 1 to zero or many relation to RELATIONSHIP

RELATIONSHIP_TYPE is only a lookup table for RELATIONSHIP with a few records and values for RelationshipDescription like "Father", "Mother", "Sibling", "Aunt".... and so on.

HTH
Patrick Message was edited by: Patrick

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1158 views
  • 0 likes
  • 2 in conversation