*Written by Janel Hanmer July 2005 *Algorithm from Brazier J, Roberts J. The Estimation of a Preference-Based Measure of Health *from the SF-12. Medical Care. 2004;42:851-859. *This code uses Model 4 from the paper. *This code was checked against code written by Peter Franks. /*data is presumed to be labeled and coded as follows: sf2 = moderate activities where 1="limited a lot" to 3="not limited at all" sf5 = physical limits kind of work where 1="yes" and 2="no" sf6 = emotional accomplish less where 1="yes" and 2="no" sf8 = pain interferes with work where 1="not at all" to 5="extremely" sf10 = lots of energy where 1="all the time" to 6="none of the time" sf11 = downhearted where 1="all the time" to 6="none of the time" sf12 = social activities where 1="all the time" to 5="none of the time" */ *Insert path to data file below clear use "insert path here" gen sf6d=1 replace sf6d=sf6d-.045 if sf2 ==1 replace sf6d=sf6d-.063 if sf6 == 1 | sf5 == 1 replace sf6d=sf6d-.063 if sf12==4 replace sf6d=sf6d-.066 if sf12 ==3 replace sf6d=sf6d-.081 if sf12==2 replace sf6d=sf6d-.093 if sf12==1 replace sf6d=sf6d-.042 if sf8==3 replace sf6d=sf6d-.077 if sf8==4 replace sf6d=sf6d-.137 if sf8==5 replace sf6d=sf6d-.059 if sf11 == 5 | sf11==4 replace sf6d=sf6d-.086 if sf11==3 replace sf6d=sf6d-.113 if sf11==2 replace sf6d=sf6d-.134 if sf11==1 replace sf6d=sf6d-.078 if sf10==2 | sf10== 3 | sf10==4| sf10==5 replace sf6d=sf6d-.106 if sf10==6 replace sf6d=sf6d-.077 if sf2 == 1 | sf6 ==1 | sf12==2 | sf12==1| sf8==4 | sf8==5 | sf11==2| sf11==1 | sf10==6 replace sf6d=. if sf2 == . | sf5 ==. | sf6 ==. | sf12 ==. | sf11 ==. | sf10 ==.