Dear All, According to the following data
If original zzinterval = 327 and original zzmagnitude = 2, then re-set (change the variable input) the zzinterval to 30 and zzmagnitude = 0. A way to do this is
I wonder if there is a more concise way to do this. Thanks.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(id zzmagnitude) int zzinterval1 1 0 . 2 2 327 3 0 . 4 0 . 5 0 . 6 3 284 7 0 . 8 3 284 9 0 . 10 1 272 end
Code:
replace zzinterval1 = 30 if (zzinterval1==327)&(zzmagnitude==2) replace zzmagnitude = 0 if (zzinterval1==327)&(zzmagnitude==2)
Comment