Age Sample Code

Note: This page is from an older version of the Data Dictionary and may therefore contain information that is now out of date. It is included here for reference only.


1 The following SPSS code is provided to illustrate the Age data definition

L_AGE

2 The following SPSS code illustrates how to derive L_AGE.

/* SPSS Code to calculate the learner’s age as at 31 AUGUST relevant academic year.
/*relevant academic year is the start year of the academic year relevant to the standard file
DO IF (NOT SYSMIS (L11)).
 DO IF ( XDATE.MONTH(L11) LE 8).
  COMPUTE L_AGE=RELEVANT ACADEMIC YEAR - XDATE.YEAR(L11).
 ELSE.
  COMPUTE L_AGE=(RELEVANT ACADEMIC YEAR - 1)-XDATE.YEAR(L11).
 END IF.
END IF.

L_AGEB

3 The following SPSS code illustrates how to derive L_AGEB.

RECODE L_AGE (SYSMIS=9) (0 thru 15=1) (16 thru 18=2) (19 thru 20=3) (21 thru 24=4)
(25 thru 59=5) (60 thru 120=6) (else=9) into L_AGEB.

VARIABLE LABELS L_AGE 'DV - Age of the learner as at 31 August relevant academic year'
 /L_AGEB 'DV - Age of the learner as at 31 August relevant academic year banded'.

VALUE LABELS L_AGEB
 1 'Under 16'
 2 '16-18'
 3 '19-20'
 4 '21-24'
 5 '25-59'
 6 '60 and over'
 9 'missing age'.

A_AGEST

4 The following SPSS code illustrates how to derive A_AGEST.

/* SPSS Code to calculate learner’s age as at the start of the aim.
/* The calculation first looks at if the month of the learners birth is before the month of the start date, or if month of birth equals
/* the month of start, and the learner’s day of birth is before or equal to the day of the start date,
/* then age is equal to the year of the start minus the year of birth.
/* Otherwise, age is equal to the year of the start minus the year of birth minus one.

COMPUTE A_AGEST =-9.
DO IF NOT SYSMIS (L11) AND NOT SYSMIS (A27).
 DO IF ( XDATE.MONTH(L11) LT XDATE.MONTH(A27)).
  COMPUTE A_AGEST=XDATE.YEAR(A27) - XDATE.YEAR(L11).
 ELSE IF ((XDATE.MDAY(L11) LE XDATE.MDAY(A27)) AND (XDATE.MONTH(L11) = XDATE.MONTH(A27))).
  COMPUTE A_AGEST=XDATE.YEAR(A27) - XDATE.YEAR(L11).
 ELSE.
  COMPUTE A_AGEST=(XDATE.YEAR(A27) -1) - XDATE.YEAR(L11).
 END IF.
END IF.

A_AGESTB

5 The following SPSS code illustrates how to derive A_AGESTB.

RECODE A_AGEST (SYSMIS=9) (0 thru 15=1) (16 thru 18=2) (19 thru 20=3) (21 thru 24=4) (25 thru 59=5) (60 thru 120=6) (else=9) into A_AGESTB.

VARIABLE LABELS A_AGEST 'DV - Age of the learner as at the start date of aim'
 /A_AGESTB 'DV - Age of the learner as at the start date of aim banded'.

VALUE LABELS A_AGESTB
 1 'Under 16'
 2 '16-18'
 3 '19-20'
 4 '21-24'
 5 '25-59'
 6 '60 and over'
 9 'missing age'.

Creator

Analysis and MI Team

Date issued

25 January 2005

Date created

8 December 2005

Document ref.

\\records.lsc.local\NAT\23 LrngSkillsPolicyInfrastr\23-07 DataCollectAlysis\23-07-03 LrnrDataAlysisDiss\nat-agesamplecode-report-25jan2005.doc

LSC office

Learning and Skills Council
Cheylesmore House Quinton Road Coventry CV1 2WT
T 0845 019 4170 F 024 7682 3675 www.lsc.gov.uk/

Last Modified: 26 Jan 06