Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enter age in year and month in SPSS

842 views
Skip to first unread message

sarah.eli...@gmail.com

unread,
Apr 30, 2017, 4:07:50 PM4/30/17
to
Hello. Is is possible to enter a person's chronological age into SPSS using year, month, and day? I am entering data about children. For example, let's say I have a child who was 12 years, 3 months, and 2 days at the time of my study. How do I enter that into SPSS? Do I have to convert the age into months? I'm using SPSS version 24.

Rich Ulrich

unread,
May 1, 2017, 12:13:39 AM5/1/17
to
On Sun, 30 Apr 2017 13:07:49 -0700 (PDT),
sarah.eli...@gmail.com wrote:

>Hello. Is is possible to enter a person's chronological age into SPSS using year, month, and day? I am entering data about children. For example, let's say I have a child who was 12 years, 3 months, and 2 days at the time of my study. How do I enter that into SPSS? Do I have to convert the age into months? I'm using SPSS version 24.

Look up the Date functions and formats.
The easy way to describe:

Each record should have the date for "today" and for subject's birth.

Use a function to convert today's Year-mo-day to an SPSS date.
Use the same function, ditto, for the Birth Year-mo-day.

Use the available function to obtain the difference in Months or days,
whichever you prefer.

--
Rich Ulrich

antranig....@mesrobian.org

unread,
Apr 30, 2019, 11:22:37 PM4/30/19
to
On Sunday, April 30, 2017 at 1:07:50 PM UTC-7, Sarah Fro wrote:
> Hello. Is is possible to enter a person's chronological age into SPSS using year, month, and day? I am entering data about children. For example, let's say I have a child who was 12 years, 3 months, and 2 days at the time of my study. How do I enter that into SPSS? Do I have to convert the age into months? I'm using SPSS version 24.

i have to convert age in number of complete years plus complete months to a single number to Spss ? I am entering data about children. For example, let's say I have a child who was 12 years, 3 months, at the time of my study. How do I enter that into SPSS? Do I have to convert the age into months? I'm using SPSS version 24.

Bruce Weaver

unread,
May 1, 2019, 9:01:57 AM5/1/19
to
Perhaps something like this will do the trick.

* Generate a small data set to illustrate.
NEW FILE.
DATASET CLOSE ALL.
DATA LIST LIST / ID years months (3F5.0).
BEGIN DATA
1 12 3
2 11 10
3 12 0
END DATA.

COMPUTE AgeMos = years*12 + months.
COMPUTE AgeYrs = AgeMos/12.
FORMATS AgeMos(F5.0).
VARIABLE LABELS
AgeMos "Age in months"
AgeYrs "Age in years"
.
LIST.

If all subjects are children, age in months might be preferable. But that's up to you.

HTH.
0 new messages