mending missing data holes in the file that results from file matching

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

mending missing data holes in the file that results from file matching

Osatuke, Katerine, VHACIN
Hi experts,
I have 2 files that I matched. File 1 is organized by event, and has 3
variables: a string (name of event), and 2 dates (beginning and end of
each event). Like this:
 
Begin            End        Event
12/01/2002 12/15/2002 fc001  
12/01/2002 01/15/2003 fc002  
12/15/2002 02/01/2003 fc003  
12/15/2002 01/28/2003 fc004  
 
File 2 is organized by ratings of event participants. There are multiple
participants in each event, and multiple ratings for each participant.
Some participants were in 2 or more events, but most participated in one
event only. File 2 has variables indicating which event the participant
was in (=same event names as in file 1), participant's own ID within
this event, participants scores on standard measures administered within
each event by a standard type of rater, plus participant's individual ID
(unique to each participant), and variables describing participants
(e.g. demographics).  File 2 looks like this:
 
Ind_ID   ID_in_Event     Event   RaterType       Measure1
Measure2         Measure3
452      fc002.001               fc002           p1_2            0
0        .
452      fc002.001               fc002           p1_3            0
0        0
452      fc002.001               fc002           p1_4            15
40       15
452      fc002.001               fc002           s1_1            0
5        0
452      fc002.001               fc002           s1_2            .
.        .
452      fc002.001               fc002           s2_1            4
2        2
452      fc002.001               fc002           s2_2            0
-1       0
452      fc002.001               fc002           s2_3            .
.        .
1224     fc003.044               fc003           b1_1            5
5        5
1224     fc003.044               fc003           b2_1            5
25       15
1224     fc003.044               fc003           b3_1            0
3        5
1224     fc003.044               fc003           p1_1            20
20       40
1224     fc003.044               fc003           p1_2            5
5        5
1224     fc003.044               fc003           p1_3            5
6        0
1224     fc003.044               fc003           p2_1            .
.        .
1224     fc003.044               fc003           p2_3            .
.        .
1224     fc003.044               fc003           p2_4            .
.        .
1224     fc003.044               fc003           p2_5            14
15       7
1224     fc003.044               fc003           p2_6            11
12       28
1224     fc003.044               fc003           p3_1            3
1        2
 
I wanted to get the dates for beginning and end of each event (from File
1), into File 2, onto each of its lines. So I matched these two files by
Event. The resulting file has dates only at the first line of each
event, the other lines remain without dates. I want the same dates as on
the first line of each event, to be on each subsequent line of this same
event (till the new event starts). I tried to fill these holes in by
using missing values statements, e.g. If missing(begin)=1  with lag
statements. But  the error message said lag function is not valid in
this context.
 
How can I fill in the missing data? Any other way I should match the
files, or write the syntax?
Your advice would be much appreciated.
Thanks,
Katerine
 
Katerine Osatuke, Ph.D.
Research Fellow
VHA National Center for Organization Development
Suite 230, 11500 Northlake Drive, Cincinnati OH 45249
Phone: (513) 247-2255
Fax: (513) 247-4699
Email: [hidden email]
 
 
 

 
Reply | Threaded
Open this post in threaded view
|

Re: mending missing data holes in the file that results from file matching

Marks, Jim
The basic structure is:

MATCH FILES
  /FILE = FILE2
  /TABLE = FILE1
  BY event.

Both files should be sorted on event or the match will not work. Note
that FILE1 is treated as a TABLE 1 row per event

--jim

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Osatuke, Katerine, VHACIN
Sent: Wednesday, November 15, 2006 11:39 AM
To: [hidden email]
Subject: mending missing data holes in the file that results from file
matching

Hi experts,
I have 2 files that I matched. File 1 is organized by event, and has 3
variables: a string (name of event), and 2 dates (beginning and end of
each event). Like this:

Begin            End        Event
12/01/2002 12/15/2002 fc001
12/01/2002 01/15/2003 fc002
12/15/2002 02/01/2003 fc003
12/15/2002 01/28/2003 fc004

File 2 is organized by ratings of event participants. There are multiple
participants in each event, and multiple ratings for each participant.
Some participants were in 2 or more events, but most participated in one
event only. File 2 has variables indicating which event the participant
was in (=same event names as in file 1), participant's own ID within
this event, participants scores on standard measures administered within
each event by a standard type of rater, plus participant's individual ID
(unique to each participant), and variables describing participants
(e.g. demographics).  File 2 looks like this:

Ind_ID   ID_in_Event     Event   RaterType       Measure1
Measure2         Measure3
452      fc002.001               fc002           p1_2            0
0        .
452      fc002.001               fc002           p1_3            0
0        0
452      fc002.001               fc002           p1_4            15
40       15
452      fc002.001               fc002           s1_1            0
5        0
452      fc002.001               fc002           s1_2            .
.        .
452      fc002.001               fc002           s2_1            4
2        2
452      fc002.001               fc002           s2_2            0
-1       0
452      fc002.001               fc002           s2_3            .
.        .
1224     fc003.044               fc003           b1_1            5
5        5
1224     fc003.044               fc003           b2_1            5
25       15
1224     fc003.044               fc003           b3_1            0
3        5
1224     fc003.044               fc003           p1_1            20
20       40
1224     fc003.044               fc003           p1_2            5
5        5
1224     fc003.044               fc003           p1_3            5
6        0
1224     fc003.044               fc003           p2_1            .
.        .
1224     fc003.044               fc003           p2_3            .
.        .
1224     fc003.044               fc003           p2_4            .
.        .
1224     fc003.044               fc003           p2_5            14
15       7
1224     fc003.044               fc003           p2_6            11
12       28
1224     fc003.044               fc003           p3_1            3
1        2

I wanted to get the dates for beginning and end of each event (from File
1), into File 2, onto each of its lines. So I matched these two files by
Event. The resulting file has dates only at the first line of each
event, the other lines remain without dates. I want the same dates as on
the first line of each event, to be on each subsequent line of this same
event (till the new event starts). I tried to fill these holes in by
using missing values statements, e.g. If missing(begin)=1  with lag
statements. But  the error message said lag function is not valid in
this context.

How can I fill in the missing data? Any other way I should match the
files, or write the syntax?
Your advice would be much appreciated.
Thanks,
Katerine

Katerine Osatuke, Ph.D.
Research Fellow
VHA National Center for Organization Development Suite 230, 11500
Northlake Drive, Cincinnati OH 45249
Phone: (513) 247-2255
Fax: (513) 247-4699
Email: [hidden email]