FW: Re: [SPSSX-L] Data Management and Multiple Record Same ID Date Computation Problem

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

FW: Re: [SPSSX-L] Data Management and Multiple Record Same ID Date Computation Problem

Ornelas, Fermin
Fermin Ornelas, Ph.D.
Management Analyst III, AZ DES
1789 W. Jefferson Street
Phoenix, AZ 85032
Tel: (602) 542-5639
E-mail: [hidden email]


-----Original Message-----
From: Ornelas, Fermin
Sent: Monday, August 13, 2007 9:27 AM
To: 'Melissa Ives'
Subject: RE: Re: [SPSSX-L] Data Management and Multiple Record Same ID Date Computation Problem

The remedy proposed by H. Vardi helped with the problem. This mainframe version is somewhat outdated that the mode=addvariables statement did not work either. Thus I had to use a match files statement.

DATA LIST FIXED / STUID 1-3  CDATE 5-12 (ADATE) CNUM  18-20
BEGIN DATA
111 09/01/06     357
111 09/01/06     426
111 01/01/07     427
111 01/01/07     595
112 01/01/07     101
112 03/04/07     204
113 03/04/07     101
113 03/04/07     101
115 09/01/06     101
115 03/04/07     357
END DATA.
SORT CASES BY STUID
SAVE OUTFILE=TEMP5
LIST


Fermin Ornelas, Ph.D.
Management Analyst III, AZ DES
1789 W. Jefferson Street
Phoenix, AZ 85032
Tel: (602) 542-5639
E-mail: [hidden email]


-----Original Message-----
From: Melissa Ives [mailto:[hidden email]]
Sent: Monday, August 13, 2007 9:20 AM
To: Ornelas, Fermin
Subject: RE: Re: [SPSSX-L] Data Management and Multiple Record Same ID Date Computation Problem

Not sure, but could it be the version doesn't recognize years in the 2000-2999 range?  Doesn't seem likely since the first one got by.  It also doesn't seem likely that there could be a hidden character before or after the date field in the 2nd case (where it is running into the problem.

I wish you luck figuring this out.

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ornelas, Fermin
Sent: Friday, August 10, 2007 4:40 PM
To: [hidden email]
Subject: Re: [SPSSX-L] Data Management and Multiple Record Same ID Date Computation Problem

I was just playing with this data set just to familiarize myself with spss.
The MF version is 4.1 (please no laughs) and cannot get it to read date formatted as mm/dd/yy any ideas?

DATA LIST LIST/ STUID (F3) CDATE (ADATE8) CNUM(F3).
BEGIN DATA
111 09/01/06     357
111 09/01/06     426
111 01/01/07     427
111 01/01/07     595
112 01/01/07     101
112 03/04/07     204
113 03/04/07     101
113 03/04/07     101
115 09/01/06     101
115 03/04/07     357
END DATA.

>Warning # 1102
>An invalid numeric field has been found.  The result has been set to
>the system-missing value.

COMMAND LINE:    76  CURRENT CASE:       2  CURRENT SPLITFILE GROUP:   1
FIELD CONTENTS: '09/01/06'
RECORD NUMBER:       2  STARTING COLUMN:     5  RECORD LENGTH:    72



Fermin Ornelas, Ph.D.
Management Analyst III, AZ DES
1789 W. Jefferson Street
Phoenix, AZ 85032
Tel: (602) 542-5639
E-mail: [hidden email]


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of hillel vardi
Sent: Friday, August 10, 2007 10:55 AM
To: [hidden email]
Subject: Re: Data Management and Multiple Record Same ID Date Computation Problem

Shalom

The aggregate comant will give you the fist date .
Tere is the code .

Data List list / StuID CourseDate CourseNum( f3 edate8 f3 ) .
Begin Data
  111 09/01/06   357 0 0
  111 09/01/06   426 1 0
  111 01/01/07   427 1 1
  111 01/01/07   595 1 1
  112 01/01/07   101 0 0
  112 03/04/07   204 1 1
  113 03/04/07   101 0 0
  113 03/04/07   101 1 0
  115 09/01/06   101 0 0
  115 03/04/07   357 1 1
