program define _3dax0 version 2.1 mac def _n = _N mac def _n1 = _N + 1 mac def _new = _N + 9 set obs %_new gen byte _Type = cond(_n>=%_n1,2,.) replace _x = cond(_n==%_n1,0,cond(_n==_N,1,%_1)) in %_n1/l replace _y = cond(_n==%_n+6,0,cond(_n==%_n+7,1,%_2)) in %_n1/l replace _z = cond(_n==%_n+3,1,cond(_n==%_n+4,0,%_3)) in %_n1/l end exit /* _3dax0 x0# y0# z0# adds an axis meeting at (0,0,0) to the data. The following are observations are added to the end of the data: input byte _Type _x _y _z 1 2 0 . . 2 2 . . . 3 2 . . 1 4 2 . . 0 5 2 . . . 6 2 . 0 . 7 2 . 1 . 8 2 . . . 9 2 1 . . end The misings are converted to the scaled number corresponding to zero (x0# y0# z0#). */