TEDS Data Dictionary

Derived Variables in the 9 Year Dataset

This page gives a listing of derived variables in the 9 Year dataset, in alphabetical order of variable name. For each variable, a short written description is followed by the SPSS syntax (in a box) that was used to derive the variable.

This page does not include descriptions of background variables that are derived from other sources and that are included in the 9 Year dataset. For information about such variables, see pages describing background variables, exclusions and scrambled IDs.

The variables from the twin and teacher booklets were derived prior to double entering the dataset. Hence the variables used in the syntax on this page (having names ending in "1") were later used to make the corresponding co-twin variables (with names ending in "2").

List of variables described on this page

Click on a variable name in the table below to go to the description on this page. Alternatively, scroll down and find variables in alphabetical order.

Definitions of derived variables

Listed alphabetically

iadults

Household category: adults parent figures present in the home.
Derived from parent booklet items for respondent and partner relationships to the twins (iprelat, iparrel), marital status (ipmarist) and whether a partner is present (ippartnr). The derivation below is carried out only after extensive cleaning of the raw data, to correct discrepancies (contradictory responses) and to replace some missing values.

* Derive household category.
* Variable iadults, with same coding as aadults and gadults at earlier ages.
* denoting the parent figures present in the household.
* without distinction between 'married' and 'cohabiting'.
* Note that at age 9, unlike earlier ages, the respondents.
* are always mothers or fathers (or complete unknowns), not guardians.
* As at earlier ages, there were very few male respondents.
* so there are not separate male/female categories.
* for single parent and parent + other.
* Default value is 9=unknown, if parent booklet data is present.
IF (ipdata = 1) iadults = 9.
EXECUTE.
* Code 1: mother and father married or cohabiting.
IF (ANY(iprelat,1,2) & ANY(ipmarist,1,3)) iadults = 1.
* Code 2: parent (mother/father, usually mother) + other/guardian.
IF (ANY(iprelat,1,2) & ANY(ipmarist,2,4)) iadults = 2.
* Code 3: single parent (mother/father, usually mother), with no partner present.
IF (ANY(iprelat,1,2) & ipmarist > 4) iadults = 3.
EXECUTE.
* Other code (for mother with unknown marital/partner status).
* does not apply here at age 9, where the data are more complete.
iccacce1/2, ipcacce1/2

CEQ Acceptance scales.
Parent and twin versions.
Each scale is derived from 4 items, requiring at least 2 items to be non-missing.

COMPUTE ipcacce1 = MEAN.2(ipcla021,ipcla091,ipcla231,ipcla271).
COMPUTE ipcacce2 = MEAN.2(ipcla022,ipcla092,ipcla232,ipcla272).
COMPUTE iccacce1 = MEAN.2(iccla021,iccla091,iccla231,iccla271).
EXECUTE.
iccadve1/2, ipcadve1/2

CEQ Adventure scales.
Parent and twin versions.
Each scale is derived from 4 items, requiring at least 2 items to be non-missing.

COMPUTE ipcadve1 = MEAN.2(ipcla051,ipcla111,ipcla151,ipcla281).
COMPUTE ipcadve2 = MEAN.2(ipcla052,ipcla112,ipcla152,ipcla282).
COMPUTE iccadve1 = MEAN.2(iccla051,iccla111,iccla151,iccla281).
EXECUTE.
iccascomt1/2, ipcascomt1/2, itcascomt1/2

CAST Communication scales.
Parent, twin and teacher versions.
Derived from relevant CAST items (reversed where necessary), requiring at least half of the items to be non-missing.

* Communication scale.
* Twin version: require at least 3 of the 6 CAST communication items to be present.
COMPUTE iccascomt1 = 6 * MEAN.3(iccas021, iccas051, iccas091, iccas101, iccas111, iccas201).
* Parent and teacher: use 7 items (including item 17 used in twin social scale).
COMPUTE itcascomt1 = 7 * MEAN.4(itcas021, itcas05r1, itcas091, itcas101, itcas111, 
  itcas17r1, itcas201).
COMPUTE ipcascomt1 = 7 * MEAN.4(ipcas021, ipcas05r1, ipcas091, ipcas101, ipcas111, 
  ipcas17r1, ipcas201).
COMPUTE ipcascomt2 = 7 * MEAN.4(ipcas022, ipcas05r2, ipcas092, ipcas102, ipcas112, 
  ipcas17r2, ipcas202).
EXECUTE.
iccasnont1/2, ipcasnont1/2, itcasnont1/2

CAST Non-Social scales.
Parent, twin and teacher versions.
Derived from relevant CAST items (reversed where necessary), requiring at least half of the items to be non-missing.

* Non-Social scale.
* Twin version: require at least 3 of the 6 CAST 'non-social' items to be non-missing.
COMPUTE iccasnont1 = 6 * MEAN.3(iccas031, iccas06r1, iccas071, iccas081, iccas121, iccas131).
* Parent and teacher: there are 5 available items (item 12 was not in the booklet).
* and require at least 3 of them to be non-missing.
COMPUTE itcasnont1 = 5 * MEAN.3(itcas031, itcas06r1, itcas071, itcas081, itcas131).
COMPUTE ipcasnont1 = 5 * MEAN.3(ipcas031, ipcas06r1, ipcas071, ipcas081, ipcas131).
COMPUTE ipcasnont2 = 5 * MEAN.3(ipcas032, ipcas06r2, ipcas072, ipcas082, ipcas132).
EXECUTE.
iccassoct1/2, ipcassoct1/2, itcassoct1/2

CAST Social scales.
Parent, twin and teacher versions.
Derived from relevant CAST items supplemented with two SDQ items (reversed where necessary), requiring at least half of the items to be non-missing.

* Social scale.
* Twin version: require at least 4 of the 8 CAST 'social' items to be non-missing.
COMPUTE iccassoct1 = 8 * MEAN.4(iccas01r1, iccas041, iccas14r1, iccas15r1, iccas161, 
  iccas17r1, iccas18r1, iccas19r1).
* Parent and teacher: include 5 CAST items plus 2 SDQ items.
* requiring at least 4 of the 7 items to be non-missing.
* (CAST items 14 and 17 are omitted from the parent/teacher social scales.
*   while item 15 was not included in the parent/teacher booklets).
COMPUTE itcassoct1 = 7 * MEAN.4(itcas01r1, itcas041, itcas161, itcas18r1, itcas19r1, 
  itsdqper11, itsdqper2r1).
COMPUTE ipcassoct1 = 7 * MEAN.4(ipcas01r1, ipcas041, ipcas161, ipcas18r1, ipcas19r1, 
  ipsdqper11, ipsdqper2r1).
COMPUTE ipcassoct2 = 7 * MEAN.4(ipcas01r2, ipcas042, ipcas162, ipcas18r2, ipcas19r2, 
  ipsdqper12, ipsdqper2r2).
EXECUTE.
iccastt1/2, ipcastt1/2, itcastt1/2

CAST Total scales.
Parent, twin and teacher versions.
Derived from the entire available set of CAST items and supplemented with 2 SDQ items (reversed where necessary), requiring at least half of all the items to be non-missing.

* CAST total.
* Twin version: include all 20 available items.
COMPUTE iccastt1 = 20 * MEAN.10(iccas01r1, iccas021, iccas031, iccas041, iccas051, 
 iccas06r1, iccas071, iccas081, iccas091, iccas101, iccas111, iccas121, iccas131,
 iccas14r1, iccas15r1, iccas161, iccas17r1, iccas18r1, iccas19r1, iccas201) .
* Parent and teacher: include 17 of 18 available CAST items (omitting item 14).
* supplemented by 2 SDQ peer problem items.
* and requiring at least 10 of the 19 items to be non-missing.
* Note that items 12 and 15, included for twins, were not in the teacher and parent booklets.
COMPUTE itcastt1 = 19 * MEAN.10(itcas01r1, itcas021, itcas031, itcas041, itcas05r1, 
 itcas06r1, itcas071, itcas081, itcas091, itcas101, itcas111, itcas131, 
 itcas161, itcas17r1, itcas18r1, itcas19r1, itcas201,
 itsdqper11, itsdqper2r1) .
COMPUTE ipcastt1 = 19 * MEAN.10(ipcas01r1, ipcas021, ipcas031, ipcas041, ipcas05r1, 
 ipcas06r1, ipcas071, ipcas081, ipcas091, ipcas101, ipcas111, ipcas131, 
 ipcas161, ipcas17r1, ipcas18r1, ipcas19r1, ipcas201,
 ipsdqper11, ipsdqper2r1) .
COMPUTE ipcastt2 = 19 * MEAN.10(ipcas01r2, ipcas022, ipcas032, ipcas042, ipcas05r2, 
 ipcas06r2, ipcas072, ipcas082, ipcas092, ipcas102, ipcas112, ipcas132, 
 ipcas162, ipcas17r2, ipcas18r2, ipcas19r2, ipcas202,
 ipsdqper12, ipsdqper2r2) .
