/* coded by Janel Hanmer, May 2005 code was validated against code written independently by Dasha Cherepanov*/ /* take from Erickson P. Evaluation of a population-based measure of quality of life: the Health and Activity Limitation Index (HALex). Quality of Life Research. 1998;7: 101-104.*/ /*I presume your dataset has fieldnames and is coded as follows, which comes from appendix 1 in the QoLR article, pages 112-114: genhealth = general health question where 1="excellent" to 5="poor" halex1 = past twelve months where 1="working at a job or business" to 4="something else" halex2 = impairment kept you from working where 1="yes" and 2="no" . . . halex13 = limited in any activities where 1="yes" and 2="no" age = age in years Scores will be calculated as long as the respondent answered the general health question. If your dataset has a lot of missing values in the other questions, it would be prudent to write code to not calculate scores for respondents with large amounts of missing data. Unfortunately, there is not a standardized way to handle missing data in HALex */ /*insert the path to your dataset here*/ data xyz; set 'C:\. . .'; run; /* categorize people into limitations (HL), set so 1=not limited, 6=limited in adl */ data xyz; set xyz; hl=1; run; data xyz; set xyz; if age>69 & halex11=1 then hl=2; if age>69 & halex10=1 then hl=5; if age>69 & halex9=1 then hl=6; run; data xyz; set xyz; if age<69 & halex8=1 then hl=2; if age<69 & halex7=1 then hl=3; if age<69 & halex5=1 then hl=3; if age<69 & halex3=1 then hl=3; if age<69 & halex6=1 then hl=4; if age<69 & halex4=1 then hl=4; if age<69 & halex2=1 then hl=4; if age<69 & halex10=1 then hl=5; if age<69 & halex9=1 then hl=6; run; /*scores are assigned by table look up from Table 2 in article */ data xyz; set xyz; if genhealth=1 & hl=1 then HALex=1.0 ; if genhealth=1 & hl=2 then HALex=.87 ; if genhealth=1 & hl=3 then HALex=.81 ; if genhealth=1 & hl=4 then HALex=.68 ; if genhealth=1 & hl=5 then HALex=.57 ; if genhealth=1 & hl=6 then HALex=.47 ; if genhealth=2 & hl=1 then HALex=.92 ; if genhealth=2 & hl=2 then HALex=.79 ; if genhealth=2 & hl=3 then HALex=.74 ; if genhealth=2 & hl=4 then HALex=.62 ; if genhealth=2 & hl=5 then HALex=.51 ; if genhealth=2 & hl=6 then HALex=.41 ; if genhealth=3 & hl=1 then HALex=.84 ; if genhealth=3 & hl=2 then HALex=.72 ; if genhealth=3 & hl=3 then HALex=.67 ; if genhealth=3 & hl=4 then HALex=.55 ; if genhealth=3 & hl=5 then HALex=.45 ; if genhealth=3 & hl=6 then HALex=.36 ; if genhealth=4 & hl=1 then HALex=.63 ; if genhealth=4 & hl=2 then HALex=.52 ; if genhealth=4 & hl=3 then HALex=.48 ; if genhealth=4 & hl=4 then HALex=.38 ; if genhealth=4 & hl=5 then HALex=.29 ; if genhealth=4 & hl=6 then HALex=.21 ; if genhealth=5 & hl=1 then HALex=.47 ; if genhealth=5 & hl=2 then HALex=.38 ; if genhealth=5 & hl=3 then HALex=.34 ; if genhealth=5 & hl=4 then HALex=.25 ; if genhealth=5 & hl=5 then HALex=.17 ; if genhealth=5 & hl=6 then HALex=.10 ; run;