****************************************************************** *STATA syntax code for the computation of index* *values with the Portuguese 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 = .30543*m1 + .89017*m2 + .35397*s1 + .79608*s2 + .29849*u1 + .75906*u2 + .30633*p1 + .70274*p2 + .23328*a1 + .63208*a2 + -.43663*d1 + .24028*i2 + -.03358*i32 gen EQ_index = 1 - pred replace EQ_index = round(EQ_index, .001) drop m1-pred