EXECUTE.
icchato1/2

Chaos scale (child self-report).
Total 6 chaos items (reversed where necessary), requiring at least 3 items to be non-missing.

* Twin-specific version from child data.
COMPUTE icchato1 = 6 * MEAN.3(icchaos1r1, icchaos21,
 icchaos31, icchaos4r1, icchaos51, icchaos6r1) .
EXECUTE.
iccnega1/2, ipcnega1/2

CEQ Negative Affect scales.
Parent and twin versions.
Each scale is derived from 4 items, requiring at least 2 items to be non-missing.

COMPUTE ipcnega1 = MEAN.2(ipcla041,ipcla081,ipcla131,ipcla181).
COMPUTE ipcnega2 = MEAN.2(ipcla042,ipcla082,ipcla132,ipcla182).
COMPUTE iccnega1 = MEAN.2(iccla041,iccla081,iccla131,iccla181).
EXECUTE.
iccoddt1/2, ipoddt1/2, itoddt1/2

Oppositional Defiant Disorder (ODD) scales.
Parent, teacher and child self-rated versions.
Derived from 5 ODD items for each rater. Four of the items were common to all three rates, with the fifth differing between the child measure (icodd2) and the parent/teacher measures (ipodd6/itodd6).

* ODD scale.
* From 5 ODD items for each rater.
* Note that 6 different items were used at age 9.
* but only 5 of the 6 were included for each rater.
* with child-rated item 2 being replaced by parent/teacher item 6.
COMPUTE ipoddt1 = 5 * MEAN.3(ipodd11, ipodd31, ipodd41, ipodd51, ipodd61).
COMPUTE ipoddt2 = 5 * MEAN.3(ipodd12, ipodd32, ipodd42, ipodd52, ipodd62).
COMPUTE icoddt1 = 5 * MEAN.3(icodd11, icodd21, icodd31, icodd41, icodd51).
COMPUTE itoddt1 = 5 * MEAN.3(itodd11, itodd31, itodd41, itodd51, itodd61).
EXECUTE.
iccoppo1/2, ipcoppo1/2

CEQ Opportunity scales.
Parent and twin versions.
Each scale is derived from 4 items, requiring at least 2 items to be non-missing.

COMPUTE ipcoppo1 = MEAN.2(ipcla031,ipcla121,ipcla191,ipcla241).
COMPUTE ipcoppo2 = MEAN.2(ipcla032,ipcla122,ipcla192,ipcla242).
COMPUTE iccoppo1 = MEAN.2(iccla031,iccla121,iccla191,iccla241).
EXECUTE.
iccpeer1/2, ipcpeer1/2, itcpeer1/2

CEQ Peer Context (Friends) scales.
Parent, twin and teacher versions.
Each scale is derived from 4 items (one of which is reversed), requiring at least 2 items to be non-missing.

* Create reverse-coded versions of the 'friends often in trouble' item.
* The reversed variables are temporary and will be dropped later.
RECODE ipcla261 ipcla262 itcla81 iccla261 
 (2=0) (1=1) (0=2)
INTO ipcl26r1 ipcl26r2 itcl8r1 iccl26r1 . 
EXECUTE.

* Friends/Peer Context scale.
COMPUTE ipcpeer1 = MEAN.2(ipcla061, ipcla161, ipcla201, ipcl26r1).
COMPUTE ipcpeer2 = MEAN.2(ipcla062, ipcla162, ipcla202, ipcl26r2).
COMPUTE itcpeer1 = MEAN.2(itcla21, itcla41, itcla51, itcl8r1).
COMPUTE iccpeer1 = MEAN.2(iccla061, iccla161, iccla201, iccl26r1).
EXECUTE.
iccsati1/2, ipcsati1/2, itcsati1/2

CEQ Classroom Satisfaction scales.
Parent, twin and teacher versions.
Each scale is derived from 4 items, requiring at least 2 items to be non-missing.

* Classroom Satisfaction.
COMPUTE ipcsati1 = MEAN.2(ipcla011,ipcla101,ipcla221,ipcla251).
COMPUTE ipcsati2 = MEAN.2(ipcla012,ipcla102,ipcla222,ipcla252).
COMPUTE itcsati1 = MEAN.2(itcla11,itcla31,itcla61,itcla71).
COMPUTE iccsati1 = MEAN.2(iccla011,iccla101,iccla221,iccla251).
EXECUTE.
iccteac1/2, ipcteac1/2

CEQ Teachers scales.
Parent and twin versions.
Each scale is derived from 4 items, requiring at least 2 items to be non-missing.

* Teachers.
COMPUTE ipcteac1 = MEAN.2(ipcla071,ipcla141,ipcla171,ipcla211).
COMPUTE ipcteac2 = MEAN.2(ipcla072,ipcla142,ipcla172,ipcla212).
COMPUTE iccteac1 = MEAN.2(iccla071,iccla141,iccla171,iccla211).
EXECUTE.
icdisnegt1/2, icdispost1/2, icdisavot1/2

Parental Discipline scales (child-reported).
Subscales for negative/harsh discipline (icdisnegt), positive discipline (icdispost) and avoidance (icdisavot). Each is derived from 2 of the 6 items of the parental discipline measure. Each item is coded 0/1/2, so each scale has values ranging from 0 to 4.

* Negative/harsh discipline: 2 items.
COMPUTE icdisnegt1 = 2 * MEAN.1(icdisma1, icdisho1).
* Positive discipline: 2 items.
COMPUTE icdispost1 = 2 * MEAN.1(icdiexp1, icdifir1).
* Avoidance: 2 items.
COMPUTE icdisavot1 = 2 * MEAN.1(icdijok1, icdiask1).
EXECUTE.
icg1/2

General Cognitive Ability ('G') scale.
Derived from scores for the 4 cognitive tests in the child booklet.
The 4 test scores are derived variables, described elsewhere on this page.

* First filter out all the standard twin exclusions.
* (medical, perinatal, unknown sex/zyg, missing 1st Contact).
* This will affect all standardised variables derived below.
USE ALL.
COMPUTE filter_$=(exclude1 = 0).
VARIABLE LABELS filter_$ 'exclude1 = 0 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

* Standardise all scores needed to compute composites.
DESCRIPTIVES VARIABLES=icpuzt1 icwrdt1 icshpt1 icgent1 /SAVE.
 
* G (general cognitive): mean from all four tests.
COMPUTE g1 = MEAN.4(zicwrdt1, zicgent1, zicpuzt1, zicshpt1).
EXECUTE.

* Standardise the new composite variable.
DESCRIPTIVES VARIABLES=g1 (icg1) /SAVE.
 
* Standardisations finished - remove filter.
FILTER OFF.
USE ALL.
EXECUTE.
icgen011/2 through to icgen181/2

Item scores for the general knowledge test in the child booklet.
Derived simply by recoding the original item responses (into the same variables); a correct response is recoded to a score of 1, an incorrect response is recoded to 0.

* Quiz 3 (General Knowledge).
* Scored as 1right 0wrong.
* items for which 1 is the correct response.
RECODE
  icgen011 icgen021 icgen061 
  (1=1) (2=0) (3=0) (4=0).
EXECUTE.
* items for which 2 is the correct response.
RECODE
  icgen041 icgen051 icgen081 icgen111 icgen181
  (1=0) (2=1) (3=0) (4=0).
EXECUTE.
* items for which 3 is the correct response.
RECODE
  icgen031 icgen071 icgen091 icgen121 icgen131 icgen151 icgen161
  (1=0) (2=0) (3=1) (4=0).
EXECUTE.
* items for which 4 is the correct response.
RECODE
  icgen101 icgen141 icgen171 
  (1=0) (2=0) (3=0) (4=1).
EXECUTE.
icgent1/2

General Knowledge test total score.
Derived as a simple sum of the item scores, which are derived variables described elsewhere on this page.

* Do a simple sum, treating missing values as if they were zero scores.
COMPUTE icgent1= SUM(icgen011, icgen021, icgen031, icgen041, icgen051,
 icgen061, icgen071, icgen081, icgen091, icgen101, icgen111, 
 icgen121, icgen131, icgen141, icgen151, icgen161, icgen171, icgen181).
EXECUTE.
icliaca1/2, iclieng1/2, iclimat1/2, icliphy1/2, iclisci1/2, ipliaca1/2, iplieng1/2, iplimat1/2, ipliphy1/2, iplisci1/2, itliaca1/2, itlieng1/2, itlimat1/2, itliphy1/2, itlisci1/2

Motivational Liking scales: parent, twin and teacher versions.
Scales for English, Maths, Science, PE and a total for all subjects.
Derived from the 'how much do you like items' in the booklets.

