SPSS calculates the age and groups based on the birthday.

Source: Internet
Author: User
Tags recode

Compute age = datediff ($ time, birthdate, "years ").
Execute.
Save OUTFILE = 'd: \ marykay \ data \ PRD \ consultantinfoprd. Sav'
/Compressed.
Save OUTFILE = 'd: \ marykay \ data \ PRD \ consultantinfoprd. Sav'
/Compressed.
String agegroup1 (A8 ).
Recode age (19 thru 24 = '19 ~ 24') (25 thru 29 = '25 ~ 29') (30 thru 34 = '30 ~ 34 ') (35 thru 39 = '35 ~ 39 ') (40 thru 44 = '40 ~ 44') (45 thru
49 = '45 ~ 49 ') (50 thru 54 = '50 ~ 54 ') (55 thru 59 = '55 ~ 59') (else = '60 or above ') into agegroup1.
Execute.
String agegroup2 (A8 ).
Recode age (19 thru 29 = '19 ~ 29') (30 thru 39 = '30 ~ 39 ') (40 thru 49 = '40 ~ 49 ') (50 thru 59 = '50 ~ 59') (else = '60 or above ') into agegroup2.
Execute.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.