/*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*/ data SF6D; set 'C: . . .'; run; data SF6D; set SF6D; sf6d=1; if sf2=1 then sf6d=sf6d-.045; if sf6=1 or sf5 = 1 then sf6d=sf6d-.063; if sf12=4 then sf6d=sf6d-.063; if sf12 =3 then sf6d=sf6d-.066; if sf12=2 then sf6d=sf6d-.081; if sf12=1 then sf6d=sf6d-.093; if sf8=3 then sf6d=sf6d-.042; if sf8=4 then sf6d=sf6d-.077; if sf8=5 then sf6d=sf6d-.137; if sf11=5 or sf11=4 then sf6d=sf6d-.059; if sf11=3 then sf6d=sf6d-.086; if sf11=2 then sf6d=sf6d-.113; if sf11=1 then sf6d=sf6d-.134; if sf10=2 or sf10=3 or sf10=4 or sf10=5 then sf6d=sf6d-.078; if sf10=6 then sf6d=sf6d-.106; if sf2= 1 or sf6 = 1 or sf12 =1 or sf12=2 or sf8=4 or sf8=5 or sf11=2 or sf11=1 or sf10=6 then sf6d=sf6d-.077; if sf2= . or sf5=. or sf6=. or sf12=. or sf11=. or sf10=. then sf6d=. ; run;