TEDS Data Dictionary

Derived Variables in the 10 Year Dataset

This page gives a listing of derived variables in the 10 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 10 Year dataset. For information about such variables, see pages describing background variables, exclusions and scrambled IDs.

The variables from the twin web tests and from the teacher questionnaire 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

jarcort1/2, jarinct1/2, jartt1/2

Scores for the twin Author Recognition web test:
jarcort is the number of correct authors selected (0-21);
jarinct is the number of incorrect authors selected (0-21);
jartt is the overall total score, derived by subtracting the number of incorrect responses from the number of correct responses. There were 21 correct authors and 21 incorrect authors to choose from, so in theory this score could vary from -21 to +21. Each item (author) response is coded 1=selected, 0=not selected.

* Derive sums of correct and incorrect responses.
COMPUTE jarcort1 = SUM(ja01a1,ja04a1,ja08a1,ja10a1,ja11a1,ja12a1,ja15a1,ja18a1,ja20a1,
  ja22a1,ja24a1,ja25a1,ja26a1,ja28a1,ja30a1,ja31a1,ja32a1,ja33a1,ja37a1,ja38a1,ja41a1,ja42a1).
EXECUTE.
COMPUTE jarinct1 = SUM(ja02a1,ja03a1,ja05a1,ja06a1,ja07a1,ja09a1,ja13a1,ja14a1,ja16a1,ja17a1,
  ja19a1,ja21a1, ja23a1,ja27a1,ja29a1,ja34a1,ja35a1,ja36a1,ja39a1,ja40a1).
* The preferred total score is the number of correct responses minus the number of incorrect responses.
COMPUTE jartt1 = jarcort1 - jarinct1.
EXECUTE.
jcg1/2, jcnv1/2, jcvb1/2

Cognitive ability scales for twins, based on web test scores.
Jcg1/2 represents general cognitive ability or 'g'. Jcnv1/2 represents non-verbal cognitive ability. Jcvb1/2 represents verbal (or language) cognitive ability.
Each scale is computed as the standardized mean of appropriate adjusted and standardized web test scores. Standardization is carried out on a filtered sample in which all exclusions are removed.
The syntax below uses derived variables jvocta1/2, jgenta1/2, jravta1/2 and jpict1/2, all of which are described elsewhere on this page.

* Cognitive variables.
* ===================.
* These variables must be standardised on the non-excluded sample.
* So apply a filter before doing anything else.
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.

* First standardise the cognitive test scores.
* using adjusted scores where available.
DESCRIPTIVES
  VARIABLES=jvocta1 jgenta1 jpict1 jravta1 /SAVE .
 
* Cognitive composites.
* --------------------.
* Require all component variables to be non-missing.

* Verbal - mean of two standardised verbal test scores.
COMPUTE vb1 = MEAN.2(zjvocta1, zjgenta1) .
EXECUTE.

* Non-verbal - mean of two standardised non-verbal test scores.
COMPUTE nv1 = MEAN.2(zjpict1, zjravta1) .
EXECUTE.

* General cognitive ability (g) - mean of all 4 tests.
COMPUTE g1 = MEAN.4(zjvocta1, zjgenta1, zjpict1, zjravta1) .
EXECUTE.

* Standardise the new variables.
DESCRIPTIVES
  VARIABLES= g1 (jcg1) vb1 (jcvb1) nv1 (jcnv1) /SAVE .  

* The filter can now be removed.
FILTER OFF.
USE ALL.
EXECUTE .
jcstage1/2

Age of twin (in decimal years) when the web tests were started.
Derived from the start date of the PIAT test (jpstdt1/2) and the birth date of the twins (aonsdob, a temporary variable from admin data). These date variables are not retained in the dataset.

