macro barlowpro t c nr tt ttt ttpl xx ww mconstant k1 k2 k3 k4 mcolumn t c nr tt ttt ttpl xx ww let k1=count(t) let nr(1)=k1 let tt(1)=k1*t(1) let ttt(1)=k1*t(1) let k3=c(1) if k3=1 let ttpl(1)=ttt(1) endif do k2=2:k1 let k3=k3+c(k2) let nr(k2)=k1+1-k2 let tt(k2)=nr(k2)*(t(k2)-t(k2-1)) let ttt(k2)=ttt(k2-1)+tt(k2) if c(k2)=1 let ttpl(k3)=ttt(k2) endif enddo do k4=1:k3 let xx(k4)=k4/k3 let ww(k4)=ttpl(k4)/ttpl(k3) enddo name t 'Time' name c 'Censor' name nr 'No at risk' name tt 'Total time' name ttt 'Cum total time' name ttpl 'Plot total time' name xx 'i/n' name ww 'TTT' plot ww*xx; scale 1; min 0; max 1; scale 2; min 0; max 1; title "TTT-plot censored data". endmacro