******************************************************************************* * File HALCyon cognitive syntax_Lothian1921.do * BY       Rebecca Hardy, MRC Unit for Lifelong Health and Ageing at UCL * FOR     HALCyon cross-cohort collaboration (funded by the New Dynamics of Ageing (RES-353-25-0001)) * DATASET Lothian 1921 * Date Created 07/04/2010 * PURPOSE Recodes and derives cognitive variables for use in cross-cohort analyses ******************************************************************************* # delimit; set more off; /*********************************************************************************/ /*Crystallized cognitive ability*/ /*NART*/ /*range 0-50*/ gen nart_w1=nart79 ; label variable nart_w1 "NART at wave 1 (age 79)" ; gen nart_w2=nart83 ; label variable nart_w2 "NART at wave 2 (age 83)" ; /*standardise NART to whole sample*/ egen nartz_w1=std(nart_w1) ; label variable nartz_w1 "standardised NART at wave 1 (age 79)" ; egen nartz_w2=std(nart_w2) ; label variable nartz_w2 "standardised NART at wave 2 (age 83)" ; /*standardise NART for men and women seprately*/ egen nartzm_w1=std(nart_w1) if sex==1; egen nartzf_w1=std(nart_w1) if sex==2; label variable nartzm_w1 "standardised NART for men at wave 1 (age 79)" ; label variable nartzf_w1 "standardised NART for women at wave 1 (age 79)" ; egen nartzm_w2=std(nart_w2) if sex==1; egen nartzf_w2=std(nart_w2) if sex==2; label variable nartzm_w2 "standardised NART for men at wave 2 (age 83)" ; label variable nartzf_w2 "standardised NART for women at wave 2 (age 83)" ; /*combine in one variable*/ gen nartzs_w1=. ; replace nartzs_w1=nartzm_w1 if sex==1; replace nartzs_w1=nartzf_w1 if sex==2; label variable nartzs_w1 "sex-standardised NART at wave 1 (age 79)" ; gen nartzs_w2=. ; replace nartzs_w2=nartzm_w2 if sex==1; replace nartzs_w2=nartzf_w2 if sex==2; label variable nartzs_w2 "sex-standardised NART at wave 2 (age 83)" ; /*verbal fluency*/ /*range 0-80*/ gen vftotal_w1=vftot79 ; label variable vftotal_w1 "Total verbal fluency score at wave 1 (age 79)" ; gen vftotal_w2=vtotal83 ; label variable vftotal_w2 "Total verbal fluency score at wave 2 (age 83)" ; /*standardised verbal fluency total*/ egen vftotalz_w1=std(vftotal_w1) ; label variable vftotalz_w1 "standardised total verbal fluency at wave 1 (age 79)" ; egen vftotalz_w2=std(vftotal_w2) ; label variable vftotalz_w2 "standardised total verbal fluency at wave 2 (age 83)" ; /*standardise NART for men and women seprately*/ egen vftotalzm_w1=std(vftotal_w1) if sex==1; egen vftotalzf_w1=std(vftotal_w1) if sex==2; label variable vftotalzm_w1 "standardised total verbal fluency for men at wave 1 (age 79)" ; label variable vftotalzf_w1 "standardised total verbal fluency for women at wave 1 (age 79)" ; egen vftotalzm_w2=std(vftotal_w2) if sex==1; egen vftotalzf_w2=std(vftotal_w2) if sex==2; label variable vftotalzm_w2 "standardised total verbal fluency for men at wave 2 (age 83)" ; label variable vftotalzf_w2 "standardised total verbal fluency for women at wave 2 (age 83)" ; /*combine in one variable*/ gen vftotalzs_w1=. ; replace vftotalzs_w1=vftotalzm_w1 if sex==1; replace vftotalzs_w1=vftotalzf_w1 if sex==2; label variable vftotalzs_w1 "sex-standardised total verbal fluency at wave 1 (age 79)" ; gen vftotalzs_w2=. ; replace vftotalzs_w2=vftotalzm_w2 if sex==1; replace vftotalzs_w2=vftotalzf_w2 if sex==2; label variable vftotalzs_w2 "sex-standardised total verbal fluency at wave 2 (age 83)" ; /* Raven's Matrices*/ /*range 0-60*/ gen ravens_w1=ravens ; label variable ravens_w1 "Ravens Matrices score at wave 1 (age 79)" ; gen ravens_w2=ravens83 ; label variable ravens_w2 "Ravens Matrices score at wave 2 (age 83)" ; /*standardise Raven's scores */ egen ravensz_w1=std(ravens_w1) ; label variable ravensz_w1 "standardised Ravens Matrices score at wave 1 (age 79)" ; egen ravensz_w2=std(ravens_w2) ; label variable ravensz_w2 "standardised Ravens Matrices score at wave 2 (age 83)" ; /*standardise Raven's Matrices score for men and women seprately*/ egen ravenszm_w1=std(ravens_w1) if sex==1; egen ravenszf_w1=std(ravens_w1) if sex==2; label variable ravenszm_w1 "standardised Raven's Matrices score for men at wave 1 (age 79)" ; label variable ravenszf_w1 "standardised Raven's Matrices score for women at wave 1 (age 79)" ; egen ravenszm_w2=std(ravens_w2) if sex==1; egen ravenszf_w2=std(ravens_w2) if sex==2; label variable ravenszm_w2 "standardised Raven's Matrices score for men at wave 2 (age 83)" ; label variable ravenszf_w2 "standardised Raven's Matrices score for women at wave 2 (age 83)" ; /*combine in one variable*/ gen ravenszs_w1=. ; replace ravenszs_w1=ravenszm_w1 if sex==1; replace ravenszs_w1=ravenszf_w1 if sex==2; label variable ravenszs_w1 "sex-standardised Raven's Matrices score at wave 1 (age 79)" ; gen ravenszs_w2=.; replace ravenszs_w2=ravenszm_w2 if sex==1; replace ravenszs_w2=ravenszf_w2 if sex==2; label variable ravenszs_w2 "sex-standardised Raven's Matrices score at wave 2 (age 83)" ; /*Wechsler logical memory*/ /*range 0-75*/ gen logmem_w1=logmem79 ; label variable logmem_w1 "Logical Memory score at wave 1 (age 79)" ; gen logmem_w2=logtot83 ; label variable logmem_w2 "Logical Memory score at wave 2 (age 83)" ; /*standardise logical memory score */ egen logmemz_w1=std(logmem_w1) ; label variable logmemz_w1 "standardised Logical Memory score at wave 1 (age 79)" ; egen logmemz_w2=std(logmem_w2) ; label variable logmemz_w2 "standardised Logical Memory score at wave 2 (age 83)" ; /*standardise logical memory score for men and women seprately*/ egen logmemzm_w1=std(logmem_w1) if sex==1; egen logmemzf_w1=std(logmem_w1) if sex==2; label variable logmemzm_w1 "standardised logical memory score for men at wave 1 (age 79)" ; label variable logmemzf_w1 "standardised logical memory score for women at wave 1 (age 79)" ; egen logmemzm_w2=std(logmem_w2) if sex==1; egen logmemzf_w2=std(logmem_w2) if sex==2; label variable logmemzm_w2 "standardised logical memory score for men at wave 2 (age 83)" ; label variable logmemzf_w2 "standardised logical memory score for women at wave 2 (age 83)" ; /*combine in one variable*/ gen logmemzs_w1=. ; replace logmemzs_w1=logmemzm_w1 if sex==1; replace logmemzs_w1=logmemzf_w1 if sex==2; label variable logmemzs_w1 "sex-standardised logical memory score at wave 1 (age 79)" ; gen logmemzs_w2=.; replace logmemzs_w2=logmemzm_w2 if sex==1; replace logmemzs_w2=logmemzf_w2 if sex==2; label variable logmemzs_w2 "sex-standardised logical memory score at wave 2 (age 83)" ; /*derive fluid cognitive ability - Gf*/ factor vftotalz_w1 ravensz_w1 logmemz_w1, factors(1) pcf ; predict Gf_w1 ; label variable Gf_w1 "Gf at wave 1 (age 79)" ; factor vftotalz_w2 ravensz_w2 logmemz_w2, factors(1) pcf ; predict Gf_w2 ; label variable Gf_w2 "Gf at wave 2 (age 83)" ;