* Web age: from date when first test (PIAT) started.
COMPUTE jcstage1 = RND((DATEDIFF(jcstdt1, aonsdob, "days")) / 365.25, 0.1) .
EXECUTE.
jcstLLCage1/2, jcstLLCdate1/2, jtqLLCage1/2, jtqLLCdate1/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 start of twin web activities ('jcst') and for the return of the teacher questionnaire ('jtq').
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 jcstyear1 = XDATE.YEAR(jcstdt1).
COMPUTE jcstmonth1 = XDATE.MONTH(jcstdt1).
COMPUTE jtqyear1 = XDATE.YEAR(jtrdate1).
COMPUTE jtqmonth1 = XDATE.MONTH(jtrdate1).
COMPUTE jtqyear2 = XDATE.YEAR(jtrdate2).
COMPUTE jtqmonth2 = XDATE.MONTH(jtrdate2).
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 jcstLLCdate1 jtqLLCdate1 jtqLLCdate2 (A7).
IF (jcstmonth1 < 10) jcstLLCdate1 = CONCAT(STRING(jcstyear1, F4), '-0', STRING(jcstmonth1, F1)).
IF (jcstmonth1 >= 10) jcstLLCdate1 = CONCAT(STRING(jcstyear1, F4), '-', STRING(jcstmonth1, F2)).
IF (jtqmonth1 < 10) jtqLLCdate1 = CONCAT(STRING(jtqyear1, F4), '-0', STRING(jtqmonth1, F1)).
IF (jtqmonth1 >= 10) jtqLLCdate1 = CONCAT(STRING(jtqyear1, F4), '-', STRING(jtqmonth1, F2)).
IF (jtqmonth2 < 10) jtqLLCdate2 = CONCAT(STRING(jtqyear2, F4), '-0', STRING(jtqmonth2, F1)).
IF (jtqmonth2 >= 10) jtqLLCdate2 = CONCAT(STRING(jtqyear2, F4), '-', STRING(jtqmonth2, 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 jcstLLCage1 = (jcstmonth1 + (jcstyear1 * 12)) - (birthmonth + (birthyear * 12)).
COMPUTE jtqLLCage1 = (jtqmonth1 + (jtqyear1 * 12)) - (birthmonth + (birthyear * 12)).
COMPUTE jtqLLCage2 = (jtqmonth2 + (jtqyear2 * 12)) - (birthmonth + (birthyear * 12)).
EXECUTE.
jcvb1/2

See jcg1/2, etc above.

jgenkat1/2

Mean item answer time for the twin General Knowledge web test.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all 30 answer time item variables.
Computed as variable jgenkat1 in the syntax below, then copied into variable jgenkat2 on double entry.

COMPUTE jgenkat1 = MEAN(jg01at1, jg02at1, jg03at1, jg04at1, jg05at1, 	
 jg06at1, jg07at1, jg08at1, jg09at1, jg10at1, 	
 jg11at1, jg12at1, jg13at1, jg14at1, jg15at1, 	
 jg16at1, jg17at1, jg18at1, jg19at1, jg20at1, 	
 jg21at1, jg22at1, jg23at1, jg24at1, jg25at1, 	
 jg26at1, jg27at1, jg28at1, jg29at1, jg30at1).
jgent1/2

Total score for the twin General Knowledge web test.
This is the total score (0-30) computed as the sum of the item scores.
Computed as variable jgent1 in the syntax below, later copied into variable jgent2 on double entry.

* Sum out of 30 for all items.
COMPUTE jgent1 = SUM(jg01s1, jg02s1, jg03s1, jg04s1, jg05s1,
  jg06s1, jg07s1, jg08s1, jg09s1, jg10s1, jg11s1, jg12s1, jg13s1, 
  jg14s1, jg15s1, jg16s1, jg17s1, jg18s1, jg19s1, jg20s1, jg21s1, jg22s1, 
  jg23s1, jg24s1, jg25s1, jg26s1, jg27s1, jg28s1, jg29s1, jg30s1).
EXECUTE.
jgenta1/2

Adjusted total score for the twin General Knowledge web test.
This is a total score (0-30) computed as the sum of the "adjusted" item scores, taking the discontinue rule into account. For any item that was skipped because of the discontinue rule, the default item score of zero is replaced with the "chance" score for that item. In this test, the chance score is 1/4=0.25 for every item, because every item has four clickable responses, and random guessing will on average gain a score of 1/4.
The adjusted score is derived from the item responses and scores, after responses have been recoded to -2 for discontinued items.

* General knowledge.
* -----------------.
* Discontinued items are flagged with response values -2.
* Can discontinue any item except 2-6.
* All items have 4 response options.
* so the chance score is 0.25.
COMPUTE jg01s1a = jg01s1.
COMPUTE jg07s1a = jg07s1.
COMPUTE jg08s1a = jg08s1.
COMPUTE jg09s1a = jg09s1.
COMPUTE jg10s1a = jg10s1.
COMPUTE jg11s1a = jg11s1.
COMPUTE jg12s1a = jg12s1.
COMPUTE jg13s1a = jg13s1.
COMPUTE jg14s1a = jg14s1.
COMPUTE jg15s1a = jg15s1.
COMPUTE jg16s1a = jg16s1.
COMPUTE jg17s1a = jg17s1.
COMPUTE jg18s1a = jg18s1.
COMPUTE jg19s1a = jg19s1.
COMPUTE jg20s1a = jg20s1.
COMPUTE jg21s1a = jg21s1.
COMPUTE jg22s1a = jg22s1.
COMPUTE jg23s1a = jg23s1.
COMPUTE jg24s1a = jg24s1.
COMPUTE jg25s1a = jg25s1.
COMPUTE jg26s1a = jg26s1.
COMPUTE jg27s1a = jg27s1.
COMPUTE jg28s1a = jg28s1.
COMPUTE jg29s1a = jg29s1.
COMPUTE jg30s1a = jg30s1.
EXECUTE.
IF (jg01a1 = -2) jg01s1a = 0.25.
IF (jg07a1 = -2) jg07s1a = 0.25.
IF (jg08a1 = -2) jg08s1a = 0.25.
IF (jg09a1 = -2) jg09s1a = 0.25.
IF (jg10a1 = -2) jg10s1a = 0.25.
IF (jg11a1 = -2) jg11s1a = 0.25.
IF (jg12a1 = -2) jg12s1a = 0.25.
IF (jg13a1 = -2) jg13s1a = 0.25.
IF (jg14a1 = -2) jg14s1a = 0.25.
IF (jg15a1 = -2) jg15s1a = 0.25.
IF (jg16a1 = -2) jg16s1a = 0.25.
IF (jg17a1 = -2) jg17s1a = 0.25.
IF (jg18a1 = -2) jg18s1a = 0.25.
IF (jg19a1 = -2) jg19s1a = 0.25.
IF (jg20a1 = -2) jg20s1a = 0.25.
IF (jg21a1 = -2) jg21s1a = 0.25.
IF (jg22a1 = -2) jg22s1a = 0.25.
IF (jg23a1 = -2) jg23s1a = 0.25.
IF (jg24a1 = -2) jg24s1a = 0.25.
IF (jg25a1 = -2) jg25s1a = 0.25.
IF (jg26a1 = -2) jg26s1a = 0.25.
IF (jg27a1 = -2) jg27s1a = 0.25.
IF (jg28a1 = -2) jg28s1a = 0.25.
IF (jg29a1 = -2) jg29s1a = 0.25.
IF (jg30a1 = -2) jg30s1a = 0.25.
EXECUTE.
* Adjusted total score is the sum of the adjusted item.
* scores, plus the unadjusted scores for items 2-6.
COMPUTE jgenta1 = SUM(jg01s1a, jg02s1, jg03s1, jg04s1, jg05s1,
  jg06s1, jg07s1a, jg08s1a, jg09s1a, jg10s1a, jg11s1a, jg12s1a, jg13s1a, 
  jg14s1a, jg15s1a, jg16s1a, jg17s1a, jg18s1a, jg19s1a, jg20s1a, jg21s1a, jg22s1a, 
  jg23s1a, jg24s1a, jg25s1a, jg26s1a, jg27s1a, jg28s1a, jg29s1a, jg30s1a).
EXECUTE.
jlitenv1/2

Literacy environment scale.
From twin self-reported items in the web questionnaire.
Computed as variable jlitenv1 in the syntax below, later copied into variable jlitenv2 on double entry.

* Based on items from the web maths and reading questionnaire (child self-report).
* Require at least 3 of the 5 items, each of which has values 1-4.
COMPUTE jlitenv1 = MEAN.3(jq11a1,jq12a1,jq13a1,jq14a1,jq15a1).
EXECUTE.
jmatenv1/2

Mathematics environment scale.
From twin self-reported items in the web questionnaire.
Computed as variable jmatenv1 in the syntax below, later copied into variable jmatenv2 on double entry.

* Based on items from the web maths and reading questionnaire (child self-report).
* Require at least 2 of the 3 items, each of which has values 1-4.
COMPUTE jmatenv1 = MEAN.2(jq07a1,jq08a1,jq09a1).
EXECUTE. 
jmathat1/2

Mean item answer time for the twin Mathematics web test.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all answer time item variables.
Computed as variable jmathat1 in the syntax below, then copied into variable jmathat2 on double entry.

COMPUTE jmathat1 = MEAN(jm1101t1, jm1201t1, jm1202t1, jm1203t1,
 jm1301t1, jm1302t1, jm1303t1, jm1304t1, jm1401t1, jm1402t1,
 jm1403t1, jm1404t1, jm1501t1, jm1502t1, jm1503t1, jm1504t1,
 jm1505t1, jm1506t1, jm1507t1, jm1601t1, jm1602t1, jm1603t1,
 jm1604t1, jm1701t1, jm1702t1, jm1703t1, jm1704t1, jm2101t1,
 jm2201t1, jm2202t1, jm2203t1, jm2204t1, jm2301t1, jm2501t1,
 jm2502t1, jm2503t1, jm2504t1, jm2505t1, jm2601t1, jm2602t1,
 jm2603t1, jm2604t1, jm2605t1, jm2606t1, jm2701t1, jm2801t1,
 jm3101t1, jm3201t1, jm3202t1, jm3203t1, jm3204t1, jm3205t1,
 jm3301t1, jm3302t1, jm3303t1, jm3401t1, jm3402t1, jm3403t1,
 jm3404t1, jm3405t1, jm3406t1, jm3407t1, jm3408t1, jm3501t1,
 jm3502t1, jm3503t1, jm3504t1, jm3505t1, jm3506t1, jm3601t1,
 jm3602t1, jm3603t1, jm3604t1, jm3605t1, jm3701t1, jm3702t1,
 jm3703t1, jm4101t1, jm4201t1, jm4202t1, jm4203t1, jm4301t1,
 jm4302t1, jm4303t1, jm4304t1, jm4305t1, jm4306t1, jm4307t1,
 jm4308t1, jm4309t1, jm4310t1, jm4311t1, jm4401t1, jm4402t1,
 jm4403t1, jm4404t1, jm4405t1, jm4406t1, jm4407t1, jm4408t1,
 jm4409t1, jm4410t1, jm4411t1, jm4501t1, jm4502t1, jm4601t1,
 jm4602t1, jm4603t1, jm4701t1, jm4702t1, jm5101t1, jm5201t1,
 jm5202t1, jm5301t1, jm5302t1, jm5401t1, jm5402t1, jm5501t1,
 jm5502t1, jm5503t1, jm5504t1, jm5505t1, jm5506t1, jm5601t1,
 jm5602t1, jm5603t1, jm5604t1, jm5701t1, jm5702t1, jm5703t1,
 jm5704t1, jm5705t1, jm5706t1, jm5707t1).
jmatt1/2, jmcat1t1/2, jmcat2t1/2, jmcat3t1/2, jmcat4t1/2, jmcat5t1/2

Total scores for the twin Mathematics web test.
The overall total, for the entire test, is computed in variable jmatt1/2.
Scores for sub-test categories 1-5 are computed in variables jmcatXt1/2, where X is the number 1/2/3/4/5 representing the sub-test category.
These variables are total scores computed as the sums of the appropriate item scores.
Sub-test categories 4 and 5 were dropped after cohort 1, so scores for these two categories are missing for cohort 2 twins. For consistency across the entire TEDS sample, the total score jmatt1/2 has been computed from sub-test categories 1-3 only.
Note that the score is derived after crediting of items to take account of branching rules. (In the raw data from the web server, item scores are missing for items skipped due to upward branching; each such missing item score is recoded to 1, as though answered correctly, in syntax that is not shown here.)

* Compute total score for each maths sub-test (category).
COMPUTE jmcat1t1 = SUM(jm1101s1, jm1201s1, jm1202s1, jm1203s1,
  jm1301s1, jm1302s1, jm1303s1, jm1304s1, jm1401s1, jm1402s1, jm1403s1, jm1404s1, 
  jm1501s1, jm1502s1, jm1503s1, jm1504s1, jm1505s1, jm1506s1, jm1507s1, jm1601s1, 
  jm1602s1, jm1603s1, jm1604s1, jm1701s1, jm1702s1, jm1703s1, jm1704s1).
COMPUTE jmcat2t1 = SUM(jm2101s1, jm2201s1, jm2202s1, jm2203s1, 
  jm2204s1, jm2301s1, jm2501s1, jm2502s1, jm2503s1, jm2504s1, jm2505s1, jm2601s1, 
  jm2602s1, jm2603s1, jm2604s1, jm2605s1, jm2606s1, jm2701s1, jm2801s1).
COMPUTE jmcat3t1 = SUM(jm3101s1, jm3201s1, jm3202s1, jm3203s1, 
  jm3204s1, jm3205s1, jm3301s1, jm3302s1, jm3303s1, jm3401s1, jm3402s1, jm3403s1, 
  jm3404s1, jm3405s1, jm3406s1, jm3407s1, jm3408s1, jm3501s1, jm3502s1, jm3503s1, 
  jm3504s1, jm3505s1, jm3506s1, jm3601s1, jm3602s1, jm3603s1, jm3604s1, jm3605s1, 
  jm3701s1, jm3702s1, jm3703s1).
COMPUTE jmcat4t1 = SUM(jm4101s1, jm4201s1, jm4202s1, jm4203s1, 
  jm4301s1, jm4302s1, jm4303s1, jm4304s1, jm4305s1, jm4306s1, jm4307s1, jm4308s1, 
  jm4309s1, jm4310s1, jm4311s1, jm4401s1, jm4402s1, jm4403s1, jm4404s1, jm4405s1, 
  jm4406s1, jm4407s1, jm4408s1, jm4409s1, jm4410s1, jm4411s1, jm4501s1, jm4502s1, 
  jm4601s1, jm4602s1, jm4603s1, jm4701s1, jm4702s1).
COMPUTE jmcat5t1 = SUM(jm5101s1, jm5201s1, jm5202s1, jm5301s1, 
  jm5302s1, jm5401s1, jm5402s1, jm5501s1, jm5502s1, jm5503s1, jm5504s1, jm5505s1, 
  jm5506s1, jm5601s1, jm5602s1, jm5603s1, jm5604s1, jm5701s1, jm5702s1, jm5703s1, 
  jm5704s1, jm5705s1, jm5706s1, jm5707s1).
EXECUTE.

* And compute overall total for maths.
* Exclude sub-tests 4 and 5, because they were dropped before cohort 2.
COMPUTE jmatt1 = SUM(jmcat1t1, jmcat2t1, jmcat3t1).
EXECUTE.
jmatta1/2

Adjusted total score for the twin Maths web test.
This is a total score (0-77) computed as the sum of the "adjusted" item scores, taking the discontinue rule into account. For any item that was skipped because of the discontinue rule, the default item score of zero is replaced with the "chance" score for that item. In this test, the chance score varies between items according to the number of clickable responses. Note that the chance score is assumed effectively to be zero for many items, where twins are required to type in responses from the keyboard, or where there are many permutations of clickable response options (see comments in syntax).
The adjusted score is derived from the item responses and scores, after response strings have been recoded to '-2' for discontinued items.
As in the unadjusted total score, only items from subtests 1 to 3 are included, because subtests 4 and 5 were dropped after cohort 1.

* Maths.
* -----.
* Discontinue rules apply after basal points in each subtest.
* so only some items are affected.
* Chance scores vary from item to item due to different response formats.
* Where twins have to type in numeric answers, the chance score is effectively zero.
* So chance scores only apply where twins can click on multiple choices.
* hence are only used in the items listed below.
* Also, ignore items in which permutations of responses mean that.
* the chance score is less than 0.1.
* Also, ignore subtests 4/5 as these do not contribute to total score.
* Discontinued items are flagged using string '-2' in the answer variables.
COMPUTE jm1303s1a = jm1303s1.
COMPUTE jm1404s1a = jm1404s1.
COMPUTE jm1505s1a = jm1505s1.
COMPUTE jm1506s1a = jm1506s1.
COMPUTE jm1507s1a = jm1507s1.
COMPUTE jm1602s1a = jm1602s1.
COMPUTE jm1701s1a = jm1701s1.
COMPUTE jm1704s1a = jm1704s1.
COMPUTE jm2203s1a = jm2203s1.
COMPUTE jm2301s1a = jm2301s1.
COMPUTE jm2504s1a = jm2504s1.
COMPUTE jm2601s1a = jm2601s1.
COMPUTE jm2603s1a = jm2603s1.
COMPUTE jm2604s1a = jm2604s1.
COMPUTE jm2605s1a = jm2605s1.
COMPUTE jm2606s1a = jm2606s1.
COMPUTE jm3406s1a = jm3406s1.
COMPUTE jm3407s1a = jm3407s1.
COMPUTE jm3504s1a = jm3504s1.
COMPUTE jm3505s1a = jm3505s1.
COMPUTE jm3604s1a = jm3604s1.
COMPUTE jm3605s1a = jm3605s1.
EXECUTE.
IF (jm1303a1 = '-2') jm1303s1a = 0.2.
IF (jm1404a1 = '-2') jm1404s1a = 0.2.
IF (jm1505a1 = '-2') jm1505s1a = 0.2.
IF (jm1506a1 = '-2') jm1506s1a = 0.33.
IF (jm1507a1 = '-2') jm1507s1a = 0.25.
IF (jm1602a1 = '-2') jm1602s1a = 0.2.
IF (jm1701a1 = '-2') jm1701s1a = 0.2.
IF (jm1704a1 = '-2') jm1704s1a = 0.2.
IF (jm2203a1 = '-2') jm2203s1a = 0.2.
IF (jm2301a1 = '-2') jm2301s1a = 0.2.
IF (jm2504a1 = '-2') jm2504s1a = 0.1.
IF (jm2601a1 = '-2') jm2601s1a = 0.33.
IF (jm2603a1 = '-2') jm2603s1a = 0.25.
IF (jm2604a1 = '-2') jm2604s1a = 0.1.
IF (jm2605a1 = '-2') jm2605s1a = 0.25.
IF (jm2606a1 = '-2') jm2606s1a = 0.2.
IF (jm3406a1 = '-2') jm3406s1a = 0.2.
IF (jm3407a1 = '-2') jm3407s1a = 0.2.
IF (jm3504a1 = '-2') jm3504s1a = 0.2.
IF (jm3505a1 = '-2') jm3505s1a = 0.2.
IF (jm3604a1 = '-2') jm3604s1a = 0.2.
IF (jm3605a1 = '-2') jm3605s1a = 0.2.
EXECUTE.
* Compute adjusted total score as the sum of the item scores.
* (subtests 1-3), using adjusted item scores where available.
COMPUTE jmatta1 = SUM(jm1101s1, jm1201s1, jm1202s1, jm1203s1,
  jm1301s1, jm1302s1, jm1303s1a, jm1304s1, jm1401s1, jm1402s1, jm1403s1, jm1404s1a, 
  jm1501s1, jm1502s1, jm1503s1, jm1504s1, jm1505s1a, jm1506s1a, jm1507s1a, jm1601s1, 
  jm1602s1a, jm1603s1, jm1604s1, jm1701s1a, jm1702s1, jm1703s1, jm1704s1a,
 jm2101s1, jm2201s1, jm2202s1, jm2203s1a, 
  jm2204s1, jm2301s1a, jm2501s1, jm2502s1, jm2503s1, jm2504s1a, jm2505s1, jm2601s1a, 
  jm2602s1, jm2603s1a, jm2604s1a, jm2605s1a, jm2606s1a, jm2701s1, jm2801s1,
 jm3101s1, jm3201s1, jm3202s1, jm3203s1, 
  jm3204s1, jm3205s1, jm3301s1, jm3302s1, jm3303s1, jm3401s1, jm3402s1, jm3403s1, 
  jm3404s1, jm3405s1, jm3406s1a, jm3407s1a, jm3408s1, jm3501s1, jm3502s1, jm3503s1, 
  jm3504s1a, jm3505s1a, jm3506s1, jm3601s1, jm3602s1, jm3603s1, jm3604s1a, jm3605s1a, 
  jm3701s1, jm3702s1, jm3703s1).
EXECUTE.
jpiatat1/2

Mean item answer time for the twin PIAT web test.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all answer time item variables.
Computed as variable jpiatat1 in the syntax below, then copied into variable jpiatat2 on double entry.

COMPUTE jpiatat1 = MEAN(jpr4at1, jpr5at1, 
 jpp1at1, jpp2at1, jpp3at1, jpp4at1, jpp5at1, 
 jpt19at1, jpt20at1, jpt21at1, jpt22at1, jpt23at1, jpt24at1, 	
 jpt25at1, jpt26at1, jpt27at1, jpt28at1, jpt29at1, jpt30at1, 	
 jpt31at1, jpt32at1, jpt33at1, jpt34at1, jpt35at1, jpt36at1, 	
 jpt37at1, jpt38at1, jpt39at1, jpt40at1, jpt41at1, jpt42at1, 	
 jpt43at1, jpt44at1, jpt45at1, jpt46at1, jpt47at1, jpt48at1, 	
 jpt49at1, jpt50at1, jpt51at1, jpt52at1, jpt53at1, jpt54at1, 	
 jpt55at1, jpt56at1, jpt57at1, jpt58at1, jpt59at1, jpt60at1, 	
 jpt61at1, jpt62at1, jpt63at1, jpt64at1, jpt65at1, jpt66at1, 	
 jpt67at1, jpt68at1, jpt69at1, jpt70at1, jpt71at1, jpt72at1, 	
 jpt73at1, jpt74at1, jpt75at1, jpt76at1, jpt77at1, jpt78at1, 	
 jpt79at1, jpt80at1, jpt81at1, jpt82at1, jpt83at1, jpt84at1, 	
 jpt85at1, jpt86at1, jpt87at1, jpt88at1, jpt89at1, jpt90at1, 	
 jpt91at1, jpt92at1, jpt93at1, jpt94at1, jpt95at1, jpt96at1, 	
 jpt97at1, jpt98at1, jpt99at1, jpt100t1).
jpiatt1/2

Total score for the twin PIAT web test.
This is the total score (0-82) computed as the sum of the item scores for items 19-100 (the initial practice items r4, r5 and p1-p5 are not included in the score).
Note that the score is derived after crediting of items to take account of branching rules. (In the raw data from the web server, item scores are missing for items skipped due to upward branching; each such missing item score is recoded to 1, as though answered correctly, in syntax that is not shown here.)

* Compute total score out of 82 for all items except for practice items.
COMPUTE jpiatt1 = SUM(jpt19s1, jpt20s1, jpt21s1, jpt22s1, jpt23s1, 
  jpt24s1, jpt25s1, jpt26s1, jpt27s1, jpt28s1, jpt29s1, jpt30s1, jpt31s1, 
  jpt32s1, jpt33s1, jpt34s1, jpt35s1, jpt36s1, jpt37s1, jpt38s1, jpt39s1, 
  jpt40s1, jpt41s1, jpt42s1, jpt43s1, jpt44s1, jpt45s1, jpt46s1, jpt47s1, 
  jpt48s1, jpt49s1, jpt50s1, jpt51s1, jpt52s1, jpt53s1, jpt54s1, jpt55s1, 
  jpt56s1, jpt57s1, jpt58s1, jpt59s1, jpt60s1, jpt61s1, jpt62s1, jpt63s1, 
  jpt64s1, jpt65s1, jpt66s1, jpt67s1, jpt68s1, jpt69s1, jpt70s1, jpt71s1, 
  jpt72s1, jpt73s1, jpt74s1, jpt75s1, jpt76s1, jpt77s1, jpt78s1, jpt79s1, 
  jpt80s1, jpt81s1, jpt82s1, jpt83s1, jpt84s1, jpt85s1, jpt86s1, jpt87s1, 
  jpt88s1, jpt89s1, jpt90s1, jpt91s1, jpt92s1, jpt93s1, jpt94s1, jpt95s1, 
  jpt96s1, jpt97s1, jpt98s1, jpt99s1, jpt100s1).
EXECUTE.
jpiatta1/2

Adjusted total score for the twin PIAT web test.
This is a total score (0-82) computed as the sum of the "adjusted" item scores, taking the discontinue rule into account. For any item that was skipped because of the discontinue rule, the default item score of zero is replaced with the "chance" score for that item. In this test, the chance score is 1/4=0.25 for every item, because every item has four clickable responses, and random guessing will on average gain a score of 1/4.
The adjusted score is derived from the item responses and scores, after responses have been recoded to -2 for discontinued items.
As in the unadjusted total score, only items 19-100 are included (the initial practice items r4, r5 and p1-p5 are not included in the score).

* PIAT.
* ----.
* In theory, can discontinue from item t24 onwards.
* Copy existing item scores into temporary variables.
* but where discontinued, replace score of 0 with score of 0.25.
* (each item has 4 possible responses, so chance score is 1/4).
COMPUTE jpt24s1a = jpt24s1.
COMPUTE jpt25s1a = jpt25s1.
COMPUTE jpt26s1a = jpt26s1.
COMPUTE jpt27s1a = jpt27s1.
COMPUTE jpt28s1a = jpt28s1.
COMPUTE jpt29s1a = jpt29s1.
COMPUTE jpt30s1a = jpt30s1.
COMPUTE jpt31s1a = jpt31s1.
COMPUTE jpt32s1a = jpt32s1.
COMPUTE jpt33s1a = jpt33s1.
COMPUTE jpt34s1a = jpt34s1.
COMPUTE jpt35s1a = jpt35s1.
COMPUTE jpt36s1a = jpt36s1.
COMPUTE jpt37s1a = jpt37s1.
COMPUTE jpt38s1a = jpt38s1.
COMPUTE jpt39s1a = jpt39s1.
COMPUTE jpt40s1a = jpt40s1.
COMPUTE jpt41s1a = jpt41s1.
COMPUTE jpt42s1a = jpt42s1.
COMPUTE jpt43s1a = jpt43s1.
COMPUTE jpt44s1a = jpt44s1.
COMPUTE jpt45s1a = jpt45s1.
COMPUTE jpt46s1a = jpt46s1.
COMPUTE jpt47s1a = jpt47s1.
COMPUTE jpt48s1a = jpt48s1.
COMPUTE jpt49s1a = jpt49s1.
COMPUTE jpt50s1a = jpt50s1.
COMPUTE jpt51s1a = jpt51s1.
COMPUTE jpt52s1a = jpt52s1.
COMPUTE jpt53s1a = jpt53s1.
COMPUTE jpt54s1a = jpt54s1.
COMPUTE jpt55s1a = jpt55s1.
COMPUTE jpt56s1a = jpt56s1.
COMPUTE jpt57s1a = jpt57s1.
COMPUTE jpt58s1a = jpt58s1.
COMPUTE jpt59s1a = jpt59s1.
COMPUTE jpt60s1a = jpt60s1.
COMPUTE jpt61s1a = jpt61s1.
COMPUTE jpt62s1a = jpt62s1.
COMPUTE jpt63s1a = jpt63s1.
COMPUTE jpt64s1a = jpt64s1.
COMPUTE jpt65s1a = jpt65s1.
COMPUTE jpt66s1a = jpt66s1.
COMPUTE jpt67s1a = jpt67s1.
COMPUTE jpt68s1a = jpt68s1.
COMPUTE jpt69s1a = jpt69s1.
COMPUTE jpt70s1a = jpt70s1.
COMPUTE jpt71s1a = jpt71s1.
COMPUTE jpt72s1a = jpt72s1.
COMPUTE jpt73s1a = jpt73s1.
COMPUTE jpt74s1a = jpt74s1.
COMPUTE jpt75s1a = jpt75s1.
COMPUTE jpt76s1a = jpt76s1.
COMPUTE jpt77s1a = jpt77s1.
COMPUTE jpt78s1a = jpt78s1.
COMPUTE jpt79s1a = jpt79s1.
COMPUTE jpt80s1a = jpt80s1.
COMPUTE jpt81s1a = jpt81s1.
COMPUTE jpt82s1a = jpt82s1.
COMPUTE jpt83s1a = jpt83s1.
COMPUTE jpt84s1a = jpt84s1.
COMPUTE jpt85s1a = jpt85s1.
COMPUTE jpt86s1a = jpt86s1.
COMPUTE jpt87s1a = jpt87s1.
COMPUTE jpt88s1a = jpt88s1.
COMPUTE jpt89s1a = jpt89s1.
COMPUTE jpt90s1a = jpt90s1.
COMPUTE jpt91s1a = jpt91s1.
COMPUTE jpt92s1a = jpt92s1.
COMPUTE jpt93s1a = jpt93s1.
COMPUTE jpt94s1a = jpt94s1.
COMPUTE jpt95s1a = jpt95s1.
COMPUTE jpt96s1a = jpt96s1.
COMPUTE jpt97s1a = jpt97s1.
COMPUTE jpt98s1a = jpt98s1.
COMPUTE jpt99s1a = jpt99s1.
COMPUTE jpt100s1a = jpt100s1.
EXECUTE.
* Discontinued items are flagged with value -2 in the response.
IF (jpt24a1 = -2) jpt24s1a = 0.25.
IF (jpt25a1 = -2) jpt25s1a = 0.25.
IF (jpt26a1 = -2) jpt26s1a = 0.25.
IF (jpt27a1 = -2) jpt27s1a = 0.25.
IF (jpt28a1 = -2) jpt28s1a = 0.25.
IF (jpt29a1 = -2) jpt29s1a = 0.25.
IF (jpt30a1 = -2) jpt30s1a = 0.25.
IF (jpt31a1 = -2) jpt31s1a = 0.25.
IF (jpt32a1 = -2) jpt32s1a = 0.25.
IF (jpt33a1 = -2) jpt33s1a = 0.25.
IF (jpt34a1 = -2) jpt34s1a = 0.25.
IF (jpt35a1 = -2) jpt35s1a = 0.25.
IF (jpt36a1 = -2) jpt36s1a = 0.25.
IF (jpt37a1 = -2) jpt37s1a = 0.25.
IF (jpt38a1 = -2) jpt38s1a = 0.25.
IF (jpt39a1 = -2) jpt39s1a = 0.25.
IF (jpt40a1 = -2) jpt40s1a = 0.25.
IF (jpt41a1 = -2) jpt41s1a = 0.25.
IF (jpt42a1 = -2) jpt42s1a = 0.25.
IF (jpt43a1 = -2) jpt43s1a = 0.25.
IF (jpt44a1 = -2) jpt44s1a = 0.25.
IF (jpt45a1 = -2) jpt45s1a = 0.25.
IF (jpt46a1 = -2) jpt46s1a = 0.25.
IF (jpt47a1 = -2) jpt47s1a = 0.25.
IF (jpt48a1 = -2) jpt48s1a = 0.25.
IF (jpt49a1 = -2) jpt49s1a = 0.25.
IF (jpt50a1 = -2) jpt50s1a = 0.25.
IF (jpt51a1 = -2) jpt51s1a = 0.25.
IF (jpt52a1 = -2) jpt52s1a = 0.25.
IF (jpt53a1 = -2) jpt53s1a = 0.25.
IF (jpt54a1 = -2) jpt54s1a = 0.25.
IF (jpt55a1 = -2) jpt55s1a = 0.25.
IF (jpt56a1 = -2) jpt56s1a = 0.25.
IF (jpt57a1 = -2) jpt57s1a = 0.25.
IF (jpt58a1 = -2) jpt58s1a = 0.25.
IF (jpt59a1 = -2) jpt59s1a = 0.25.
IF (jpt60a1 = -2) jpt60s1a = 0.25.
IF (jpt61a1 = -2) jpt61s1a = 0.25.
IF (jpt62a1 = -2) jpt62s1a = 0.25.
IF (jpt63a1 = -2) jpt63s1a = 0.25.
IF (jpt64a1 = -2) jpt64s1a = 0.25.
IF (jpt65a1 = -2) jpt65s1a = 0.25.
IF (jpt66a1 = -2) jpt66s1a = 0.25.
IF (jpt67a1 = -2) jpt67s1a = 0.25.
IF (jpt68a1 = -2) jpt68s1a = 0.25.
IF (jpt69a1 = -2) jpt69s1a = 0.25.
IF (jpt70a1 = -2) jpt70s1a = 0.25.
IF (jpt71a1 = -2) jpt71s1a = 0.25.
IF (jpt72a1 = -2) jpt72s1a = 0.25.
IF (jpt73a1 = -2) jpt73s1a = 0.25.
IF (jpt74a1 = -2) jpt74s1a = 0.25.
IF (jpt75a1 = -2) jpt75s1a = 0.25.
IF (jpt76a1 = -2) jpt76s1a = 0.25.
IF (jpt77a1 = -2) jpt77s1a = 0.25.
IF (jpt78a1 = -2) jpt78s1a = 0.25.
IF (jpt79a1 = -2) jpt79s1a = 0.25.
IF (jpt80a1 = -2) jpt80s1a = 0.25.
IF (jpt81a1 = -2) jpt81s1a = 0.25.
IF (jpt82a1 = -2) jpt82s1a = 0.25.
IF (jpt83a1 = -2) jpt83s1a = 0.25.
IF (jpt84a1 = -2) jpt84s1a = 0.25.
IF (jpt85a1 = -2) jpt85s1a = 0.25.
IF (jpt86a1 = -2) jpt86s1a = 0.25.
IF (jpt87a1 = -2) jpt87s1a = 0.25.
IF (jpt88a1 = -2) jpt88s1a = 0.25.
IF (jpt89a1 = -2) jpt89s1a = 0.25.
IF (jpt90a1 = -2) jpt90s1a = 0.25.
IF (jpt91a1 = -2) jpt91s1a = 0.25.
IF (jpt92a1 = -2) jpt92s1a = 0.25.
IF (jpt93a1 = -2) jpt93s1a = 0.25.
IF (jpt94a1 = -2) jpt94s1a = 0.25.
IF (jpt95a1 = -2) jpt95s1a = 0.25.
IF (jpt96a1 = -2) jpt96s1a = 0.25.
IF (jpt97a1 = -2) jpt97s1a = 0.25.
IF (jpt98a1 = -2) jpt98s1a = 0.25.
IF (jpt99a1 = -2) jpt99s1a = 0.25.
IF (jpt100a1 = -2) jpt100s1a = 0.25.
EXECUTE.
* Compute total score out of 82 using original items 19-23.
* plus the new adjusted items 24-100.
COMPUTE jpiatta1 = SUM(jpt19s1, jpt20s1, jpt21s1, jpt22s1, jpt23s1, 
  jpt24s1a, jpt25s1a, jpt26s1a, jpt27s1a, jpt28s1a, jpt29s1a, jpt30s1a, jpt31s1a, 
  jpt32s1a, jpt33s1a, jpt34s1a, jpt35s1a, jpt36s1a, jpt37s1a, jpt38s1a, jpt39s1a, 
  jpt40s1a, jpt41s1a, jpt42s1a, jpt43s1a, jpt44s1a, jpt45s1a, jpt46s1a, jpt47s1a, 
  jpt48s1a, jpt49s1a, jpt50s1a, jpt51s1a, jpt52s1a, jpt53s1a, jpt54s1a, jpt55s1a, 
  jpt56s1a, jpt57s1a, jpt58s1a, jpt59s1a, jpt60s1a, jpt61s1a, jpt62s1a, jpt63s1a, 
  jpt64s1a, jpt65s1a, jpt66s1a, jpt67s1a, jpt68s1a, jpt69s1a, jpt70s1a, jpt71s1a, 
  jpt72s1a, jpt73s1a, jpt74s1a, jpt75s1a, jpt76s1a, jpt77s1a, jpt78s1a, jpt79s1a, 
  jpt80s1a, jpt81s1a, jpt82s1a, jpt83s1a, jpt84s1a, jpt85s1a, jpt86s1a, jpt87s1a, 
  jpt88s1a, jpt89s1a, jpt90s1a, jpt91s1a, jpt92s1a, jpt93s1a, jpt94s1a, jpt95s1a, 
  jpt96s1a, jpt97s1a, jpt98s1a, jpt99s1a, jpt100s1a).
EXECUTE.
jpicat1/2

Mean item answer time for the twin Picture Completion web test.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all 30 answer time item variables.
Computed as variable jpicat1 in the syntax below, then copied into variable jpicat2 on double entry.

COMPUTE jpicat1 = MEAN(jpc01at1, jpc02at1, jpc03at1, jpc04at1, jpc05at1, 	
 jpc06at1, jpc07at1, jpc08at1, jpc09at1, jpc10at1, 	
 jpc11at1, jpc12at1, jpc13at1, jpc14at1, jpc15at1, 	
 jpc16at1, jpc17at1, jpc18at1, jpc19at1, jpc20at1, 	
 jpc21at1, jpc22at1, jpc23at1, jpc24at1, jpc25at1, 	
 jpc26at1, jpc27at1, jpc28at1, jpc29at1, jpc30at1).
jpict1/2

Total score for the twin Picture Completion web test.
This is the total score (0-30) computed as the sum of the 30 item scores.
Computed as variable jpict1 in the syntax below, later copied into variable jpict2 on double entry.

* Sum out of 30 for all items except practice item.
COMPUTE jpict1 = SUM(jpc01s1, jpc02s1, jpc03s1, jpc04s1, jpc05s1, 
  jpc06s1, jpc07s1, jpc08s1, jpc09s1, jpc10s1, jpc11s1, jpc12s1, jpc13s1, 
  jpc14s1, jpc15s1, jpc16s1, jpc17s1, jpc18s1, jpc19s1, jpc20s1, jpc21s1, 
  jpc22s1, jpc23s1, jpc24s1, jpc25s1, jpc26s1, jpc27s1, jpc28s1, jpc29s1, jpc30s1).
EXECUTE.
jqnrat1/2

Mean item answer time for the twin web questionnaire.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all 16 answer time item variables.
Computed as variable jqnrat1 in the syntax below, then copied into variable jqnrat2 on double entry.

COMPUTE jqnrat1 = MEAN(jq01at1, jq02at1, jq03at1, jq04at1,
 jq05at1, jq06at1, jq07at1, jq08at1, jq09at1,
 jq10at1, jq11at1, jq12at1, jq13at1, jq14at1, jq15at1, jq16at1).
jravnat1/2

Mean item answer time for the twin Raven web test.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all 60 answer time item variables.
Computed as variable jravnat1 in the syntax below, then copied into variable jravnat2 on double entry.

COMPUTE jravnat1 = MEAN(jra01at1, jra02at1, jra03at1, jra04at1, jra05at1, jra06at1, 	
 jra07at1, jra08at1, jra09at1, jra10at1, jra11at1, jra12at1, 	
 jrb01at1, jrb02at1, jrb03at1, jrb04at1, jrb05at1, jrb06at1, 	
 jrb07at1, jrb08at1, jrb09at1, jrb10at1, jrb11at1, jrb12at1, 	
 jrc01at1, jrc02at1, jrc03at1, jrc04at1, jrc05at1, jrc06at1, 	
 jrc07at1, jrc08at1, jrc09at1, jrc10at1, jrc11at1, jrc12at1, 	
 jrd01at1, jrd02at1, jrd03at1, jrd04at1, jrd05at1, jrd06at1, 	
 jrd07at1, jrd08at1, jrd09at1, jrd10at1, jrd11at1, jrd12at1, 	
 jre01at1, jre02at1, jre03at1, jre04at1, jre05at1, jre06at1, 	
 jre07at1, jre08at1, jre09at1, jre10at1, jre11at1, jre12at1).
jravt1/2, jrcatat1/2, jrcatbt1/2, jrcatct1/2, jrcatdt1/2, jrcatet1/2

Total scores for the twin Ravens Matrices web test.
The overall total, for the entire test, is computed in variable jravt1/2.
Scores for sub-test categories A-E are computed in variables jrcatXt1/2, where X is the letter a/b/c/d/e representing the sub-test category.
These variables are total scores computed as the sums of the appropriate item scores.
The variables computed in the syntax below have names ending in 1; these variables are copied into equivalent variables for the co-twin, with names ending in 2, on double entry.

* Compute total score (out of 12) for each Raven sub-test.
COMPUTE jrcatat1 = SUM(jra01s1, jra02s1, jra03s1, jra04s1, jra05s1, 
  jra06s1, jra07s1, jra08s1, jra09s1, jra10s1, jra11s1, jra12s1).
COMPUTE jrcatbt1 = SUM(jrb01s1, jrb02s1, jrb03s1, jrb04s1, jrb05s1, 
  jrb06s1, jrb07s1, jrb08s1, jrb09s1, jrb10s1, jrb11s1, jrb12s1).
COMPUTE jrcatct1 = SUM(jrc01s1, jrc02s1, jrc03s1, jrc04s1, jrc05s1, 
  jrc06s1, jrc07s1, jrc08s1, jrc09s1, jrc10s1, jrc11s1, jrc12s1).
COMPUTE jrcatdt1 = SUM(jrd01s1, jrd02s1, jrd03s1, jrd04s1, jrd05s1, 
  jrd06s1, jrd07s1, jrd08s1, jrd09s1, jrd10s1, jrd11s1, jrd12s1). 
COMPUTE jrcatet1 = SUM(jre01s1, jre02s1, jre03s1, jre04s1, jre05s1, 
  jre06s1, jre07s1, jre08s1, jre09s1, jre10s1, jre11s1, jre12s1).
EXECUTE.

* And compute overall total out of 60.
COMPUTE jravt1 = SUM(jrcatat1, jrcatbt1, jrcatct1, jrcatdt1, jrcatet1).
EXECUTE.
jravta1/2

Adjusted total score for the twin Ravens web test.
This is a total score (0-60) computed as the sum of the "adjusted" item scores, taking the discontinue rule into account. For any item that was skipped because of the discontinue rule, the default item score of zero is replaced with the "chance" score for that item. In this test, the chance score is either 1/6 or 1/8 for every item, because every item has either six or eight clickable responses, and random guessing will on average gain a score of 1/6 or 1/8.
The adjusted score is derived from the item responses and scores, after responses have been recoded to -2 for discontinued items.

* Ravens.
* ------.
* Can discontinue items 4-12 within each subtest A-E.
* Discontinued items are flagged with response values -2.
* Chance score is 1/6 in subtests A/B, and 1/8 in subtests C/D/E.
COMPUTE jra04s1a = jra04s1.
COMPUTE jra05s1a = jra05s1.
COMPUTE jra06s1a = jra06s1.
COMPUTE jra07s1a = jra07s1.
COMPUTE jra08s1a = jra08s1.
COMPUTE jra09s1a = jra09s1.
COMPUTE jra10s1a = jra10s1.
COMPUTE jra11s1a = jra11s1.
COMPUTE jra12s1a = jra12s1.
COMPUTE jrb04s1a = jrb04s1.
COMPUTE jrb05s1a = jrb05s1.
COMPUTE jrb06s1a = jrb06s1.
COMPUTE jrb07s1a = jrb07s1.
COMPUTE jrb08s1a = jrb08s1.
COMPUTE jrb09s1a = jrb09s1.
COMPUTE jrb10s1a = jrb10s1.
COMPUTE jrb11s1a = jrb11s1.
COMPUTE jrb12s1a = jrb12s1.
COMPUTE jrc04s1a = jrc04s1.
COMPUTE jrc05s1a = jrc05s1.
COMPUTE jrc06s1a = jrc06s1.
COMPUTE jrc07s1a = jrc07s1.
COMPUTE jrc08s1a = jrc08s1.
COMPUTE jrc09s1a = jrc09s1.
COMPUTE jrc10s1a = jrc10s1.
COMPUTE jrc11s1a = jrc11s1.
COMPUTE jrc12s1a = jrc12s1.
COMPUTE jrd04s1a = jrd04s1.
COMPUTE jrd05s1a = jrd05s1.
COMPUTE jrd06s1a = jrd06s1.
COMPUTE jrd07s1a = jrd07s1.
COMPUTE jrd08s1a = jrd08s1.
COMPUTE jrd09s1a = jrd09s1.
COMPUTE jrd10s1a = jrd10s1.
COMPUTE jrd11s1a = jrd11s1.
COMPUTE jrd12s1a = jrd12s1.
COMPUTE jre04s1a = jre04s1.
COMPUTE jre05s1a = jre05s1.
COMPUTE jre06s1a = jre06s1.
COMPUTE jre07s1a = jre07s1.
COMPUTE jre08s1a = jre08s1.
COMPUTE jre09s1a = jre09s1.
COMPUTE jre10s1a = jre10s1.
COMPUTE jre11s1a = jre11s1.
COMPUTE jre12s1a = jre12s1.
EXECUTE.
IF (jra04a1 = -2) jra04s1a = (1 / 6).
IF (jra05a1 = -2) jra05s1a = (1 / 6).
IF (jra06a1 = -2) jra06s1a = (1 / 6).
IF (jra07a1 = -2) jra07s1a = (1 / 6).
IF (jra08a1 = -2) jra08s1a = (1 / 6).
IF (jra09a1 = -2) jra09s1a = (1 / 6).
IF (jra10a1 = -2) jra10s1a = (1 / 6).
IF (jra11a1 = -2) jra11s1a = (1 / 6).
IF (jra12a1 = -2) jra12s1a = (1 / 6).
IF (jrb04a1 = -2) jrb04s1a = (1 / 6).
IF (jrb05a1 = -2) jrb05s1a = (1 / 6).
IF (jrb06a1 = -2) jrb06s1a = (1 / 6).
IF (jrb07a1 = -2) jrb07s1a = (1 / 6).
IF (jrb08a1 = -2) jrb08s1a = (1 / 6).
IF (jrb09a1 = -2) jrb09s1a = (1 / 6).
IF (jrb10a1 = -2) jrb10s1a = (1 / 6).
IF (jrb11a1 = -2) jrb11s1a = (1 / 6).
IF (jrb12a1 = -2) jrb12s1a = (1 / 6).
IF (jrc04a1 = -2) jrc04s1a = (1 / 8).
IF (jrc05a1 = -2) jrc05s1a = (1 / 8).
IF (jrc06a1 = -2) jrc06s1a = (1 / 8).
IF (jrc07a1 = -2) jrc07s1a = (1 / 8).
IF (jrc08a1 = -2) jrc08s1a = (1 / 8).
IF (jrc09a1 = -2) jrc09s1a = (1 / 8).
IF (jrc10a1 = -2) jrc10s1a = (1 / 8).
IF (jrc11a1 = -2) jrc11s1a = (1 / 8).
IF (jrc12a1 = -2) jrc12s1a = (1 / 8).
IF (jrd04a1 = -2) jrd04s1a = (1 / 8).
IF (jrd05a1 = -2) jrd05s1a = (1 / 8).
IF (jrd06a1 = -2) jrd06s1a = (1 / 8).
IF (jrd07a1 = -2) jrd07s1a = (1 / 8).
IF (jrd08a1 = -2) jrd08s1a = (1 / 8).
IF (jrd09a1 = -2) jrd09s1a = (1 / 8).
IF (jrd10a1 = -2) jrd10s1a = (1 / 8).
IF (jrd11a1 = -2) jrd11s1a = (1 / 8).
IF (jrd12a1 = -2) jrd12s1a = (1 / 8).
IF (jre04a1 = -2) jre04s1a = (1 / 8).
IF (jre05a1 = -2) jre05s1a = (1 / 8).
IF (jre06a1 = -2) jre06s1a = (1 / 8).
IF (jre07a1 = -2) jre07s1a = (1 / 8).
IF (jre08a1 = -2) jre08s1a = (1 / 8).
IF (jre09a1 = -2) jre09s1a = (1 / 8).
IF (jre10a1 = -2) jre10s1a = (1 / 8).
IF (jre11a1 = -2) jre11s1a = (1 / 8).
IF (jre12a1 = -2) jre12s1a = (1 / 8).
EXECUTE.
* Compute adjusted total score of unadjusted scores for items 1-3.
* plus adjusted scores for items 4-12 in each subtest.
COMPUTE jravta1 = SUM(jra01s1, jra02s1, jra03s1, jra04s1a, jra05s1a, 
 jra06s1a, jra07s1a, jra08s1a, jra09s1a, jra10s1a, jra11s1a, jra12s1a,
 jrb01s1, jrb02s1, jrb03s1, jrb04s1a, jrb05s1a, 
 jrb06s1a, jrb07s1a, jrb08s1a, jrb09s1a, jrb10s1a, jrb11s1a, jrb12s1a,
 jrc01s1, jrc02s1, jrc03s1, jrc04s1a, jrc05s1a, 
 jrc06s1a, jrc07s1a, jrc08s1a, jrc09s1a, jrc10s1a, jrc11s1a, jrc12s1a,
 jrd01s1, jrd02s1, jrd03s1, jrd04s1a, jrd05s1a, 
 jrd06s1a, jrd07s1a, jrd08s1a, jrd09s1a, jrd10s1a, jrd11s1a, jrd12s1a, 
 jre01s1, jre02s1, jre03s1, jre04s1a, jre05s1a, 
 jre06s1a, jre07s1a, jre08s1a, jre09s1a, jre10s1a, jre11s1a, jre12s1a).
EXECUTE.
jteng1/2, jtmat1/2, jtsci1/2, jt2ac1/2, jt3ac1/2

Mean teacher-assessed National Curriculum levels for twins, from teacher questionnaire data. Each of the mean levels for English (jteng), maths (jtmat) and science (jtsci) is the mean of 3 component levels that were reported by the teacher. The overall 2-subject (jt2ac, English and maths) and 3-subject (jt3ac, 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 jteng1 = MEAN(jtengsp1, jtengre1, jtengwr1).
COMPUTE jtmat1 = MEAN(jtmatus1, jtmatnu1, jtmatsh1).
COMPUTE jtsci1 = MEAN(jtscisc1, jtscili1, jtsciph1).
EXECUTE.
* 2-subject (English and maths) overall achievement.
* requiring both to be non-missing.
COMPUTE jt2ac1 = MEAN.2(jteng1, jtmat1).
EXECUTE.
* 3-subject (English, maths, science) overall achievement.
* requiring all three to be non-missing.
COMPUTE jt3ac1 = MEAN.3(jteng1, jtmat1, jtsci1).
EXECUTE.
jtclcha1/2

Chaos classroom environment scale, from teacher questionnaire items.
Computed as variable jtclcha1 in the syntax below, then later copied into variable jtclcha2 on double entry.

* Classroom chaos scale.
* Based on items from the teacher questionnaire.
* Recode items 2, 7, 15 so that high score = low chaos.
* (recode into temporary variables, to be dropped later).
RECODE
  JTCHA021 JTCHA071 JTCHA151
 (0=1) (1=0)
 INTO jtch02r1 jtch07r1 jtch15r1 . 
EXECUTE. 
* Create scale, requiring at least 4 of the 7 items (each having values 0/1). 
COMPUTE jtclcha1 = MEAN.4(JTCHA011,jtch02r1,JTCHA061,jtch07r1,JTCHA111,JTCHA131,jtch15r1).
EXECUTE. 
jtclpec1/2

Peer Context classroom environment scale, from teacher questionnaire items.
Computed as variable jtclpec1 in the syntax below, then later copied into variable jtclpec2 on double entry.

* Classroom peer context scale.
* Based on items from the teacher questionnaire.
* First get a reversed version of item 8 (temporary variable - drop later).
RECODE JTCLA81 (0=2) (1=1) (2=0) INTO jtcla8r1.
EXECUTE.
* Create scale, requiring at least 2 of the 4 items (each having values 0-2). 
COMPUTE jtclpec1 = MEAN.2(JTCLA21,JTCLA41,JTCLA51,jtcla8r1).
EXECUTE.
jtclsat1/2

Satisfaction classroom environment scale, from teacher questionnaire items.
Computed as variable jtclsat1 in the syntax below, then later copied into variable jtclsat2 on double entry.

* Classroom satisfaction scale.
* Based on items from the teacher questionnaire.
* Require at least 2 of the 4 items, each of which has values 0-2.
COMPUTE jtclsat1 = MEAN.2(JTCLA11,JTCLA31,JTCLA61,JTCLA71 ).
EXECUTE.
jteng1/2

See jt2ac1/2, etc above.

jtenyear

Data flag, to show presence of any data (parent, twin or teacher for either twin) in the 10 Year study.
Coded as 1=yes (data present).
The syntax below is executed after merging together all data sources and after double entering the data flags jcdata1/2 (twin data) and jtdata1/2 (teacher data).

* Keep only pairs with data.
FILTER OFF.
USE ALL.
SELECT IF(jpqdata = 1 | jcdata1 = 1 | jcdata2 = 1 | jtdata1 = 1 | jtdata2 = 1).
EXECUTE .

* add a flag variable to show there is some 10yr data for each pair.
COMPUTE jtenyear = 1.
EXECUTE.
jtmat1/2

See jt2ac1/2, etc above.

jtottm1/2

Total time taken (in minutes) for the twin to complete the entire battery of web tests.
Computed from the item variables representing the time taken for each individual test.
This variable only has values for twins who completed the entire test battery.
Computed as variable jtottm1 in the syntax below, then copied into variable jtottm2 on double entry.

* Total time for all web tests (if all completed), in minutes.
COMPUTE jtottm1 = (1/60) * SUM.7(JPTIME1,JMTIME1,JQTIME1,JRTIME1,JVTIME1,JPCTIME1,JGTIME1).
EXECUTE.
jtqage1/2

Age of twin (in decimal years) when the teacher questionnaire was returned.
Derived from the return date of the teacher questionnaire (jtrdate1/2, an admin variable) and the birth date of the twins (aonsdob, a temporary variable from admin data). These date variables are not retained in the dataset.

* Teacher questionnaire age, from admin return dates.
* but only if teacher data are present (there are some dates without data).
IF (jtdata1 = 1) jtqage1 = RND((DATEDIFF(jtrdate1, aonsdob, "days")) / 365.25, 0.1) .
IF (jtdata2 = 1) jtqage2 = RND((DATEDIFF(jtrdate2, aonsdob, "days")) / 365.25, 0.1) .
EXECUTE.
jtqLLCage1/2, jtqLLCdate1/2

See jcstLLCage1/2, etc above.

jtsci1/2

See jt2ac1/2, etc above.

jvocat1/2

Mean item answer time for the twin Vocabulary web test.
This is the average time (in seconds) taken by the twin to answer each item of the test. Computed as the mean of all 30 answer time item variables.
Computed as variable jvocat1 in the syntax below, then copied into variable jvocat2 on double entry.

COMPUTE jvocat1 = MEAN(jv01at1, jv02at1, jv03at1, jv04at1, jv05at1, 	
 jv06at1, jv07at1, jv08at1, jv09at1, jv10at1, 	
 jv11at1, jv12at1, jv13at1, jv14at1, jv15at1, 	
 jv16at1, jv17at1, jv18at1, jv19at1, jv20at1, 	
 jv21at1, jv22at1, jv23at1, jv24at1, jv25at1, 	
 jv26at1, jv27at1, jv28at1, jv29at1, jv30at1).
jvoct1/2

Total score for the twin Vocabulary web test.
This is the total score (0-60) computed as the sum of the item scores, each of which has values 0-2.
Computed as variable jvoct1 in the syntax below, later copied into variable jvoct2 on double entry.

* Sum out of 60 for all items.
COMPUTE jvoct1 = SUM(jv01s1, jv02s1, jv03s1, jv04s1, jv05s1, 
  jv06s1, jv07s1, jv08s1, jv09s1, jv10s1, jv11s1, jv12s1, jv13s1, 
  jv14s1, jv15s1, jv16s1, jv17s1, jv18s1, jv19s1, jv20s1, jv21s1, jv22s1, 
  jv23s1, jv24s1, jv25s1, jv26s1, jv27s1, jv28s1, jv29s1, jv30s1).
EXECUTE.
jvocta1/2

Adjusted total score for the twin Vocabulary web test.
This is a total score (0-60) computed as the sum of the "adjusted" item scores, taking the discontinue rule into account. For any item that was skipped because of the discontinue rule, the default item score of zero is replaced with the "chance" score for that item. In this test, the chance score is 0.67 (items 1-3) or 0.5 (items 7-8) or 0.75 (items 9-30): see explanation in comments in the syntax below.
The adjusted score is derived from the item responses and scores, after responses have been recoded to -2 for discontinued items.
As in the unadjusted total score, the practice item p1 is not included.

* Vocabulary.
* ----------.
* Discontinued items are flagged with response values -2.
* Can discontinue any item except 4,5,6.
* All items have 4 response options, except items 1-5 which have 3.
* Items 1-3,7,8 have a single correct response scoring 2.
* so chance score is 0.5 for items 7-8, or 0.67 for items 1-3
* Items 9-30 each have two correct response options, scoring 2 and 1.
* so the chance score is (2 + 1 + 0 + 0) / 4 = 0.75.COMPUTE jv01s1a = jv01s1.
COMPUTE jv02s1a = jv02s1.
COMPUTE jv03s1a = jv03s1.
COMPUTE jv07s1a = jv07s1.
COMPUTE jv08s1a = jv08s1.
COMPUTE jv09s1a = jv09s1.
COMPUTE jv10s1a = jv10s1.
COMPUTE jv11s1a = jv11s1.
COMPUTE jv12s1a = jv12s1.
COMPUTE jv13s1a = jv13s1.
COMPUTE jv14s1a = jv14s1.
COMPUTE jv15s1a = jv15s1.
COMPUTE jv16s1a = jv16s1.
COMPUTE jv17s1a = jv17s1.
COMPUTE jv18s1a = jv18s1.
COMPUTE jv19s1a = jv19s1.
COMPUTE jv20s1a = jv20s1.
COMPUTE jv21s1a = jv21s1.
COMPUTE jv22s1a = jv22s1.
COMPUTE jv23s1a = jv23s1.
COMPUTE jv24s1a = jv24s1.
COMPUTE jv25s1a = jv25s1.
COMPUTE jv26s1a = jv26s1.
COMPUTE jv27s1a = jv27s1.
COMPUTE jv28s1a = jv28s1.
COMPUTE jv29s1a = jv29s1.
COMPUTE jv30s1a = jv30s1.
EXECUTE.
IF (jv01a1 = -2) jv01s1a = 0.67.
IF (jv02a1 = -2) jv02s1a = 0.67.
IF (jv03a1 = -2) jv03s1a = 0.67.
IF (jv07a1 = -2) jv07s1a = 0.5.
IF (jv08a1 = -2) jv08s1a = 0.5.
IF (jv09a1 = -2) jv09s1a = 0.75.
IF (jv10a1 = -2) jv10s1a = 0.75.
IF (jv11a1 = -2) jv11s1a = 0.75.
IF (jv12a1 = -2) jv12s1a = 0.75.
IF (jv13a1 = -2) jv13s1a = 0.75.
IF (jv14a1 = -2) jv14s1a = 0.75.
IF (jv15a1 = -2) jv15s1a = 0.75.
IF (jv16a1 = -2) jv16s1a = 0.75.
IF (jv17a1 = -2) jv17s1a = 0.75.
IF (jv18a1 = -2) jv18s1a = 0.75.
IF (jv19a1 = -2) jv19s1a = 0.75.
IF (jv20a1 = -2) jv20s1a = 0.75.
IF (jv21a1 = -2) jv21s1a = 0.75.
IF (jv22a1 = -2) jv22s1a = 0.75.
IF (jv23a1 = -2) jv23s1a = 0.75.
IF (jv24a1 = -2) jv24s1a = 0.75.
IF (jv25a1 = -2) jv25s1a = 0.75.
IF (jv26a1 = -2) jv26s1a = 0.75.
IF (jv27a1 = -2) jv27s1a = 0.75.
IF (jv28a1 = -2) jv28s1a = 0.75.
IF (jv29a1 = -2) jv29s1a = 0.75.
IF (jv30a1 = -2) jv30s1a = 0.75.
EXECUTE.
* Adjusted total score is the sum of the adjusted items.
* plus unadjusted items 4-6.
COMPUTE jvocta1 = SUM(jv01s1a, jv02s1a, jv03s1a, jv04s1, jv05s1, 
  jv06s1, jv07s1a, jv08s1a, jv09s1a, jv10s1a, jv11s1a, jv12s1a, jv13s1a, 
  jv14s1a, jv15s1a, jv16s1a, jv17s1a, jv18s1a, jv19s1a, jv20s1a, jv21s1a, jv22s1a, 
  jv23s1a, jv24s1a, jv25s1a, jv26s1a, jv27s1a, jv28s1a, jv29s1a, jv30s1a).
EXECUTE.