* First get reverse-coded versions of all items.
* so that high scores indicate good/like.
* Recode into temporary variables, which will be dropped.
RECODE
 iplik011 iplik012 iplik021 iplik022 iplik031 iplik032 iplik041 iplik042
 iplik051 iplik052 iplik061 iplik062 iplik071 iplik072 iplik081 iplik082
 iplik091 iplik092 iplik101 iplik102 iplik111 iplik112 iplik121 iplik122
 iclik011 iclik021 iclik031 iclik041
 iclik051 iclik061 iclik071 iclik081 iclik091 iclik101 iclik111 iclik121
 itlik011 itlik021 itlik031 itlik041
 itlik051 itlik061 itlik071 itlik081 itlik091 itlik101 itlik111 itlik121
  (1=5) (2=4) (3=3) (4=2) (5=1) INTO
 iplik011r iplik012r iplik021r iplik022r iplik031r iplik032r iplik041r iplik042r 
 iplik051r iplik052r iplik061r iplik062r iplik071r iplik072r iplik081r iplik082r 
 iplik091r iplik092r iplik101r iplik102r iplik111r iplik112r iplik121r iplik122r 
 iclik011r iclik021r iclik031r iclik041r 
 iclik051r iclik061r iclik071r iclik081r iclik091r iclik101r iclik111r iclik121r 
 itlik011r itlik021r itlik031r itlik041r 
 itlik051r itlik061r itlik071r itlik081r itlik091r itlik101r itlik111r itlik121r .
EXECUTE.

* English.
* items 1, 2 and 3.
COMPUTE iplieng1 = MEAN.2(iplik011r, iplik021r, iplik031r).
COMPUTE iplieng2 = MEAN.2(iplik012r, iplik022r, iplik032r).
COMPUTE iclieng1 = MEAN.2(iclik011r, iclik021r, iclik031r).
COMPUTE itlieng1 = MEAN.2(itlik011r, itlik021r, itlik031r).
EXECUTE.

* Maths.
* items 4, 5 and 6.
COMPUTE iplimat1 = MEAN.2(iplik041r, iplik051r, iplik061r).
COMPUTE iplimat2 = MEAN.2(iplik042r, iplik052r, iplik062r).
COMPUTE iclimat1 = MEAN.2(iclik041r, iclik051r, iclik061r).
COMPUTE itlimat1 = MEAN.2(itlik041r, itlik051r, itlik061r).
EXECUTE.

* Science.
* items 7, 8 and 9.
COMPUTE iplisci1 = MEAN.2(iplik071r, iplik081r, iplik091r).
COMPUTE iplisci2 = MEAN.2(iplik072r, iplik082r, iplik092r).
COMPUTE iclisci1 = MEAN.2(iclik071r, iclik081r, iclik091r).
COMPUTE itlisci1 = MEAN.2(itlik071r, itlik081r, itlik091r).
EXECUTE.

* Physical education.
* items 10, 11 and 12.
COMPUTE ipliphy1 = MEAN.2(iplik101r, iplik111r, iplik121r).
COMPUTE ipliphy2 = MEAN.2(iplik102r, iplik112r, iplik122r).
COMPUTE icliphy1 = MEAN.2(iclik101r, iclik111r, iclik121r).
COMPUTE itliphy1 = MEAN.2(itlik101r, itlik111r, itlik121r).
EXECUTE.

* Overall academic.
* items 1 to 9.
COMPUTE ipliaca1 = MEAN.6(iplik011r, iplik021r, iplik031r,
 iplik041r, iplik051r, iplik061r, iplik071r, iplik081r, iplik091r).
COMPUTE ipliaca2 = MEAN.6(iplik012r, iplik022r, iplik032r,
 iplik042r, iplik052r, iplik062r, iplik072r, iplik082r, iplik092r).
COMPUTE icliaca1 = MEAN.6(iclik011r, iclik021r, iclik031r,
 iclik041r, iclik051r, iclik061r, iclik071r, iclik081r, iclik091r).
COMPUTE itliaca1 = MEAN.6(itlik011r, itlik021r, itlik031r,
 itlik041r, itlik051r, itlik061r, itlik071r, itlik081r, itlik091r).
EXECUTE.
icmoaca1/2, ipmoaca1/2, itmoaca1/2

Motivational total scales.
Parent, twin and teacher versions.
Derived as the mean of the perceived ability and liking scales: these are derived variables, described elsewhere on this page.

* mean of the 'good' and 'like' scales.
COMPUTE ipmoaca1 = MEAN.2(ippaaca1,ipliaca1).
COMPUTE ipmoaca2 = MEAN.2(ippaaca2,ipliaca2).
COMPUTE icmoaca1 = MEAN.2(icpaaca1,icliaca1).
COMPUTE itmoaca1 = MEAN.2(itpaaca1,itliaca1).
EXECUTE.
icnv1/2

Non-Verbal Cognitive scale.
Derived from scores for the 2 non-verbal cognitive tests in the child booklet.
The 2 test scores are derived variables, described elsewhere on this page.

* First filter out all the standard twin exclusions.
* (medical, perinatal, unknown sex/zyg, missing 1st Contact).
* This will affect all standardised variables derived below.
USE ALL.
COMPUTE filter_$=(exclude1 = 0).
VARIABLE LABELS filter_$ 'exclude1 = 0 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

* Standardise all scores needed to compute composites.
DESCRIPTIVES VARIABLES=icpuzt1 icwrdt1 icshpt1 icgent1  /SAVE.

* Non-verbal: mean from Puzzle and Shapes tests.
COMPUTE nv1 = MEAN.2(zicpuzt1, zicshpt1).
EXECUTE.

* Standardise the new composite variable.
DESCRIPTIVES VARIABLES= nv1 (icnv1) /SAVE.
 
* Standardisations finished - remove filter.
FILTER OFF.
USE ALL.
EXECUTE.
icpaaca1/2, icpaeng1/2, icpamat1/2, icpaphy1/2, icpasci1/2, ippaaca1/2, ippaeng1/2, ippamat1/2, ippaphy1/2, ippasci1/2, itpaaca1/2, itpaeng1/2, itpamat1/2, itpaphy1/2, itpasci1/2

Motivational Perceived Ability scales: parent, twin and teacher versions.
Scales for English, Maths, Science, PE and a total for all subjects.
Derived from the 'how good are you at' items in the booklets.

* First get reverse-coded versions of all items.
* so that high scores indicate good/like.
* Recode into temporary variables, which will be dropped.
RECODE
 ipgoo011 ipgoo012 ipgoo021 ipgoo022 ipgoo031 ipgoo032 ipgoo041 ipgoo042
 ipgoo051 ipgoo052 ipgoo061 ipgoo062 ipgoo071 ipgoo072 ipgoo081 ipgoo082
 ipgoo091 ipgoo092 ipgoo101 ipgoo102 ipgoo111 ipgoo112 ipgoo121 ipgoo122
 icgoo011 icgoo021 icgoo031 icgoo041 icgoo051 icgoo061 icgoo071 icgoo081
 icgoo091 icgoo101 icgoo111 icgoo121
 itgoo011 itgoo021 itgoo031 itgoo041 itgoo051 itgoo061 itgoo071 itgoo081
 itgoo091 itgoo101 itgoo111 itgoo121
  (1=5) (2=4) (3=3) (4=2) (5=1) INTO
 ipgoo011r ipgoo012r ipgoo021r ipgoo022r ipgoo031r ipgoo032r ipgoo041r ipgoo042r 
 ipgoo051r ipgoo052r ipgoo061r ipgoo062r ipgoo071r ipgoo072r ipgoo081r ipgoo082r 
 ipgoo091r ipgoo092r ipgoo101r ipgoo102r ipgoo111r ipgoo112r ipgoo121r ipgoo122r 
 icgoo011r icgoo021r icgoo031r icgoo041r icgoo051r icgoo061r icgoo071r icgoo081r 
 icgoo091r icgoo101r icgoo111r icgoo121r 
 itgoo011r itgoo021r itgoo031r itgoo041r itgoo051r itgoo061r itgoo071r itgoo081r 
 itgoo091r itgoo101r itgoo111r itgoo121r  .
EXECUTE.

* English.
* items 1, 2 and 3.
COMPUTE ippaeng1 = MEAN.2(ipgoo011r, ipgoo021r, ipgoo031r).
COMPUTE ippaeng2 = MEAN.2(ipgoo012r, ipgoo022r, ipgoo032r).
COMPUTE icpaeng1 = MEAN.2(icgoo011r, icgoo021r, icgoo031r).
COMPUTE itpaeng1 = MEAN.2(itgoo011r, itgoo021r, itgoo031r).
EXECUTE.

* Maths.
* items 4, 5 and 6.
COMPUTE ippamat1 = MEAN.2(ipgoo041r, ipgoo051r, ipgoo061r).
COMPUTE ippamat2 = MEAN.2(ipgoo042r, ipgoo052r, ipgoo062r).
COMPUTE icpamat1 = MEAN.2(icgoo041r, icgoo051r, icgoo061r).
COMPUTE itpamat1 = MEAN.2(itgoo041r, itgoo051r, itgoo061r).
EXECUTE.

