****************************************************************** *STATA syntax code for the computation of index* *values with the US value set (TTO)* * *Change_log: This file has been updated by replacing the old option * *of the egen command "neqany" by the newer "anycount" * *old versions of STATA might require the use of "neqany" instead * ******************************************************************; gen m1 =0 gen m2 =0 gen s1 =0 gen s2 =0 gen u1 =0 gen u2 =0 gen p1 =0 gen p2 =0 gen a1 =0 gen a2 =0 replace m1 = 1 if mobility == 2 replace m2 = 1 if mobility == 3 replace s1 = 1 if selfcare == 2 replace s2 = 1 if selfcare == 3 replace u1 = 1 if activity == 2 replace u2 = 1 if activity == 3 replace p1 = 1 if pain == 2 replace p2 = 1 if pain == 3 replace a1 = 1 if anxiety == 2 replace a2 = 1 if anxiety == 3 *Interaction terms I2, I2-squared, I3, I3-squared* gen m0 = 1 if m1 == 0 & m2 == 0 gen s0 = 1 if s1 == 0 & s2 == 0 gen u0 = 1 if u1 == 0 & u2 == 0 gen p0 = 1 if p1 == 0 & p2 == 0 gen a0 = 1 if a1 == 0 & a2 == 0 egen i2 = anycount(m1 s1 u1 p1 a1), values(1) replace i2 = i2 - 1 replace i2 = 0 if i2<0 gen i22 = i2^2 egen i3 = anycount(m2 s2 u2 p2 a2), values(1) replace i3 = i3 - 1 replace i3 = 0 if i3<0 gen i32 = i3^2 *D1 term* egen i1 = anycount(m0 s0 u0 p0 a0), values(1) gen d1 = 4 - i1 replace d1 = 0 if d1<0 gen pred = .146016*m1 + .557685*m2 + .1753425*s1 + .4711896*s2 + .1397295*u1 + .3742594*u2 + .1728907*p1 + .5371011*p2 + .156223*a1 + .4501876*a2 + -.1395949*d1 + .0106868*i22 + -.1215579*i3 + -.0147963*i32 gen EQ_index = 1 - pred replace EQ_index = round(EQ_index, .001) drop m1-pred