Date: Wed, 26 Jan 2005 20:06:50 -0000
Reply-To: "Hetter, Rebecca D,,DMDCWEST" <rebecca.hetter@osd.pentagon.mil>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Hetter, Rebecca D,,DMDCWEST" <rebecca.hetter@osd.pentagon.mil>
Subject: Re: Syntax
Content-Type: text/plain
"Match files" should do it.
* First I would save the original variable .
compute newadm=admins .
sort cases by childid month year.
* The variable "lastadm" will be 1 for the last record with the same
childid.
* Note that it will also be 1 if there is only one record.
match files file=*/last=lastadm/by childid.
if (lastadm eq 1) newadm= 72.
Good luck!
Rebecca D. Hetter
Personnel Testing Division
Defense Manpower Data Center
400 Gigling Road
Seaside CA 93955
(831)583-2400
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Ryan Mulligan
Sent: Wednesday, January 26, 2005 11:14 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Syntax
Dear Group:
I need some more assistance with a syntax. I need the syntax to assign the
number of times that a youth was administered the same survey in
chronicagical order. It needs to assign the last time they were administered
the survey the number 72. For example:
childid Month Year admins
1 3 2004 1
1 4 2004 2
1 5 2004 72
2 1 2005 1
2 2 2005 2
2 3 2005 3
3 4 2005 72
I have with your help came up with:
Sort cases by year(a) month (a) childid (a)
compute admins eq 1.
If childid eq lag(childid) admins eq lag(admins) + 1.
Execute.
This works to assign the admins in correct chronological order, but what it
doesn't do is assign the max admins the value 72. It was once suggested that
aggregate would work, but I have had difficulties matching the max admin
back to the original data set with the rest of the data. Is there an easier
way than aggregate?
Ryan Mulligan
Quality Assurance Evaluation Associate
3801 Harney Street
Omaha, NE 68131
This email is property of Region 6 Behavioral Healthcare. Any information
within this email or attached to this email is considered confidential. This
email is not to be forwarded, copied, or reproduced in any way without the
proper consent of Region 6 Behavioral Healthcare.