* Science.
* items 7, 8 and 9.
COMPUTE ippasci1 = MEAN.2(ipgoo071r, ipgoo081r, ipgoo091r).
COMPUTE ippasci2 = MEAN.2(ipgoo072r, ipgoo082r, ipgoo092r).
COMPUTE icpasci1 = MEAN.2(icgoo071r, icgoo081r, icgoo091r).
COMPUTE itpasci1 = MEAN.2(itgoo071r, itgoo081r, itgoo091r).
EXECUTE.

* Physical education.
* items 10, 11 and 12.
COMPUTE ippaphy1 = MEAN.2(ipgoo101r, ipgoo111r, ipgoo121r).
COMPUTE ippaphy2 = MEAN.2(ipgoo102r, ipgoo112r, ipgoo122r).
COMPUTE icpaphy1 = MEAN.2(icgoo101r, icgoo111r, icgoo121r).
COMPUTE itpaphy1 = MEAN.2(itgoo101r, itgoo111r, itgoo121r).
EXECUTE.

* Overall academic.
* items 1 to 9.
COMPUTE ippaaca1 = MEAN.6(ipgoo011r, ipgoo021r, ipgoo031r,
 ipgoo041r, ipgoo051r, ipgoo061r, ipgoo071r, ipgoo081r, ipgoo091r).
COMPUTE ippaaca2 = MEAN.6(ipgoo012r, ipgoo022r, ipgoo032r,
 ipgoo042r, ipgoo052r, ipgoo062r, ipgoo072r, ipgoo082r, ipgoo092r).
COMPUTE icpaaca1 = MEAN.6(icgoo011r, icgoo021r, icgoo031r,
 icgoo041r, icgoo051r, icgoo061r, icgoo071r, icgoo081r, icgoo091r).
COMPUTE itpaaca1 = MEAN.6(itgoo011r, itgoo021r, itgoo031r,
 itgoo041r, itgoo051r, itgoo061r, itgoo071r, itgoo081r, itgoo091r).
EXECUTE.
icparnegt1/2, icparpost1/2, icpart1/2

Parental feelings scales (child-reported).
Subscales for negative feelings (icparnegt, 4 items) and positive feelings (icparpost, 3 items), and an overall total scale (icpart) from all 7 items. The total scale is coded in the direction of negative feelings, so it uses the reversed versions of the positive-feelings items. Each item is coded 0/1/2, so each scale has values ranging from 0 to two times the number of component items.

* Negative feelings: 4 items.
COMPUTE icparnegt1 = 4 * MEAN.2(icbpimp1, icbpalo1, icbpang1, icbpfru1).
EXECUTE.
* Positive feelings: 3 items.
COMPUTE icparpost1 = 3 * MEAN.2(icbphap1, icbpamu1, icbpclo1).
EXECUTE.
* Total scale: all 7 items, coded in the negative feelings direction.
* so use the reversed versions of the positive feelings items.
COMPUTE icpart1 = 7 * MEAN.4(icbpimp1, icbphapr1, icbpamur1,
 icbpalo1, icbpang1, icbpclor1, icbpfru1) .
EXECUTE.
icpage

Twin age when parent and twin booklets were completed.
Derived from date item variables that are not retained in the dataset.
Where booklet completion date is not available, use return date instead.

* First get best estimates of date, dealing with missing data.
* Parent and child booklets returned together.
* so assume completed at the same time (only one age variable needed).
* Use ipdate if available (date parent booklet filled in).
IF (ipdata = 1) icpdate = ipdate.
* If parent booklet date is missing, use admin date.
* when parent booklet was logged as returned.
IF (SYSMIS(ipdate) & ipdata = 1) icpdate = iprdate.
EXECUTE.
* If still missing, try using child booklet return date.
IF (SYSMIS(icpdate) & icdata1 = 1) icpdate = icrdate1.
* Set back to missing if there is no parent or child data.
DO IF (ipdata = 0 & icdata1 = 0 & icdata2 = 0).
  RECODE icpdate (ELSE=SYSMIS).
END IF.
EXECUTE.

* Now derive age by subtracting twin birth date.
COMPUTE icpage = RND((DATEDIFF(icpdate, aonsdob, "days")) / 365.25, 0.1).
EXECUTE.
icpLLCage, icpLLCdate, itLLCage1/2, itLLCdate1/2

Age and date variables derived for use in datasets in the LLC TRE (but not to be used in other datasets).
Ages and dates are derived for the parent and twin booklets, nearly always returned all at the same time ('icp') and for the return of the teacher questionnaires ('it').
The LLC date variables contain only the month and year, not the day, as a means of reducing identifiability. The date variables are strings formatted as 'yyyy-mm'. These LLC dates are designed to enable the TEDS measures to be placed in a time sequence with NHS medical diagnosis dates in the data in the TRE.
The LLC age variables are integers measuring the number of months between birth and the given TEDS activity, consistent with the matching LLC date variables.
Variable aonsdob is the twin birth date - the raw date variables are not retained in the dataset.

* First extract year and month as temp variables, from birth date and activity dates.
COMPUTE birthyear = XDATE.YEAR(aonsdob).
COMPUTE birthmonth = XDATE.MONTH(aonsdob).
COMPUTE icpyear = XDATE.YEAR(icpdate).
COMPUTE icpmonth = XDATE.MONTH(icpdate).
COMPUTE ityear1 = XDATE.YEAR(itdate1).
COMPUTE itmonth1 = XDATE.MONTH(itdate1).
EXECUTE.

* The agreed LLC date format is a string yyyy-mm (nominal by default for strings).
* adding '0' where necessary for two-digit months.
STRING icpLLCdate itLLCdate1 (A7).
IF (icpmonth < 10) icpLLCdate = CONCAT(STRING(icpyear, F4), '-0', STRING(icpmonth, F1)).
IF (icpmonth >= 10) icpLLCdate = CONCAT(STRING(icpyear, F4), '-', STRING(icpmonth, F2)).
IF (itmonth1 < 10) itLLCdate1 = CONCAT(STRING(ityear1, F4), '-0', STRING(itmonth1, F1)).
IF (itmonth1 >= 10) itLLCdate1 = CONCAT(STRING(ityear1, F4), '-', STRING(itmonth1, F2)).
EXECUTE.

* The agreed LLC age variable is in integer months.
* and it must agree with the birth and booklet year/month variables that will be available in the LLC.
COMPUTE icpLLCage = (icpmonth + (icpyear * 12)) - (birthmonth + (birthyear * 12)).
COMPUTE itLLCage1 = (itmonth1 + (ityear1 * 12)) - (birthmonth + (birthyear * 12)).
EXECUTE.
icpuz011/2 through to icpuz241/2

Item scores for the puzzle test in the child booklet.
Derived simply by recoding the original item responses (into the same variables); a correct response is recoded to a score of 1, an incorrect response is recoded to 0.

* Quiz 4 (Puzzles).
* Scored as 1right 0wrong.
* items for which 1 (A) is the correct response.
RECODE
  icpuz041 icpuz101 icpuz151 icpuz201 
  (1=1) (2=0) (3=0) (4=0) (5=0).
EXECUTE.
* items for which 2 (B) is the correct response.
RECODE
  icpuz051 icpuz071 icpuz171 icpuz191 icpuz241
  (1=0) (2=1) (3=0) (4=0) (5=0).
EXECUTE.
* items for which 3 (C) is the correct response.
RECODE
  icpuz011 icpuz081 icpuz131 icpuz231 
  (1=0) (2=0) (3=1) (4=0) (5=0).
EXECUTE.
* items for which 4 (D) is the correct response.
RECODE
  icpuz061 icpuz111 icpuz141 icpuz161 
  (1=0) (2=0) (3=0) (4=1) (5=0).
EXECUTE.
* items for which 5 (E) is the correct response.
RECODE
  icpuz031 icpuz091 icpuz121 icpuz181 icpuz211 icpuz221 
  (1=0) (2=0) (3=0) (4=0) (5=1).
EXECUTE.
icpuzt1/2

Puzzle test total score.
Derived as a simple sum of the item scores, which are derived variables described elsewhere on this page.
But note that item 2 was not included (due to a printing error in the booklet).

* Do a simple sum, treating missing values as if they were zero scores.
* Note that the puzzle total is out of 23 not 24 because item 2 has been dropped.
COMPUTE icpuzt1= SUM(icpuz011, icpuz031, icpuz041, icpuz051, icpuz061, icpuz071, icpuz081, icpuz091, icpuz101, icpuz111,
  icpuz121, icpuz131, icpuz141, icpuz151, icpuz161, icpuz171, icpuz181, icpuz191, icpuz201, icpuz211, icpuz221, icpuz231, icpuz241) .
EXECUTE.
icsdqbeht1/2, ipsdqbeht1/2, itsdqbeht1/2

SDQ Total Problem Behaviours scales.
Parent, twin and teacher versions.
Derived from 20 SDQ items (reversed where necessary), requiring at least 10 of the items to be non-missing.

