flagging unequal multiple births

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

flagging unequal multiple births

Khaleel Hussaini
Hello listers,
      While typically I don't encounter a lot of these in my dataset, I was wondering if anyone has encountered a problem like the one below...If yes what is the most efficient way to flag these cases. Let's take an example of this small dataset that may contain IDs (respondent), Birth type (whether it is singleton, twin, triplet) and facility. The N in this case is 7.

ID    Birth type      Facility   L_Name    
1           1                a        Holmes
2           1                a        Carbajo
3           1                a        Hamid
4           2                a        Bernstein
5           2                a        Bernstein
6           2                a        Batliboi
7           1                a        Carbales

This is frequency table for facility
                             Frequency            
  1.00 SIngleton             4                       
  2.00 Twin                    3                        
                         Total    7                         

Now looking at frequency table we find that there cannot be an odd number of twins. What is the most efficient way to flag these cases. Best,


Reply | Threaded
Open this post in threaded view
|

Re: flagging unequal multiple births

ariel barak

Hi Khaleel,

If I understand your issue correctly, you're looking to identify situations where the sum of the number of times you see the last name at a given facility is different than the Birth Type. For example, if you only see the last name once, BirthType must be 1, etc.
The syntax below flags ID 6, Batliboi, for being labeled as a twin when there is only one Batilboi. I assume that you have a birthdate variable which should also be added into the BREAK subcommand of the AGGREGATE command, SORT CASES command, and the MATCH FILES command.

Take it easy,
Ariel Barak

DATA LIST LIST /ID (F8) BirthType (F8) Facility (A2) L_Name (A25).
BEGIN DATA
1 1 a Holmes
2 1 a Carbajo
3 1 a Hamid
4 2 a Bernstein
5 2 a Bernstein
6 2 a Batliboi
7 1 a Carbales
END DATA.

DATASET NAME OrignalData.

DATASET DECLARE BirthonLastName.
AGGREGATE
  /OUTFILE='BirthonLastName'
  /BREAK=Facility L_Name
  /BirthsonLastName=N.

SORT CASES BY Facility L_Name.

MATCH FILES /FILE=*
  /TABLE='BirthonLastName'
  /BY  Facility L_Name.
EXECUTE.

COMPUTE BirthTypeIssue=0.
IF BirthType<>BirthsonLastName BirthTypeIssue=1.
EXE.

FREQ BirthTypeIssue.

SORT CASES BY ID.

On Wed, May 20, 2009 at 6:53 PM, Khaleel Hussaini <[hidden email]> wrote:
Hello listers,
      While typically I don't encounter a lot of these in my dataset, I was wondering if anyone has encountered a problem like the one below...If yes what is the most efficient way to flag these cases. Let's take an example of this small dataset that may contain IDs (respondent), Birth type (whether it is singleton, twin, triplet) and facility. The N in this case is 7.

ID    Birth type      Facility   L_Name    
1           1                a        Holmes
2           1                a        Carbajo
3           1                a        Hamid
4           2                a        Bernstein
5           2                a        Bernstein
6           2                a        Batliboi
7           1                a        Carbales

This is frequency table for facility
                             Frequency            
  1.00 SIngleton             4                       
  2.00 Twin                    3                        
                         Total    7                         

Now looking at frequency table we find that there cannot be an odd number of twins. What is the most efficient way to flag these cases. Best,