end data .
AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=StuID
  /CourseDate_min = MIN(CourseDate).
if       CourseDate  gt  CourseDate_min  Iwant=1.
if       CourseDate eq   CourseDate_min  Iwant=0.
execute .


Hillel Vardi

Björn Türoque wrote:

> Dear List,
>
> I have a student dataset that has one record for each individual
> course enrollment. Each record contains the students unique ID and the
> date the course started (stored in date format). I would like to
> compute whether or not someone has enrolled in a course prior to the
> one they are currently taking. For example if a student has taken a
> course at a previous date I would like to have a new variable set up
> that indicates if this is not their first enrollment.
>
> I have figured out how to get the computer to look at the data and
> label the first course an individual enrolls in, but I run into a
> problem with students who enroll in multiple courses simultaniously. I
> would like the data to reflect both of the first courses with the same
> start date are the first course the student enrolls in, instead of as a previous course.
>
> I have included data below, the variables Ihave reflects what I have
> been able to compute, and the variable Iwant is what I would ideally like to get.
>
> Any help would be greatly appreciated
>
> Data List Free / StuID CourseDate CourseNum Ihave Iwant Begin Data
>   111 09/01/06   357 0 0
>   111 09/01/06   426 1 0
>   111 01/01/07   427 1 1
>   111 01/01/07   595 1 1
>   112 01/01/07   101 0 0
>   112 03/04/07   204 1 1
>   113 03/04/07   101 0 0
>   113 03/04/07   101 1 0
>   115 09/01/06   101 0 0
>   115 03/04/07   357 1 1
>
>

NOTICE: This e-mail (and any attachments) may contain PRIVILEGED OR CONFIDENTIAL information and is intended only for the use of the specific individual(s) to whom it is addressed.  It may contain information that is privileged and confidential under state and federal law.  This information may be used or disclosed only in accordance with law, and you may be subject to penalties under law for improper use or further disclosure of the information in this e-mail and its attachments. If you have received this e-mail in error, please immediately notify the person named above by reply e-mail, and then delete the original e-mail.  Thank you.


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: Data Management and Multiple Record Same ID

Richard Ristow
This is a side note on the main question.

At 12:29 PM 8/13/2007, Ornelas, Fermin wrote (or, repeated):

>Sent: Friday, August 10, 2007 4:40 PM
>To: [hidden email]
>Subject: Re: [SPSSX-L] Data Management and Multiple Record Same ID
>Date Computation Problem
>
>I was just playing with this data set just to familiarize myself with
>spss.
>The MF version is 4.1 (please no laughs) and cannot get it to read
>date formatted as mm/dd/yy any ideas?
>
>DATA LIST LIST/ STUID (F3) CDATE (ADATE8) CNUM(F3).
>BEGIN DATA
>111 09/01/06     357
>111 09/01/06     426
>111 01/01/07     427
>111 01/01/07     595
>112 01/01/07     101
>112 03/04/07     204
>113 03/04/07     101
>113 03/04/07     101
>115 09/01/06     101
>115 03/04/07     357
>END DATA.
>
>>Warning # 1102
>>An invalid numeric field has been found.  The result has been set to
>>the system-missing value.
>
>COMMAND LINE:    76  CURRENT CASE:       2  CURRENT SPLITFILE
>GROUP:   1
>FIELD CONTENTS: '09/01/06'
>RECORD NUMBER:       2  STARTING COLUMN:     5  RECORD LENGTH:    72

To start with, SPSS release numbers are maddening. There were 9
releases of SPSS for the mainframe. Then the 10th was a major rewrite
(adding MATCH FILES, etc.), and instead of being called SPSS release
10, it was called SPSSX release 1. (Apple did the same thing years
later - Mac OS release 10 became the major rewrite, OSX.)

I'll guess you're using SPSSX release 4. (The earlier 'release 4' was
obsolete by 1975.)

I don't know when the current SPSS date representation ("the number of
seconds from midnight, October 14, 1582") was introduced, with the
formats and functions to work with it, but they weren't there in SPSSX
release 2. If they aren't in SPSSX release 4, that explains why you
can't read the date; check your documentation. (Unfortunately, it
doesn't explain why SPSS didn't flag "ADATE8" as a syntax error.)