* SDQ Total Problem Behaviours.
* Includes Hyperactivity, Conduct, Peer Problem and Emotion but not Prosocial.
* Total scores out of 40 - need at least 10 items.
COMPUTE ipsdqbeht1 = 20 * MEAN.10(ipsdqhyp11, ipsdqhyp21, ipsdqhyp31, ipsdqhyp4r1, ipsdqhyp5r1,
 ipsdqcon11, ipsdqcon2r1, ipsdqcon31, ipsdqcon41, ipsdqcon51,
 ipsdqper11, ipsdqper2r1, ipsdqper3r1, ipsdqper41, ipsdqper51,
 ipsdqemo11, ipsdqemo21, ipsdqemo31, ipsdqemo41, ipsdqemo51).
COMPUTE ipsdqbeht2 = 20 * MEAN.10(ipsdqhyp12, ipsdqhyp22, ipsdqhyp32, ipsdqhyp4r2, ipsdqhyp5r2,
 ipsdqcon12, ipsdqcon2r2, ipsdqcon32, ipsdqcon42, ipsdqcon52,
 ipsdqper12, ipsdqper2r2, ipsdqper3r2, ipsdqper42, ipsdqper52,
 ipsdqemo12, ipsdqemo22, ipsdqemo32, ipsdqemo42, ipsdqemo52).
COMPUTE itsdqbeht1 = 20 * MEAN.10(itsdqhyp11, itsdqhyp21, itsdqhyp31, itsdqhyp4r1, itsdqhyp5r1,
 itsdqcon11, itsdqcon2r1, itsdqcon31, itsdqcon41, itsdqcon51,
 itsdqper11, itsdqper2r1, itsdqper3r1, itsdqper41, itsdqper51,
 itsdqemo11, itsdqemo21, itsdqemo31, itsdqemo41, itsdqemo51).
COMPUTE icsdqbeht1 = 20 * MEAN.10(icsdqhyp11, icsdqhyp21, icsdqhyp31, icsdqhyp4r1, icsdqhyp5r1,
 icsdqcon11, icsdqcon2r1, icsdqcon31,  icsdqcon41, icsdqcon51,
 icsdqper11, icsdqper2r1, icsdqper3r1, icsdqper41, icsdqper51,
 icsdqemo11, icsdqemo21, icsdqemo31, icsdqemo41, icsdqemo51).
EXECUTE.
icsdqcont1/2, ipsdqcont1/2, itsdqcont1/2

SDQ Conduct scales.
Three versions: parent, twin and teacher.
Derived from 5 SDQ items (reversed where necessary), requiring at least 3 of the items to be non-missing.

* SDQ Conduct.
* Total scores out of 10 - need at least 3 items.
COMPUTE ipsdqcont1 = 5 * MEAN.3(ipsdqcon11, ipsdqcon2r1, ipsdqcon31, ipsdqcon41, ipsdqcon51).
COMPUTE ipsdqcont2 = 5 * MEAN.3(ipsdqcon12, ipsdqcon2r2, ipsdqcon32, ipsdqcon42, ipsdqcon52).
COMPUTE itsdqcont1 = 5 * MEAN.3(itsdqcon11, itsdqcon2r1, itsdqcon31, itsdqcon41, itsdqcon51).
COMPUTE icsdqcont1 = 5 * MEAN.3(icsdqcon11, icsdqcon2r1, icsdqcon31, icsdqcon41, icsdqcon51).
EXECUTE.
icsdqemot1/2, ipsdqemot1/2, itsdqemot1/2

SDQ Emotional symptoms scales.
Three versions: parent, twin and teacher.
Derived from 5 SDQ items, requiring at least 3 of the items to be non-missing.

* SDQ Emotional Symptoms (previously called Anxiety).
* Total scores out of 10 - need at least 3 items.
COMPUTE ipsdqemot1 = 5 * MEAN.3(ipsdqemo11, ipsdqemo21, ipsdqemo31, ipsdqemo41, ipsdqemo51).
COMPUTE ipsdqemot2 = 5 * MEAN.3(ipsdqemo12, ipsdqemo22, ipsdqemo32, ipsdqemo42, ipsdqemo52).
COMPUTE itsdqemot1 = 5 * MEAN.3(itsdqemo11, itsdqemo21, itsdqemo31, itsdqemo41, itsdqemo51).
COMPUTE icsdqemot1 = 5 * MEAN.3(icsdqemo11, icsdqemo21, icsdqemo31, icsdqemo41, icsdqemo51).
EXECUTE.
icsdqhypt1/2, ipsdqhypt1/2, itsdqhypt1/2

SDQ Hyperactivity scales.
Three versions: parent, twin and teacher.
Derived from 5 SDQ items (reversed where necessary), requiring at least 3 of the items to be non-missing.

* SDQ Hyperactivity.
* Total scores out of 10 - need at least 3 items.
COMPUTE ipsdqhypt1 = 5 * MEAN.3(ipsdqhyp11, ipsdqhyp21, ipsdqhyp31, ipsdqhyp4r1, ipsdqhyp5r1).
COMPUTE ipsdqhypt2 = 5 * MEAN.3(ipsdqhyp12, ipsdqhyp22, ipsdqhyp32, ipsdqhyp4r2, ipsdqhyp5r2).
COMPUTE itsdqhypt1 = 5 * MEAN.3(itsdqhyp11, itsdqhyp21, itsdqhyp31, itsdqhyp4r1, itsdqhyp5r1).
COMPUTE icsdqhypt1 = 5 * MEAN.3(icsdqhyp11, icsdqhyp21, icsdqhyp31, icsdqhyp4r1, icsdqhyp5r1).
EXECUTE.
icsdqpert1/2, ipsdqpert1/2, itsdqpert1/2

SDQ Peer Problem scales.
Parent, twin and teacher versions.
Derived from 5 SDQ items (reversed where necessary), requiring at least 3 of the items to be non-missing.

* SDQ Peer Problem.
* Total scores out of 10 - need at least 3 items.
COMPUTE ipsdqpert1 = 5 * MEAN.3(ipsdqper11, ipsdqper2r1, ipsdqper3r1, ipsdqper41, ipsdqper51).
COMPUTE ipsdqpert2 = 5 * MEAN.3(ipsdqper12, ipsdqper2r2, ipsdqper3r2, ipsdqper42, ipsdqper52).
COMPUTE itsdqpert1 = 5 * MEAN.3(itsdqper11, itsdqper2r1, itsdqper3r1, itsdqper41, itsdqper51).
COMPUTE icsdqpert1 = 5 * MEAN.3(icsdqper11, icsdqper2r1, icsdqper3r1, icsdqper41, icsdqper51).
EXECUTE.
icsdqprot1/2, ipsdqprot1/2, itsdqprot1/2

SDQ Prosocial scales.
Parent, twin and teacher versions.
Derived from 5 SDQ items, requiring at least 3 of the items to be non-missing.

* SDQ Prosocial.
* Total scores out of 10 - need at least 3 items.
COMPUTE ipsdqprot1 = 5 * MEAN.3(ipsdqpro11, ipsdqpro21, ipsdqpro31, ipsdqpro41, ipsdqpro51).
COMPUTE ipsdqprot2 = 5 * MEAN.3(ipsdqpro12, ipsdqpro22, ipsdqpro32, ipsdqpro42, ipsdqpro52).
COMPUTE itsdqprot1 = 5 * MEAN.3(itsdqpro11, itsdqpro21, itsdqpro31, itsdqpro41, itsdqpro51).
COMPUTE icsdqprot1 = 5 * MEAN.3(icsdqpro11, icsdqpro21, icsdqpro31, icsdqpro41, icsdqpro51).
EXECUTE.
icshp011/2 through to icshp241/2

Item scores for the shapes test in the child booklet.
Derived simply by recoding the original item responses (into the same variables); a correct response is recoded to a score of 1, an incorrect response is recoded to 0.

* Quiz 1 (Shapes).
* Scored as 1right 0wrong.
* items for which 1 (A) is the correct response.
RECODE
  icshp011 icshp061 icshp101 icshp181 icshp191 
  (1=1) (2=0) (3=0) (4=0) (5=0).
EXECUTE.
* items for which 2 (B) is the correct response.
RECODE
  icshp021 icshp071 icshp131 icshp171 icshp201 
  (1=0) (2=1) (3=0) (4=0) (5=0).
EXECUTE.
* items for which 3 (C) is the correct response.
RECODE
  icshp031 icshp121 icshp151 
  (1=0) (2=0) (3=1) (4=0) (5=0).
EXECUTE.
* items for which 4 (D) is the correct response.
RECODE
  icshp051 icshp111 icshp141 icshp211 icshp231 
  (1=0) (2=0) (3=0) (4=1) (5=0).
EXECUTE.
* items for which 5 (E) is the correct response.
RECODE
  icshp041 icshp081 icshp091 icshp161 icshp221 icshp241
  (1=0) (2=0) (3=0) (4=0) (5=1).
