******************************************************************** * File HALCyon wellbeing syntax_Caerphilly.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 Caerphilly Prospective Study (CaPS) * Date Created 28/07/2011 * last modified 20/10/2011 * PURPOSE Derives Warwick Edinburgh Mental Wellbeing Score (WEMWBS) for use in cross-cohort analyses ************************************************************************************* #delimit ; set more off ; /*Generating variable to indicate number of items missing */ egen wemwbsm=rmiss(c6q6a_optimistic-c6q6n_cheerful) ; egen scorepreimp=rsum(c6q6a_optimistic-c6q6n_cheerful) if wemwbsm>=0 & wemwbsm<=3 ; gen wemwbstot= scorepreimp ; replace wemwbstot=(scorepreimp+(scorepreimp/13)) if wemwbsm==1 ; replace wemwbstot=(scorepreimp+((scorepreimp/12)*2)) if wemwbsm==2 ; replace wemwbstot=(scorepreimp+((scorepreimp/11)*3)) if wemwbsm==3 ; label variable wemwbsm "No. of items missing - WEMWBS" ; label variable wemwbstot "Total WEMWBS score" ; drop scorepreimp ;