********************************************************************;
*                                                                  *;
*  SCORE1.SAS                                                    *;
*                                  *;
*  Program to score the SF-36 1.0                                *;
*                                  *;
*  by Ron Hays, Kai-Li Tsai, and Terry Nakazono                  *;
*                                                  *;
*                                                                  *;
*  Modified by K. Spritzer (added SF36 preference based scoring  *;
*      plus reorganized things a bit).  10/24/01.                  *;                                  *;
*                                                                  *;
*  Dec 2001: Added Fryback's QWB and Nichol's HUI2.              *;
*                                                                  *;
*  2/19/02: Modified by K. Spritzer to take out Brazier          *;
*  preference-based measure (was based on old form).              *;
*                                                                  *;
********************************************************************;

options ls=132 ps=58 nocenter;
libname f 'c:\projects\sf36\sf36';

********************************************************************;
/* bring in data to work with */
data main; set f.umga; run;
proc sort data=main; by id; run;
********************************************************************;

********************************************************************;

********************************************************************;
%include 'randhsi.sas' /source2;

proc means data=randhsi maxdec=2;
var tphc tmhc tghc;
run;
********************************************************************;

********************************************************************;
%include 'sf36a.sas' /source2;
proc means data=sf36a maxdec=2;
var phyfun10 rolep4 pain2 sfpain genh5 emot5 rolee3 socfun2 enfat4 sfgenh5 qwb;
run;

%include 'sf36b.sas' /source2;

%include 'sf36c.sas' /source2;
proc means data=sf36c maxdec=2;
var agg_phys agg_ment pf_t rp_t bp_t gh_t em_t re_t sf_t en_t
rpcs12 rmcs12 physhlt4 menthlt4 physhlt3 menthlt2 fsfm1 fsfm2 hui2;
run;
********************************************************************;

********************************************************************;
/* combine all data */
data main; merge main randhsi sf36a sf36c; by id; run;
********************************************************************;

proc corr data=main;
var qwb hui2 phyfun10 rolep4 pain2 sfpain genh5 emot5 rolee3 socfun2 enfat4 sfgenh5 agg_phys agg_ment;
run;