EXECUTE.
icshpt1/2

Shapes test total score.
Derived as a simple sum of the item scores for items 2-24, which are derived variables described elsewhere on this page. Note that item 1 is not used because it was missing for cohort 2 twins. The total score has value range 0-23.

* Do a simple sum, treating missing values as if they were zero scores.
* and omitting item 1 (missing for cohort 2 twins).
COMPUTE icshpt1= SUM(icshp021, icshp031, icshp041, icshp051,
 icshp061, icshp071, icshp081, icshp091, icshp101, icshp111,
 icshp121, icshp131, icshp141, icshp151, icshp161, icshp171,
  icshp181, icshp191, icshp201, icshp211, icshp221, icshp231, icshp241).
EXECUTE.
icvb1/2

Verbal Cognitive scale.
Derived from scores for the 2 verbal cognitive tests in the child booklet.
The 2 test scores are derived variables, described elsewhere on this page.

* First filter out all the standard twin exclusions.
* (medical, perinatal, unknown sex/zyg, missing 1st Contact).
* This will affect all standardised variables derived below.
USE ALL.
COMPUTE filter_$=(exclude1 = 0).
VARIABLE LABELS filter_$ 'exclude1 = 0 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

* Standardise all scores needed to compute composites.
DESCRIPTIVES VARIABLES=icpuzt1 icwrdt1 icshpt1 icgent1 /SAVE.

* Verbal: mean from Word and General Knowledge quizes.
COMPUTE vb1 = MEAN.2(zicwrdt1, zicgent1).
EXECUTE.

* Standardise the new composite variable.
DESCRIPTIVES VARIABLES= vb1 (icvb1)  /SAVE.

* Standardisations finished - remove filter.
FILTER OFF.
USE ALL.
EXECUTE.
icwrd011/2 through to icwrd201/2

Item scores for the vocabulary test in the child booklet.
Derived simply by recoding the original item responses (into the same variables); a correct response is recoded to a score of either 2 (best response) or 1 (acceptable response), while an incorrect response is recoded to 0.

