Termly Attendance 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 Termly Attendance data definition.

TOTPDEXP, PRD_EXP, TEMPEXP, TOTPDACT, PRD_ACT, and TEMPACT

2 The following SPSS code illustrates how to derive TOTPDEXP, PRD_EXP, TEMPEXP, TOTPDACT, PRD_ACT, and TEMPACT.

/* This is the start of the code for calculating actual and expected cyglh.
GET FILE ‘……….AIMS data set’.

/* Initially create two temporary variables that are based on the expected and actual end date, and set any missing values in A34 to 0.
RECODE A28 (SYSMIS=0) (ELSE=COPY) INTO TEMPEXP.
RECODE A31(SYSMIS=0) (ELSE=COPY) INTO TEMPACT.
RECODE A34 (SYSMIS=0) (ELSE=COPY).

/* Where the aim has been completed, but there is no planned end date, then the actual end date is used in the calculation instead of the planned end date, likewise if the aim has been completed and there is no actual end date, the planned end date is used for the actual end date.
IF (TEMPEXP=0 AND A34=2) TEMPEXP=TEMPACT.
IF (TEMPACT=0 AND A34=2) TEMPACT=TEMPEXP.

/* Total Terms the aim was active over the life of the aims
/* The total terms is the number of terms an aim has actually crossed or was expected to cross in the previous and next 5 years.
/* An aim is said to have crossed a term when the start date is before the census date, and the end date (planned or actual) is after the census date of that year.
COMPUTE TOTPDEXP=0.
COMPUTE TOTPDACT=0.
DO REPEAT ii=-5 TO 5.
 IF (A27<=DATE.DMY(1,2,current year+1+ii)
AND TEMPEXP>=DATE.DMY(1,2,current year+1+ii)) TOTPDEXP=TOTPDEXP + 1.
 IF (A27<=DATE.DMY(1,2,current year+1+ii)
AND TEMPACT>=DATE.DMY(1,2,current year+1+ii)) TOTPDACT=TOTPDACT + 1.
 IF (A27<=DATE.DMY(15,5,current year+1+ii)
AND TEMPEXP>=DATE.DMY(15,5,current year+1+ii)) TOTPDEXP=TOTPDEXP + 1.
 IF (A27<=DATE.DMY(15,5,current year+1+ii)
AND TEMPACT>=DATE.DMY(15,5,current year+1+ii)) TOTPDACT=TOTPDACT + 1.
 IF (A27<=DATE.DMY(1,10,current year+ii)
AND TEMPEXP>=DATE.DMY(1,10,current year+ii)) TOTPDEXP=TOTPDEXP + 1.
 IF (A27<=DATE.DMY(1,10,current year+ii)
AND TEMPACT>=DATE.DMY(1,10,current year+ii)) TOTPDACT=TOTPDACT + 1.
END REPEAT.

/* If the aims has not been completed and there is no planned end date then just the start date is used to determine the number of terms, except that this time we just look at this year and the previous 5 years, rather than looking at the next 5 years.
/* This cut off is used as no aim should last more than 5 years.
/* If we were to look at the next 5 years, then they would always get plus 15 terms, as there is no planned end date to cut off the calculations.


DO IF (TEMPEXP=0).
 DO REPEAT ii=-5 TO 0.
  IF (A27<=DATE.DMY (1,2,current year+1+ii)) TOTPDEXP=TOTPDEXP + 1.
  IF (A27<=DATE.DMY (15,5,current year+1+ii)) TOTPDEXP=TOTPDEXP +1.
  IF (A27<=DATE.DMY (1,10,current year+ii)) TOTPDEXP=TOTPDEXP + 1.
 END REPEAT.
END IF.

/* There may be some aims which do not cross a census date as they are short courses, for example if a course started on 1st December and finished on the 15th January then this aim would not be allocated a term.
/* To ensure that they are included in future calculations they are allocated 1 term if their total is zero.
/* This is also the case for aim where the learner has withdrawn from an aim, or transferred to another aim, without crossing a census date, and is the same for both actual and expected terms.

DO IF ANY(A34,1,2,5) OR (ANY(A34,3,4) AND A31>=DATE.DMY(1,10,current year)).
 IF (TOTPDEXP=0) TOTPDEXP=1.
END IF.

/* In situations where there is no actual end date and there is no planned end date, or the planned end date is in the current academic year, then the actual terms are used as the expected terms.
/* Again if there is no actual end date, but the planned end date was before the start of the academic year, then in order to ensure that they have some actual terms for the current year, then the actual terms are assigned as below.
/* If expected terms=1 then actual terms=expected terms plus 1.
/* If expected terms=2 then actual terms=expected terms plus 2.
/* If expected terms greater or equal to 3 then actual terms=expected terms plus 3.

DO IF (TEMPACT=0).
 DO IF TEMPEXP=0 OR TEMPEXP>=DATE.DMY(1,8,current year).
  COMPUTE TOTPDACT=TOTPDEXP.
 ELSE.
  IF (TOTPDEXP=1) TOTPDACT=TOTPDEXP + 1.
  IF (TOTPDEXP=2) TOTPDACT=TOTPDEXP + 2.
  IF (TOTPDEXP>=3) TOTPDACT=TOTPDEXP + 3.
 END IF.
END IF.
DO IF ANY(A34,1,2,5) OR (ANY(A34,3,4) AND A31>=DATE.DMY(1,10,current year)).
 IF (TOTPDACT=0) TOTPDACT=1.
END IF.

/* Expected terms in current academic year
/* There are three planned term variables.
COMPUTE EXPER1=0.
COMPUTE EXPER2=0.
COMPUTE EXPER3=0.

/* If the start and planned end date cross the first census date then assign a value of 1 to the first expected term variable, likewise if they cross the second census date assign a value of 1 to the second expected term variable and the same for the third.
IF (A27<=DATE.DMY(1,10,current year) AND TEMPEXP>=DATE.DMY(1,10,current year)) EXPER1=EXPER1+1.
IF (A27<=DATE.DMY(1,2,current year+1) AND TEMPEXP>=DATE.DMY(1,2,current year+1)) EXPER2=EXPER2+1.
IF (A27<=DATE.DMY(15,5,current year+1) AND TEMPEXP>=DATE.DMY(15,5,current year+1)) EXPER3=EXPER3+1.

/* If the aims had no planned end date, and they have yet to complete the aim then the start date is used to determine how many term the aim is active in, if the start date is on or before the 1st October census date then the first expected term variable is assigned a value of 1, if the start date is before the 1st February then the second expected term variable is assigned a value 1.
/* Note that for start dates that are between 1st October and 1st February would have a value of 1 for EXPER2, but 0 for EXPER1, i.e.
/* a start date of 1st November would not be before 1st October, but would be before 1st February.
/* If a start date is before 15th May then the third expected term variable is assigned a value 1.
DO IF (TEMPEXP=0).
 IF (A27<=DATE.DMY (1,10,current year)) EXPER1=EXPER1 + 1.
 IF (A27<=DATE.DMY (1,2,current year+1)) EXPER2=EXPER2 + 1.
 IF (A27<=DATE.DMY (15,5,current year+1)) EXPER3=EXPER3 + 1.
ELSE.

/* If the aim is not withdrawn and the aim hasn’t crossed a census date then
/* If the start date is before the 1st October and after the 15th May and the planned end date is after the 1st August, but before the 1st October then a value of 1 is assigned to the first expected term variable.
/* If the start date is before the 1st October and the planned end date is after the 1st October, but before the 1st January then a value of 1 is assigned to the first expected term variable.
/* If the start date is after the 1st October and the planned end date is after or on the 1st January, but before the 1st May then a value of 1 is assigned to the second expected term variable.
/* If the start date is after the 1st February and the planned end date is after the 1st February, but before the 1st May then a value of 1 is assigned to the second expected term variable.
/* If the start date is after the 1st February and the planned end date is after the 1st May, but before the 15th May then a value of 1 is assigned to the third expected term variable.
/* If the start date is after the 15th May and before or on the 31st July and the planned end date is before or on the 31st July then a value of 1 is assigned to the third expected term variable.

DO IF (A34<>3).
 IF (A27<DATE.DMY(1,10,current year) AND A27>DATE.DMY(15,5,current year) AND TEMPEXP>=DATE.DMY(1,8,current year) AND TEMPEXP<DATE.DMY(1,10,current year)) EXPER1=1.
 IF (A27>DATE.DMY(1,10,current year) AND TEMPEXP<DATE.DMY(1,1,current year+1) AND TEMPEXP>DATE.DMY(1,10,current year)) EXPER1=1.
 IF (A27>DATE.DMY(1,10,current year) AND TEMPEXP<DATE.DMY(1,2,current year+1) AND TEMPEXP>=DATE.DMY(1,1,current year+1)) EXPER2=1.
 IF (A27>DATE.DMY(1,2,current year+1) AND TEMPEXP<DATE.DMY(1,5,current year+1) AND TEMPEXP>DATE.DMY(1,2,current year+1)) EXPER2=1.
 IF (A27>DATE.DMY(1,2,current year+1) AND TEMPEXP<DATE.DMY(15,5,current year+1) AND TEMPEXP>=DATE.DMY(1,5,current year+1)) EXPER3=1.
 IF (A27>DATE.DMY(15,5,current year+1) AND A27<=DATE.DMY(31,7,current year+1) AND TEMPEXP<=DATE.DMY(31,7,current year+1)) EXPER3=1.
ELSE.

/* If they have withdrawn and were there on a census date, but not expected to be there, then
/* If the start date is before the 1st October and after the 15th May and the planned end date is on or after the 1st August, but before the 1st October then a value of 1 is assigned to the first expected term variable.
/* If the start date is after the 1st October and the planned end date is after the 1st October, but before the 1st February and the actual end date is after the 1st February then a value of 1 is assigned to the second expected term variable.
/* If the start date is after the 1st February and the planned end date is after the 1st February, but before the 15th May and the actual end date is after the 15th May then a value of 1 is assigned to the third expected term variable.

  IF (A27<DATE.DMY(1,10,current year) AND A27>DATE.DMY(15,5,current year) AND TEMPEXP>=DATE.DMY(1,8,current year) AND TEMPEXP<DATE.DMY(1,10,current year) AND TEMPACT>=DATE.DMY(1,10,current year)) EXPER1=1.
  IF (A27>DATE.DMY(1,10,current year) AND TEMPEXP<DATE.DMY(1,2,current year+1) AND TEMPEXP>DATE.DMY(1,10,current year) AND TEMPACT>=DATE.DMY(1,2,current year+1)) EXPER2=1.
  IF (A27>DATE.DMY(1,2,current year+1) AND TEMPEXP<DATE.DMY(15,5,current year+1) AND TEMPEXP>DATE.DMY(1,2,current year+1) AND TEMPACT>=DATE.DMY(15,5,current year+1)) EXPER3=1.
 END IF.
END IF.

/* Actual terms in current academic year
/* There are three actual term variables.

COMPUTE ACTPER1=0.
COMPUTE ACTPER2=0.
COMPUTE ACTPER3=0.

/* If the start and actual end date cross the first census date then a value of 1 is assigned to the first actual term variable, likewise if they cross the second census date a value of 1 is then assigned to the second actual term variable and the same for the third.
IF (A27<=DATE.DMY(1,10,current year) AND TEMPACT>=DATE.DMY(1,10,current year)) ACTPER1=1.
IF (A27<=DATE.DMY(1,2,current year+1) AND TEMPACT>=DATE.DMY(1,2,current year+1)) ACTPER2=1.
IF (A27<=DATE.DMY(15,5,current year+1) AND TEMPACT>=DATE.DMY(15,5,current year+1)) ACTPER3=1.

/* If the aim has an actual end date, and was not a withdrawal, but did not cross a census point, then the 3 actual term variables are assigned a value under these conditions
/* If the start date is before the 1st October and after the 15th May and the actual end date is after the 1st August, but before the 1st October then a value of 1 is assigned to the first actual term variable.
/* If the start date is before the 1st October and the actual end date is before the 1st January then a value of 1 is assigned to the first actual term variable.
/* If the start date is after the 1st October and the actual end date is after or on the 1st January, but before the 1st February then a value of 1 is assigned to the second actual term variable.
/* If the start date is after the 1st February and the actual end date is before the 1st May then a value of 1 is assigned to the second actual term variable.
/* If the start date is after the 1st February and the actual end date is before the 15th May then a value of 1 is assigned to the third actual term variable.
/* If the start date is after the 15th May and the actual end date is before or on the 31st July then a value of 1 is assigned to the third actual term variable.
DO IF (TEMPACT NE 0 AND A34 NE 3).
 IF (A27<DATE.DMY(1,10,current year) AND A27>DATE.DMY(15,5,current year) AND TEMPACT>=DATE.DMY(1,8,current year) AND TEMPACT<DATE.DMY(1,10,current year)) ACTPER1=1.
 IF (A27>DATE.DMY(1,10,current year) AND TEMPACT<DATE.DMY(1,1,current year+1)) ACTPER1=1.
 IF (A27>DATE.DMY(1,10,current year) AND TEMPACT<DATE.DMY(1,2,current year+1) AND TEMPACT>=DATE.DMY(1,1,current year+1)) ACTPER2=1.
 IF (A27>DATE.DMY(1,2,current year+1) AND TEMPACT<DATE.DMY(1,5,current year+1)) ACTPER2=1.
 IF (A27>DATE.DMY(1,2,current year+1) AND TEMPACT<DATE.DMY(15,5,current year+1) AND TEMPACT>=DATE.DMY(1,5,current year+1)) ACTPER3=1.
 IF (A27>DATE.DMY(15,5,current year+1) AND TEMPACT<=DATE.DMY(31,7,current year+1)) ACTPER3=1.
END IF.

/* If there is no actual end date and there is either no planned end date, or the planned end date is on or after the 1st August of the current academic year, then the actual term variables are set to the values in the expected terms variables.
DO IF TEMPACT=0 AND (TEMPEXP>=DATE.DMY(1,8,current year) OR TEMPEXP=0).
 COMPUTE ACTPER1=EXPER1.
 COMPUTE ACTPER2=EXPER2.
 COMPUTE ACTPER3=EXPER3.
END IF.

/* In situations where there is no end date, and the planned end date is before the start of the academic year, then
/* if the total expected terms is 1 or more then the actual term1 variable is assigned a value of 1,
/* if the total expected terms is 2 or more then actual term2 variable is assigned a value of 1 and
/* if total expected terms is 3 or more then the actual term3 variable is assigned a value of 1.
DO IF (TEMPACT=0 AND TEMPEXP<>0 AND TEMPEXP<DATE.DMY(1,8,current year)).
 IF (TOTPDEXP>=1) ACTPER1=1.
 IF (TOTPDEXP>=2) ACTPER2=1.
 IF (TOTPDEXP>=3) ACTPER3=1.
END IF.

/* Next the actual and expected terms are added together to arrive at the total actual/expected terms for the current academic year.
COMPUTE PRD_EXP=EXPER1 + EXPER2 + EXPER3.
COMPUTE PRD_ACT=ACTPER1 + ACTPER2 + ACTPER3.

Creator

Analysis and MI Team

Date issued

25 January 2006

Date created

21 December 2005

Document ref.

\\records.lsc.local\NAT\23 LrngSkillsPolicyInfrastr\23-07 DataCollectAlysis\23-07-03 LrnrDataAlysisDiss\nat-termlyattendancesamplecode-report-25jan2006.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: 27 Jan 06