******************************************************************************* * File HALCyon cognitive syntax_NSHD.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 MRC National Survey of Health and Development (NSHD) * Date Created 07/04/2010 * PURPOSE Recodes and derives cognitive variables for use in cross-cohort analyses ******************************************************************************* # delimit; set more off; /*Creating break between newly recoded cognitive variables and variables in existing dataset with a blank variable */ gen cogrecodes_below=. ; /*********************************************************************************/ /*Crystallized cognitive ability*/ /*NART*/ /*range 0-50*/ gen nart_53=nart99r ; label variable nart_53 "NART score at age 53" ; /*standardise NART to whole sample*/ egen nartz_53=std(nart_53) ; label variable nartz_53 "standardised NART score at age 53" ; /*standardise NART for men and women separately*/ egen nartzm_53=std(nart_53) if sex==1; egen nartzf_53=std(nart_53) if sex==2; label variable nartzm_53 "standardised NART for men at age 53" ; label variable nartzf_53 "standardised NART for women at age 53" ; /*combine in one variable*/ gen nartzs_53=. ; replace nartzs_53=nartzm_53 if sex==1; replace nartzs_53=nartzf_53 if sex==2; label variable nartzs_53 "sex-standardised NART at age 53" ; /*verbal memory (word list recall)*/ /*range 0-45*/ gen wlt_53=wlt99 ; label variable wlt_53 "verbal memory total score at age 53" ; gen wlt_53=wlt89 ; label variable wlt_43 "verbal memory total score at age 43" ; /*standardise verbal memory*/ egen wltz_53=std(wlt_53); label variable wltz_53 "standardised verbal memory score at age 53" ; egen wltz_43=std(wlt_43); label variable wltz_43 "standardised verbal memory score at age 43" ; /*standardise verbal memory for men and women separately*/ egen wltzm_53=std(wlt_53) if sex==1; egen wltzf_53=std(wlt_53) if sex==2; label variable wltzm_53 "standardised verbal memory for men at age 53" ; label variable wltzf_53 "standardised verbal memory for women at age 53" ; egen wltzm_43=std(wlt_43) if sex==1; egen wltzf_43=std(wlt_43) if sex==2; label variable wltzm_43 "standardised verbal memory for men at age 43" ; label variable wltzf_43 "standardised verbal memory for women at age 43" ; /*combine in one variable*/ gen wltzs_53=. ; replace wltzs_53=wltzm_53 if sex==1; replace wltzs_53=wltzf_53 if sex==2; label variable wltzs_53 "sex-standardised verbal memory at age 53" ; gen wltzs_43=. ; replace wltzs_43=wltzm_43 if sex==1; replace wltzs_43=wltzf_43 if sex==2; label variable wltzs_43 "sex-standardised verbal memory at age 43" ; /*category (verbal) fluency (animal naming)*/ /*range 0-62*/ gen catfl_53=anin ; label variable catfl_53 "category fluency (animal naming) score at age 53" ; /*standardise category fluency*/ egen catflz_53=std(catfl_53) ; label variable wltz_53 "standardised category fluency score at age 53" ; /*standardise category fluency score for men and women seprately*/ egen catflzm_53=std(catfl_53) if sex==1; egen catflzf_53=std(catfl_53) if sex==2; label variable catflzm_53 "standardised category fluency score for men at age 53" ; label variable catflzf_53 "standardised category fluency score for women at age 53" ; /*combine in one variable*/ gen catflzs_53=. ; replace catflzs_53=catflzm_53 if sex==1; replace catflzs_53=catflzf_53 if sex==2; label variable catflzs_53 "sex-standardised category fluency score at age 53" ; /*search speed – letter reached in letter cancellation test*/ /*range 0-600*/ /*note: cansp99 has "lumpy" distribution*/ gen searchsp_43=cansp89 ; label variable searchsp_43 "search speed score at age 43" ; gen searchsp_53=cansp99 ; label variable searchsp_53 "search speed score at age 53" ; /*standardise search speed*/ egen searchspz_43=std(searchsp_43) ; label variable searchspz_43 "standardised search speed score at age 43" ; egen searchspz_53=std(searchsp_53) ; label variable searchspz_53 "standardised search speed score at age 53" ; /*standardise search speed score for men and women seprately*/ egen searchspzm_43=std(searchsp_43) if sex==1; egen searchspzf_43=std(searchsp_43) if sex==2; label variable searchspzm_43 "standardised search speed score for men at age 43" ; label variable searchspzf_43 "standardised search speed score for women at age 43" ; egen searchspzm_53=std(searchsp_53) if sex==1; egen searchspzf_53=std(searchsp_53) if sex==2; label variable searchspzm_53 "standardised search speed score for men at age 53" ; label variable searchspzf_53 "standardised search speed score for women at age 53" ; /*combine in one variable*/ gen searchspzs_43=. ; replace searchspzs_43=searchspzm_43 if sex==1; replace searchspzs_43=searchspzf_43 if sex==2; label variable searchspzs_43 "sex-standardised search speed score at age 43" ; gen searchspzs_53=. ; replace searchspzs_53=searchspzm_53 if sex==1; replace searchspzs_53=searchspzf_53 if sex==2; label variable searchspzs_53 "sex-standardised search speed score at age 53" ; /*derive fluid cognitive ability at 53 years - Gf*/ factor wltz_53 catflz_53 searchspz_53, factors(1) pcf ; predict Gf_53 ; label variable Gf_53 "Gf at age 53" ; /*derive fluid cognitive ability at 43 years (contains only word list and search speed)- Gf*/ factor wltz_43 searchspz_43, factors(1) pcf ; predict Gf_43 ; label variable Gf_43 "Gf at age 43" ;