* Quiz 2 (Words).
* Scored as 0, 1 or 2.
* There are two correct answers for most items, but one response is best and scores 2 points.
RECODE icwrd011 (1=2) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd021 (3=2) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd031 (2=2) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd041 (1=2) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd051 (4=2) (1=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd061 (2=2) (3=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd071 (3=2) (4=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd081 (3=2) (4=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd091 (2=2) (1=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd101 (4=2) (3=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd111 (1=2) (3=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd121 (1=2) (2=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd131 (2=2) (1=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd141 (4=2) (1=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd151 (1=2) (2=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd161 (4=2) (1=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd171 (2=2) (4=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd181 (4=2) (2=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd191 (2=2) (3=1) (SYSMIS=SYSMIS) (ELSE=0).
RECODE icwrd201 (3=2) (4=1) (SYSMIS=SYSMIS) (ELSE=0).
EXECUTE.
icwrdt1/2

Word Quiz (Vocabulary test) total score.
Derived as a simple sum of the item scores, which are derived variables described elsewhere on this page.

* Do a simple sum, treating missing values as if they were zero scores.
COMPUTE icwrdt1= SUM(icwrd011, icwrd021, icwrd031, icwrd041, icwrd051,
 icwrd061, icwrd071, icwrd081, icwrd091, icwrd101, icwrd111, 
 icwrd121, icwrd131, icwrd141, icwrd151, icwrd161, icwrd171,
  icwrd181, icwrd191, icwrd201).
EXECUTE.
inineyr

Data flag, to show presence of any data (parent, twin or teacher) for a twin pair in the 9 Year dataset.
Coded as 1=yes (data present) for the twin pair.

* Recode data flags from missing to 0.
RECODE icdata1 icdata2 itdata1 itdata2 ipdata (SYSMIS=0).
EXECUTE.

* Only keep cases with some 9 year data.
FILTER OFF.
USE ALL.
SELECT IF (ipdata = 1 | icdata1 = 1 | icdata2 = 1 | itdata1 = 1 | itdata2 = 1).
EXECUTE.

* Add an overall 9 year data flag.
COMPUTE inineyr = 1.
EXECUTE.
ipanxshyt1/2, ipanxocbt1/2, ipanxfeart1/2, ipanxnafft1/2, ipanxncogt1/2, ipanxt1/2

ARBQ anxiety scales.
From the 20 parent-rated items of the ARBQ measure at age 9, plus the 5 items of SDQ emotion.
ipanxshyt1/2: shyness (social anxiety) scale, 4 items.
ipanxocbt1/2: ocb (obsessive-compulsive behaviour) scale, 3 items.
ipanxfeart1/2: fear scale, 5 items.
ipanxnafft1/2: negative affect scale, 5 items.
ipanxncogt1/2: negative cognition scale, 6 items.
ipanxt1/2: overall anxiety total scale, 25 items.
These ARBQ scales are comparable with those used at other ages (3, 4, 7, 16), subject to some variations in the items that were included at each age. All items are coded 0/1/2 so each subscale has values ranging from 0 up to double the number of items. At least half the items are required to be non-missing for each subscale.
Published papers are broadly in agreement about the items used to make the subscales. At all ages where the items are present, the following decisions have been made about the use of the items:
(a) anx09, "twitches", and sdqemo1, "headaches", are not used in any of the subscales, in agreement with at least two papers. anx09 was used in OCB by one paper and in negative affect by another paper while sdqemo1 was used in fear by one paper.
(b) anx05, "asks for reassurance", is used in the negative cognition subscale, as in at least two papers. It was used in OCB by another paper.
(c) anx06, "doing things over and over", is used in the OCB subscale, in agreement with at least two papers. It was used in negative affect in another paper.

* ARBQ ANXIETY SCALES.
* For parent ratings, from 20 ARBQ plus 5 SDQ emotion items.
* (the teacher questionnaire only includes 1 ARBQ item).
* These are very similar to the age 7 parent ARBQ scales.
* with the sole difference of an extra item at age 7.

* ARBQ shyness (social anxiety) subscale.
* 4 items (0-8).
* including an SDQ emotion item.
COMPUTE ipanxshyt1 = 4 * MEAN.2(ipanx021, ipanx031, ipanx071, ipsdqemo41).
COMPUTE ipanxshyt2 = 4 * MEAN.2(ipanx022, ipanx032, ipanx072, ipsdqemo42).
EXECUTE.

* ARBQ OCB subscale.
* 3 items, (0-6).
COMPUTE ipanxocbt1 = 3 * MEAN.2(ipanx041, ipanx061, ipanx141).
COMPUTE ipanxocbt2 = 3 * MEAN.2(ipanx042, ipanx062, ipanx142).
EXECUTE.

* ARBQ fear subscale.
* 5 items (0-10).
* including an SDQ emotion item.
COMPUTE ipanxfeart1 = 5 * MEAN.3(ipanx011, ipanx081, ipanx181, ipanx201, ipsdqemo51).
COMPUTE ipanxfeart2 = 5 * MEAN.3(ipanx012, ipanx082, ipanx182, ipanx202, ipsdqemo52).
EXECUTE.

* ARBQ negative affect subscale.
* 5 items, (0-10).
* including an SDQ emotion item.
COMPUTE ipanxnafft1 = 5 * MEAN.3(ipanx101, ipanx121, ipanx161, ipanx171, ipsdqemo31).
COMPUTE ipanxnafft2 = 5 * MEAN.3(ipanx102, ipanx122, ipanx162, ipanx172, ipsdqemo32).
EXECUTE.

* ARBQ negative cognition subscale.
* 6 items, (0-12).
* including an SDQ emotion item.
COMPUTE ipanxncogt1 = 6 * MEAN.3(ipanx051, ipanx111, ipanx131, ipanx151, ipanx191, ipsdqemo21).
COMPUTE ipanxncogt2 = 6 * MEAN.3(ipanx052, ipanx112, ipanx132, ipanx152, ipanx192, ipsdqemo22).
EXECUTE.

* ARBQ total anxiety scale.
* Include all 20 ARBQ items and all five SDQ emotion items.
* because the latter are effectively part of the ARBQ as well as the SDQ.
* hence including all items from the 5 subscales above.
* plus two items not in any subscale: sdqemo1 (headaches, etc).
* and anx09 (twitches, etc, parent only).
* Both items correlate with all the others (anx09 only slightly).
* but do not clearly belong to any one of the subscales.
COMPUTE ipanxt1 = 25 * MEAN.13(ipanx011, ipanx021, ipanx031, ipanx041, ipanx051, 
  ipanx061, ipanx071, ipanx081, ipanx091, ipanx101, ipanx111, ipanx121, ipanx131, 
  ipanx141, ipanx151, ipanx161, ipanx171, ipanx181, ipanx191, ipanx201, 
  ipsdqemo11, ipsdqemo21, ipsdqemo31, ipsdqemo41, ipsdqemo51).
COMPUTE ipanxt2 = 25 * MEAN.13(ipanx012, ipanx022, ipanx032, ipanx042, ipanx052, 
  ipanx062, ipanx072, ipanx082, ipanx092, ipanx102, ipanx112, ipanx122, ipanx132, 
  ipanx142, ipanx152, ipanx162, ipanx172, ipanx182, ipanx192, ipanx202, 
  ipsdqemo12, ipsdqemo22, ipsdqemo32, ipsdqemo42, ipsdqemo52).
EXECUTE.
ipapscalt1/2, itapscalt1/2

APSD Callous-Unemotional scales.
Parent and teacher versions.
Derived from 6 relevant APSD items (reversed where necessary), requiring at least 3 items to be non-missing.

* APSD-only version from 6 items: total score out of 12 - need at least 3 items.
COMPUTE itapsscalt1 = 6 * MEAN.3(itaps03r1, itaps07r1, itaps12r1, 
  itaps18r1, itaps191, itaps20r1).
COMPUTE ipapsscalt1 = 6 * MEAN.3(ipaps03r1, ipaps07r1, ipaps12r1, 
  ipaps18r1, ipaps191, ipaps20r1).
COMPUTE ipapsscalt2 = 6 * MEAN.3(ipaps03r2, ipaps07r2, ipaps12r2, 
  ipaps18r2, ipaps192, ipaps20r2).
ipapsdt1/2, itapsdt1/2

APSD Total scales.
Parent and teacher versions.
Derived from the entire set of 20 APSD items (reversed where necessary), requiring at least 10 items to be non-missing.

* (Antisocial Process Screening Device).
* All the callous-unemotional, narcissism and impulsivity items plus two others.
* Total score out of 40 - need at least 10 items.
COMPUTE itapsdt1 = 20 * MEAN.10(itbh46r1,itbh51r1,itbh56r1,itbh73r1,itbh74r1,itbh771,
	itbh031,itbh131,itbh221,itbh281,itbh361,itbh601,itbh681,
	itbh091,itbh111,itbh661,itbh701,itbh721,
	itbh261,itbh821).
COMPUTE ipapsdt1 = 20 * MEAN.10(ipbh52r1,ipbh59r1,ipbh64r1,ipbh90r1,ipbh91r1,ipbh0951,
	ipbh0041,ipbh0151,ipbh0251,ipbh0311,ipbh0401,ipbh0691,ipbh0811,
	ipbh0101,ipbh0131,ipbh0761,ipbh0841,ipbh0871,
	ipbh0291,ipbh1001).
COMPUTE ipapsdt2 = 20 * MEAN.10(ipbh52r2,ipbh59r2,ipbh64r2,ipbh90r2,ipbh91r2,ipbh0952,
	ipbh0042,ipbh0152,ipbh0252,ipbh0312,ipbh0402,ipbh0692,ipbh0812,
	ipbh0102,ipbh0132,ipbh0762,ipbh0842,ipbh0872,
	ipbh0292,ipbh1002).
EXECUTE.
ipapsecalt1/2, itapsecalt1/2

APSD Enhanced versions of Callous-Unemotional scales.
Parent and teacher versions.
Derived from 6 relevant APSD items plus 2 SDQ items (reversed where necessary), requiring at least 4 items to be non-missing.

* Enhanced version: same 6 APSD items with 2 added SDQ prosocial items.
* 8 items so total score is out of 16 - need at least 4 items.
COMPUTE itapsecalt1 = 8 * MEAN.4(itaps03r1, itaps07r1, itaps12r1, 
  itaps18r1, itaps191, itaps20r1, itsdqpro3r1, itsdqpro4r1).
COMPUTE ipapsecalt1 = 8 * MEAN.4(ipaps03r1, ipaps07r1, ipaps12r1, 
  ipaps18r1, ipaps191, ipaps20r1, ipsdqpro3r1, ipsdqpro4r1).
COMPUTE ipapsecalt2 = 8 * MEAN.4(ipaps03r2, ipaps07r2, ipaps12r2, 
  ipaps18r2, ipaps192, ipaps20r2, ipsdqpro3r2, ipsdqpro4r2).
EXECUTE.
ipapsimpt1/2, itapsimpt1/2

APSD Impulsivity scales.
Parent and teacher versions.
Derived from 5 relevant APSD items, requiring at least 3 items to be non-missing.

* From 5 items, total score out of 10 - need at least 3 items.
COMPUTE itapsimpt1 = 5 * MEAN.3(itaps011, itaps041, itaps091, itaps131, itaps171).
COMPUTE ipapsimpt1 = 5 * MEAN.3(ipaps011, ipaps041, ipaps091, ipaps131, ipaps171).
COMPUTE ipapsimpt2 = 5 * MEAN.3(ipaps012, ipaps042, ipaps092, ipaps132, ipaps172).
EXECUTE.
ipapsnart1/2, itapsnart1/2

APSD Narcissism scales.
Parent and teacher versions.
Derived from 7 relevant APSD items, requiring at least 4 items to be non-missing.

* From 7 items, total score out of 14 - need at least 4 items.
COMPUTE itapsnart1 = 7 * MEAN.4(itaps051, itaps081, itaps101, 
  itaps111, itaps141, itaps151, itaps161).
COMPUTE ipapsnart1 = 7 * MEAN.4(ipaps051, ipaps081, ipaps101, 
  ipaps111, ipaps141, ipaps151, ipaps161).
COMPUTE ipapsnart2 = 7 * MEAN.4(ipaps052, ipaps082, ipaps102, 
  ipaps112, ipaps142, ipaps152, ipaps162).
EXECUTE.
ipcacce1/2

See iccacce1/2, etc above.

ipcadve1/2

See iccadve1/2, etc above.

ipcascomt1/2

See iccascomt1/2, etc above.

ipcasnont1/2

See icascnont1/2, etc above.

ipcassoct1/2

See iccassoct1/2, etc above.

ipcastt1/2

See iccastt1/2, etc above.

ipchatot

Chaos scale (parent-report).
Sum of 6 chaos items (reversed where necessary), requiring at least 3 items to be non-missing.

* Chaos.
* Family-specific version from parent data.
* using reversed versions of items where needed.
COMPUTE ipchatot = 6 * MEAN.3(ipchaos1r, ipchaos2x,
 ipchaos3x, ipchaos4r, ipchaos5x, ipchaos6r).
EXECUTE. 
ipcnega1/2

See iccnega1/2, etc above.

ipcoppo1/2

See iccoppo1/2, etc above.

ipcpeer1/2

See iccpeer1/2, etc above.

ipcsati1/2

See iccsati1/2, etc above.

ipcteac1/2

See iccteac1/2, etc above.

ipdisnegt1/2, ipdispost1/2, ipdisavot1/2

Parental Discipline scales (parent-reported).
Subscales for negative/harsh discipline (ipdisnegt), positive discipline (ipdispost) and avoidance (ipdisavot). Each is derived from 2 of the 6 items of the parental discipline measure. Each item is coded 0/1/2, so each scale has values ranging from 0 to 4.

* Negative/harsh discipline: 2 items.
COMPUTE ipdisnegt1 = 2 * MEAN.1(ipdisma1, ipdisho1).
COMPUTE ipdisnegt2 = 2 * MEAN.1(ipdisma2, ipdisho2).
* Positive discipline: 2 items.
COMPUTE ipdispost1 = 2 * MEAN.1(ipdiexp1, ipdifir1).
COMPUTE ipdispost2 = 2 * MEAN.1(ipdiexp2, ipdifir2).
* Avoidance: 2 items.
COMPUTE ipdisavot1 = 2 * MEAN.1(ipdijok1, ipdiask1).
COMPUTE ipdisavot2 = 2 * MEAN.1(ipdijok2, ipdiask2).
EXECUTE.
iplecount

This is a count of the number of parent-reported life events. Note that the measure did not elicit information about positive or negative effects of each event, although most of those listed would normally be expected to have a negative effect. The measure asked about 17 types of event. The count has values 0 to 6, representing typical responses; a few extreme high outliers were recoded to value 6.

* Life events.
* Derive a count of reported life events.
* Most would normally have an adverse effect in most cases (deaths, separations, etc).
* while some could have positive or negative effects (new sibling, moved house, etc).
* but include them all anyway because there is no discriminating information.
* only derive count if the life events data are present - check first item.
* (items are either all present or all missing).
DO IF (iplehos1 >= 0).
  * most have value 1 if reported but ipleoth may have values 1/2/3.
  COUNT iplecount = iplehos1 iplehos2 iplehosp iplehoss ipledthg iplesepp ipledtho 
    iplenewp iplenewc ipledivp iplebirs iplemovh ipleillr iplefind ipleoth (1 THRU HIGHEST).
END IF.
EXECUTE.
* Negligible numbers above 6 so combine these.
RECODE iplecount (6 THRU HIGHEST=6).
EXECUTE.
ipliaca1/2, iplieng1/2, iplimat1/2, ipliphy1/2, iplisci1/2

See icliaca1/2, etc above.

ipmoaca1/2

See icmoaca1/2, etc above.

ipoddt1/2

See iccoddt1/2, etc above.

ippaaca1/2, ippaeng1/2, ippamat1/2, ippaphy1/2, ippasci1/2

See icpaaca1/2, etc above.

ipparnegt1/2, ipparpost1/2, ippart1/2

Parental feelings scales (parent-reported).
Subscales for negative feelings (ipparnegt, 4 items) and positive feelings (ipparpost, 3 items), and an overall total scale (ippart) from all 7 items. The total scale is coded in the direction of negative feelings, so it uses the reversed versions of the positive-feelings items. Each item is coded 0/1/2, so each scale has values ranging from 0 to two times the number of component items.

* Negative feelings: 4 items.
COMPUTE ipparnegt1 = 4 * MEAN.2(ipbpimp1, ipbpalo1, ipbpang1, ipbpfru1).
COMPUTE ipparnegt2 = 4 * MEAN.2(ipbpimp2, ipbpalo2, ipbpang2, ipbpfru2).
EXECUTE.
* Positive feelings: 3 items.
COMPUTE ipparpost1 = 3 * MEAN.2(ipbphap1, ipbpamu1, ipbpclo1).
COMPUTE ipparpost2 = 3 * MEAN.2(ipbphap2, ipbpamu2, ipbpclo2).
EXECUTE.
* Total scale: all 7 items, coded in the negative feelings direction.
* so use the reversed versions of the positive feelings items.
COMPUTE ippart1 = 7 * MEAN.4(ipbpimp1, ipbphar1, ipbpamr1,
 ipbpalo1, ipbpang1, ipbpclr1, ipbpfru1) .
COMPUTE ippart2 = 7 * MEAN.4(ipbpimp2, ipbphar2, ipbpamr2,
 ipbpalo2, ipbpang2, ipbpclr2, ipbpfru2) .
EXECUTE.
ippagt1/2, itpagt1/2

Proactive Aggression scales.
Parent and teacher versions.
Derived from 3 proactive aggression items, requiring at least 2 items to be non-missing.

* Total score out of 6 - need at least 2 items.
COMPUTE ippagt1 = 3 * MEAN.2(ippag11, ippag21, ippag31).
COMPUTE ippagt2 = 3 * MEAN.2(ippag12, ippag22, ippag32).
COMPUTE itpagt1 = 3 * MEAN.2(itpag11, itpag21, itpag31).
EXECUTE.
ipragt1/2, itragt1/2

Reactive Aggression scales.
Parent and teacher versions.
Derived from 3 reactive aggression items, requiring at least 2 items to be non-missing.

* Total score out of 6 - need at least 2 items.
COMPUTE ipragt1 = 3 * MEAN.2(iprag11, iprag21, iprag31).
COMPUTE ipragt2 = 3 * MEAN.2(iprag12, iprag22, iprag32).
COMPUTE itragt1 = 3 * MEAN.2(itrag11, itrag21, itrag31).
EXECUTE.
iprelldlang, iprelldread

Numbers of reported relatives having language difficulties (iprelldlang) and reading problems (iprelldread). Derived from 10-item measure in the parent booklet, asking about different specific groups of twin relatives. The numbers are grouped into categories for the higher ranges, hence these scales are ordinal in nature.

* Relatives with learning difficulties.
* Derive counts of the reported relatives who had language problems and reading.
* difficulties respectively.
* There are 10 items for 10 specific relatives.
* Each item is coded 1=language prob, 2=reading prob, 3=both, 4=neither.
* Item responses are either all present or all missing.
* so check that first item is non-missing before counting.
DO IF (ipmumld > 0).
 COUNT iprelldlang = ipmumld ipdadld ipmgmld ippgmld ipmgfld ippgfld 
 iposbld ipossld ipysbld ipyssld (1,3).
 COUNT iprelldread = ipmumld ipdadld ipmgmld ippgmld ipmgfld ippgfld 
 iposbld ipossld ipysbld ipyssld (2,3).
END IF.
EXECUTE.
* Numbers decline in higher range: recode to categories.
RECODE iprelldlang iprelldread (0=0) (1=1) (2=2) (3=3) (4 THRU 6=4) (7 THRU HIGHEST=5).
EXECUTE.
ipsdqanxt1/2

See icsdqanxt1/2, etc above.

ipsdqbeht1/2

See icsdqbeht1/2, etc above.

ipsdqcont1/2

See icsdqcont1/2, etc above.

ipsdqhypt1/2

See icsdqhypt1/2, etc above.

ipsdqpert1/2

See icsdqpert1/2, etc above.

ipsdqprot1/2

See icsdqprot1/2, etc above.

it2ac1/2, it3ac1/2, iteng1/2, itmat1/2, itsci1/2

Mean teacher-assessed National Curriculum levels for twins, from teacher questionnaire data. Each of the mean levels for English (iteng), maths (itmat) and science (itsci) is the mean of 3 component levels that were reported by the teacher. The overall 2-subject (it2ac, English and maths) and 3-subject (it3ac, English and maths and science) means are then derived from the subject means.
These means are designed to replace standardised versions which have been used historically.

* Non-standardised achievement means.
* The standardised means have been used historically.
* but simpler mean achievement levels can be used instead.
* and have the benefit of retaining the National Curriculum levels as scores.
* which should be equivalent across ages (7 to 14 in TEDS).
* Derive means for English, maths, science and overall.
* Teacher-reported English, maths, science: mean of component reported levels.
COMPUTE iteng1 = MEAN(itengsp1, itengre1, itengwr1).
COMPUTE itmat1 = MEAN(itmatus1, itmatnu1, itmatsh1).
COMPUTE itsci1 = MEAN(itscisc1, itscili1, itsciph1).
EXECUTE.
* 2-subject (English and maths) overall achievement.
* requiring both to be non-missing.
COMPUTE it2ac1 = MEAN.2(iteng1, itmat1).
EXECUTE.
* 3-subject (English, maths, science) overall achievement.
* requiring all three to be non-missing.
COMPUTE it3ac1 = MEAN.3(iteng1, itmat1, itsci1).
EXECUTE.
itage1/2

Age of twins when the teacher booklets were returned.
Derived from date variables, which are not retained in the dataset.

* First get best estimates of date, dealing with missing data.
* Teacher questionnaire date: use logged return date if available.
COMPUTE itdate1 = itrdate1.
* If missing, use the co-twin's teacher return date.
IF (SYSMIS(itrdate1)) itdate1 = itrdate2.
EXECUTE.
* If still missing, approximate with the parent/twin booklet date.
IF (SYSMIS(itdate1)) itdate1 = icpdate.
EXECUTE.
* Set back to missing if there is no teacher data.
DO IF (itdata1 = 0).
  RECODE itdate1 (ELSE=SYSMIS).
END IF.
EXECUTE.

* Now derive age by subtracting twin birth date.
COMPUTE itage1 = RND((DATEDIFF(itdate1, aonsdob, "days")) / 365.25, 0.1).
EXECUTE.
itLLCage1/2, itLLCdate1/2

See icpLLCage, etc above.

itapscalt1/2

See ipapscalt1/2, etc above.

itapsdt1/2

See ipadsdt1/2, etc above.

itapsecalt1/2

See ipapsecalt1/2, etc above.

itapsimpt1/2

See ipapsimpt1/2, etc above.

itapsnart1/2

See ipapsnart1/2, etc above.

itcascomt1/2

See iccascomt1/2, etc above.

itcasnont1/2

See iccasnont1/2, etc above.

itcassoct1/2

See iccassoct1/2, etc above.

itcastt1/2

See iccastt1/2, etc above.

itcpeer1/2

See iccpeer1/2, etc above.

itcsati1/2

See iccsati1/2, etc above.

iteng1/2

See it2ac1/2 etc above.

itliaca1/2, itlieng1/2, itlimat1/2, itliphy1/2, itlisci1/2

See icliaca1/2, etc above.

itmat1/2

See it2ac1/2 etc above.

itmoaca1/2

See icmoaca1/2, etc above.

itoddt1/2

See iccoddt1/2, etc above.

itpaaca1/2, itpaeng1/2, itpamat1/2, itpaphy1/2, itpasci1/2

See icpaaca1/2, etc above.

itpagt1/2

See ippagt1/2, etc above.

itragt1/2

See ipragt1/2, etc above.

itsci1/2

See it2ac1/2 etc above.

itsdqanxt1/2

See icsdqanxt1/2, etc above.

itsdqbeht1/2

See icsdqbeht1/2, etc above.

itsdqcont1/2

See icsdqcont1/2, etc above.

itsdqhypt1/2

See icsdqhypt1/2, etc above.

itsdqpert1/2

See icsdqpert1/2, etc above.

itsdqprot1/2

See icsdqprot1/2, etc above.