selection on 7 days till 8 months

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

selection on 7 days till 8 months

Leo Bakker
Hello everyone,


can anyone help me to make a syntax to select a group of children of 7
days - 8  months, given their date of birth (dd-mmm-yyyy).

thanks
Leo Bakker
Reply | Threaded
Open this post in threaded view
|

Re: selection on 7 days till 8 months

Maguin, Eugene
Leo,

Could it be that you want to identify or select a group of children who are
exactly 8 months and 7 days old as of a specific day and you know all the
children's birthday?

Let's say that that's what you want to do.

*  let dob be the birthday; let today be the specific day of interest.
*  also assume that the pool of children to be selected from are less than
on year old.
Compute monthtoday=xdate.month(today).
Compute jdaytoday=xdate.jday(today).
Compute monthdob=xdate.month(dob).
Compute jdaydob=xdate.jday(dob).
If (monthtoday le monthdob) monthtoday=monthtoday+12.
Compute pick=0.
If (monthtoday-monthdob eq 8 and jdaytoday-jdaydob eq 7) pick=1.



Gene Maguin
Reply | Threaded
Open this post in threaded view
|

Re: selection on 7 days till 8 months

Melissa Ives
In reply to this post by Leo Bakker
It seems you want to select the child if they are between 7 days and 8
months.
It seems to me that the simplest way would be to compute the age in days
and age in months based on the 'current date' which I set to today
date.mdy(9,21,2007), but could be any date value as a variable or hard
coded date.
Then create a dichotomy to identify those who are within the right age
range.

Compute ageindys=datediff(date.mdy(9,21,2007),dob,"days").
Compute ageinmos=datediff(date.mdy(9,21,2007),dob,"months").
compute age7d8m=(ageindys ge 7 and ageinmos le 8).
freq age7d8m.

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Leo Bakker
Sent: Friday, September 21, 2007 1:55 AM
To: [hidden email]
Subject: [SPSSX-L] selection on 7 days till 8 months

Hello everyone,


can anyone help me to make a syntax to select a group of children of 7
days - 8  months, given their date of birth (dd-mmm-yyyy).

thanks
Leo Bakker


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.