Expensive subjects premiums – extraction of data from the HESA studentrecord

*********************************************************************************************************

* Algorithm for institutions to use with HESA student record (merged dataset containing *

* fields from the COURSE, STUDENT, INSTANCE, MODULE and STUDENTONMODULE * * entities). *

* Example for use with 2013/14 HESA data for 2015/16 funding. *

*********************************************************************************************************

**********************************

* Notes*

* ne means not equal to*

* proc means procedure*

* =: means begins with*

**********************************

*******************************************************************************************************

* 1. Extract eligible students (HEFCW-fundable FT UG)*

* variables taken from HESA record are in upper case of the form ENTITY.FIELDNAME.* * INSTANCE.COMDATE is reset for intercalated students to make sure they are kept *

* in the count of continuing students in their third or further year *

*******************************************************************************************************

data popn;

set hesa;

where ((INSTANCE.FUNDCODE ne ‘1’ and INSTANCE.INITIATIVES=’7’) or

INSTANCE.FUNDCODE = ‘1’ ) and

INSTANCE.EXCHANGE not in ('4','G') and

INSTANCE.MODE in (‘01’,’23’,’24’) and

COURSE.COURSEAIM in (all C, H, I, J codes, M22, M26, except where any code ends in 99) or (COURSE.COURSEAIM=M71 and TTCID≠1) and

INSTANCE.STULOAD≥3

********************************************************************

* 2. Categorise into HESES/EYM mode of study *

********************************************************************

If INSTANCE.MODE in (‘01’) or

INSTANCE.MODE in (‘23’,’24’) and INSTANCE.SPECFEE not in(‘1’,’2’) then HESMODE = ’FT’

If INSTANCE.MODE in (‘23’,’24’) and INSTANCE.SPECFEE in(‘1’,’2’) and INSTANCE.LOCSDY in (‘D’,’E’,’T’,’U’) then HESMODE=’SWYO’

*******************************************************************************************************

* 3. Delete duplicate students, keeping one instance per student keeping the instance *

* with earliest INSTANCE.COMDATE in preference*

* *

*******************************************************************************************************

proc sort;

by INSTID INSTANCE.HUSID INSTANCE.COMDATE;

if first.INSTANCE.HUSID=1 then keep;

********************************************************************

* 4. Set number of credit points coded as missing to 0 *

********************************************************************

if MODULE.CRDTPTS = . then CREDITS=0;

else CREDITS=MODULE.CRDTPTS;

************************************************************************************************************

* 5. Delete duplicate modules by student*

* ‘nodupkey’ means delete duplicates with same values of institution INSTANCE.HUSID*

* and MODULE.MODID *

************************************************************************************************************

proc sort nodupkey;

by INSTIDINSTANCE.HUSID MODULE.MODID;

***************************************************************************************************************

* 6. Keep only modules that start in 2013/14 and are countable on HESES and are completed ** or partially completed. *

***************************************************************************************************************

If STUDENTONMODULE.MODSTAT in (‘2’,‘3’) and STUDENTONMODULE.MODCOUNT = ‘2’ and STUDENTONMODULE.MODOUT in (‘1,’,’2’,’3’);

**************************************************************************************************

* 7. Reduce number of credits for sandwich year out and partial completions. *

**************************************************************************************************

If HESMODE=’SWYO’ and STUDENTONMODULE.MODOUT=’3’ then CREDITS=0.25*CREDITS;

else if HESMODE=’SWYO’ or STUDENTONMODULE.MODOUT=’3’ then CREDITS=0.5*CREDITS;

***********************************************************************************************

* 8. Transpose data so that all subjects for each module are in one row. *

* Resulting data structure looks like this: *

**

*HUSID NUMHUS MODID MODSBJ1 MODSBJP1 …. MODSBJ6 MODSBJP6 *

* 1 1 1 F100 100 *

* 1 1 2 G100 16.7 G200 16.7*

**

**********************************************************************************************

**************************************************************************************************

* 9. Assign credits in medicine and dentistry and Performance Element courses *

* to expensive subjects categories. *

**************************************************************************************************

if INSTID = '0090' and INSTANCE.CAMPID = 'B' then EXP_PE=CREDITS;

else if COURSESUBJECT.SBJCA1 in: ('A') then do;

if COURSESUBJECT.SBJCA1 in:('A3','A4') and COURSESUBJECT.SBJCA2 not in:('A1','A2') then EXP_CLIN_MED=CREDITS;

else if COURSESUBJECT.SBJCA1 in:('A3','A4') and COURSESUBJECT.SBJCA2 in:('A1','A2') then do;

EXP_CLIN_MED = CREDITS * COURSESUBJECT.SBJPCNT1/100;

end;

else if COURSESUBJECT.SBJCA1 in:('A1','A2') and COURSESUBJECT.SBJCA2 in:('A3','A4') then do;

EXP_CLIN_MED = CREDITS * COURSESUBJECT.SBJPCNT2/100;

end;

end;

end;

****************************************************************************************************

* 10. Exclude ITT (QTS) modules*

* from any counts. *

****************************************************************************************************

If COURSE.TTCID = 1 then do;

EXP_PE=0; EXP_CLIN_MED=0;

end;

****************************************************************************************************

* 11. Categorise students into first/second years and other continuing students. *

****************************************************************************************************

if INSTANCE.COMDATE≤1 August 2010then FS=0;

else FS=1;

****************************************************************************************************

* 12. Sum credits for each category. *

****************************************************************************************************

proc summary;

by INSTID FS;

var EXP_CLIN_MED EXP_PE;

output out = out_exp_pri sum = EXP_CLIN_MED EXP_PE;