// Creates w_swemwbs_dv - Short Warwick-Edinburgh Mental Well-being Scale. // INPUT FILE - w_indresp.dta // OUTPUT FILE - w_swemwbs_dv.dta // WRITE FILEPATH WHERE YOU HAVE DOWNLOADED THE DATA global in "" // WRITE FILEPATH WHERE YOU WOULD LIKE TO SAVE THE OUTPUT FILE global outpath "" // 1 is for BHPS, 2 is for UKHLS global cohort "2" foreach w in a d g j { // INCLUDE WAVE LETTERS FOR THE WAVES NEEDED global wave "`w'_" global num=strpos("abcdefghijklmnopqrstuvwxyz","`w'") global dta "" global waveno=$num global inpath "${in}/bhps_w${num}" if $cohort==2 { global waveno=$num+18 global inpath "${in}/ukhls" } use "${inpath}/${wave}indresp${dta}", clear drop ${wave}swemwbs_dv /* This code creates the short Warwick-Edinburgh Mental Well-being Scale (SWEMWBS) The 7-item Short version (SWEMWBS) (Stewart-Brown et al., 2009) is scored on a 5-point Likert scale, from none of the time to all of the time, and summed to give a total score, ranging from 0 to 35; higher scores indicate higher levels of well-being. See (Tennant et al., 2007) for the full Warwick-Edinburgh Mental Well-being Scale. References: Stewart-Brown, S., Tennant, A., Tennant, R., Platt, S., Parkinson, J., & Weich, S. (2009). Internal construct validity of the Warwick-Edinburgh Mental Well-being Scale (WEMWBS): a Rasch analysis using data from the Scottish Health Education Population Survey. Health and Quality of Life Outcomes, 7, 15. Tennant, R., Hiller, L., Fishwick, R., Platt, S., Joseph, S., Weich, S., et al. (2007). The Warwick-Edinburgh Mental Well-being Scale (WEMWBS): Development and UK validation. Health and Quality of Life Outcomes, 5, 63. */ gen iemb=(${wave}scwemwba==-10 | ${wave}scwemwba==-11) // needed to recode -9 to -8 for content not in iemb for var ${wave}scwemwba ${wave}scwemwbb ${wave}scwemwbc ${wave}scwemwbd ${wave}scwemwbe ${wave}scwemwbf /// ${wave}scwemwbg: replace X=. if X<0 *WEMWBS Calculation gen ${wave}swemwbs_dv = ${wave}scwemwba+${wave}scwemwbb+${wave}scwemwbc+${wave}scwemwbd+${wave}scwemwbe /// +${wave}scwemwbf+${wave}scwemwbg replace ${wave}swemwbs_dv =-9 if ${wave}swemwbs_dv==. recode ${wave}swemwbs_dv (-9=-7) if ${wave}ivfio==2 recode ${wave}swemwbs_dv (-9=-8) if ${wave}scflag_dv~=1 | iemb==1 label variable ${wave}swemwbs_dv "Short Warwick-Edinburgh Mental Well-being Scale" lab def ${wave}swemwbs_dv -9 "missing" -7"proxy respondent" -8"inapplicable", replace lab val ${wave}swemwbs_dv ${wave}swemwbs_dv sum ${wave}swemwbs_dv drop iemb keep pidp ${wave}swemwbs_dv save "${outpath}/${wave}swemwbs_dv", replace }