******************************************************************** * File HALCyon wellbeing syntax_NSHD.do * BY Rachel Cooper, 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 * Date Created 25/07/2011 * last modified 26/02/2013 * PURPOSE Derives Warwick Edinburgh Mental Wellbeing Score (WEMWBS) for use in cross-cohort analyses ************************************************************************************* #delimit ; set more off ; tab1 wemwba09-wemwbn09 ; /*Individual coding changes required to variables where people gave 2 response items*/ replace wemwbk09=3.5 if serno==10125 ; replace wemwbd09=3 if serno==11024 ; replace wemwbl09=4.5 if serno==22178 ; replace wemwbj09=3.5 if serno==24073 ; replace wemwbc09=3.5 if serno==51021 ; replace wemwbl09=4 if serno==73057 ; replace wemwbm09=3.5 if serno==78023 ; replace wemwbl09=4 if serno==103031 ; replace wemwbe09=3.5 if serno==104006 ; replace wemwbk09=4.5 if serno==125294 ; replace wemwbf09=2.5 if serno==127010 ; replace wemwba09=3.5 if serno==139071 ; replace wemwbd09=1.5 if serno==148053 ; replace wemwbg09=4.5 if serno==185035 ; replace wemwbb09=3.5 if serno==208007 ; replace wemwbb09=4 if serno==456002 ; tab1 wemwba09-wemwbn09 ; /*Code out people with missing values */ replace wemwba09=. if wemwba09>5 ; replace wemwbb09=. if wemwbb09>5 ; replace wemwbc09=. if wemwbc09>5 ; replace wemwbd09=. if wemwbd09>5 ; replace wemwbe09=. if wemwbe09>5 ; replace wemwbf09=. if wemwbf09>5 ; replace wemwbg09=. if wemwbg09>5 ; replace wemwbh09=. if wemwbh09>5 ; replace wemwbi09=. if wemwbi09>5 ; replace wemwbj09=. if wemwbj09>5 ; replace wemwbk09=. if wemwbk09>5 ; replace wemwbl09=. if wemwbl09>5 ; replace wemwbm09=. if wemwbm09>5 ; replace wemwbn09=. if wemwbn09>5 ; /*Generating variable to indicate number of items missing */ egen wemwbs09m=rmiss(wemwba09-wemwbn09) ; egen scorepreimp=rsum( wemwba09- wemwbn09) if wemwbs09m>=0 & wemwbs09m<=3 ; gen wemwbstot= scorepreimp ; replace wemwbstot=(scorepreimp+(scorepreimp/13)) if wemwbs09m==1 ; replace wemwbstot=(scorepreimp+((scorepreimp/12)*2)) if wemwbs09m==2 ; replace wemwbstot=(scorepreimp+((scorepreimp/11)*3)) if wemwbs09m==3 ; label variable wemwbs09m "No. of items missing - WEMWBS" ; label variable wemwbstot "Total WEMWBS score" ; drop scorepreimp ;