There are always work-arounds. For your purpose, the most natural would
be to read "CDATE" as a string variable; separate it into month, day
and year using string functions; and convert it into an old-format SPSS
date using function "YRMODA". I don't claim it's wonderful, but it
should work.
Reply | Threaded
Open this post in threaded view
|

Re: Data Management and Multiple Record Same ID

Ornelas, Fermin
I see your point. We actually use separate numeric fields for day,
month, and year and use the yrmoda function to calculate variables such
as age and duration of enrollees in each program. But I wanted to see
what can and cannot be done under this SPSS version. I have yet to see
any documentation on this version of SPSS.

Thanks for the heads up...

Fermin Ornelas, Ph.D.
Management Analyst III, AZ DES
1789 W. Jefferson Street
Phoenix, AZ 85032
Tel: (602) 542-5639
E-mail: [hidden email]


-----Original Message-----
From: Richard Ristow [mailto:[hidden email]]
Sent: Monday, August 13, 2007 11:54 AM
To: Ornelas, Fermin; [hidden email]
Subject: Re: Data Management and Multiple Record Same ID

This is a side note on the main question.

At 12:29 PM 8/13/2007, Ornelas, Fermin wrote (or, repeated):

>Sent: Friday, August 10, 2007 4:40 PM
>To: [hidden email]
>Subject: Re: [SPSSX-L] Data Management and Multiple Record Same ID
>Date Computation Problem
>
>I was just playing with this data set just to familiarize myself with
>spss.
>The MF version is 4.1 (please no laughs) and cannot get it to read
>date formatted as mm/dd/yy any ideas?
>
>DATA LIST LIST/ STUID (F3) CDATE (ADATE8) CNUM(F3).
>BEGIN DATA
>111 09/01/06     357
>111 09/01/06     426
>111 01/01/07     427
>111 01/01/07     595
>112 01/01/07     101
>112 03/04/07     204
>113 03/04/07     101
>113 03/04/07     101
>115 09/01/06     101
>115 03/04/07     357
>END DATA.
>
>>Warning # 1102
>>An invalid numeric field has been found.  The result has been set to
>>the system-missing value.
>
>COMMAND LINE:    76  CURRENT CASE:       2  CURRENT SPLITFILE
>GROUP:   1
>FIELD CONTENTS: '09/01/06'
>RECORD NUMBER:       2  STARTING COLUMN:     5  RECORD LENGTH:    72

To start with, SPSS release numbers are maddening. There were 9
releases of SPSS for the mainframe. Then the 10th was a major rewrite
(adding MATCH FILES, etc.), and instead of being called SPSS release
10, it was called SPSSX release 1. (Apple did the same thing years
later - Mac OS release 10 became the major rewrite, OSX.)

I'll guess you're using SPSSX release 4. (The earlier 'release 4' was
obsolete by 1975.)

I don't know when the current SPSS date representation ("the number of
seconds from midnight, October 14, 1582") was introduced, with the
formats and functions to work with it, but they weren't there in SPSSX
release 2. If they aren't in SPSSX release 4, that explains why you
can't read the date; check your documentation. (Unfortunately, it
doesn't explain why SPSS didn't flag "ADATE8" as a syntax error.)

There are always work-arounds. For your purpose, the most natural would
be to read "CDATE" as a string variable; separate it into month, day
and year using string functions; and convert it into an old-format SPSS
date using function "YRMODA". I don't claim it's wonderful, but it
should work.

NOTICE: This e-mail (and any attachments) may contain PRIVILEGED OR
CONFIDENTIAL information and is intended only for the use of the
specific individual(s) to whom it is addressed.  It may contain
information that is privileged and confidential under state and federal
law.  This information may be used or disclosed only in accordance with
law, and you may be subject to penalties under law for improper use or
further disclosure of the information in this e-mail and its
attachments. If you have received this e-mail in error, please
immediately notify the person named above by reply e-mail, and then
delete the original e-mail.  Thank you.