tA =[1 3 3 6 7   7 10 12 14 15 ...
         18 19 22 26 28    29 34 40 48 49];
cA=[0 0 0 0 0   0 0 0 0 0  ...
         0 0 0 0 1   0 0 0 1 1];
tB =[1 1 2 2 3    4 5 8 8 9   ...
    11 12 14 16 18    21 27 31 38 44]
cB=[0 0 0 0 0    0 0 0 0 0   ...
         0 0 0 0 0   0 1  0 1 0];
     [pval chi2]=manteltwo(tA,  cA, tB, cB)

%%
% example of use
% Book example Histiocytic Lymphoma 
  tA =[6 19 32 42 42 43  94 126 169 207 211 227 253  255  270  310 316 335  346];
  cA= [0  0  0    0   0  1    0    1     1    0     1      1     0      1      1      1     1      1    1];
          
  tB =[4  6 10 11 11    11  13 17 20 20     21 ... 
      22 24 24 29 30     30  31 33 34 35     39 ...
      40 41 43 45 46     50  56  61 61 63     68 ...
      82 85 88 89 90     93 104 110 134 137   160  ...
      169 171 173 175 184    201 222 235 247 260   284 ...
      290 291 302 304 341    345];

 
  cB=[0 0 0 0 0    0 0 0 0 0      0 ...
      0 0 0 0 0    0 0 0 0 0      0 ...
      0 1 1 0 0    0 0 1 1 0      0 ...
      0 0 0 0 0    0 0 0 0 0      1 ...
      0 0 0 0 0    0 0 1 1 1      1 ...
      1 1 1 1 1    1];




       [pval chi2]=manteltwo(tA, cA, tB, cB)

%%
close all force
tA=[1 5 6 6 9  10 10 10 12 12   12 12 12 13 15    16 20 24 24 27 ...
        32 34 36 36 44];
cA =[1 1 0 0 1   0 0 1 0 0   0 0 1 1 1  1 1 0 1 1   0 1 1 1 1];

tB=[3 6 6 6 6   8 8 12 12 12   15 16 18 18 20  22 24 28 28 28  ...
       30 30 33 42]; 
   cB=[1 0 0 0 0    0 0 0 0 1   1 1 1 1 0   1 0 1 1 1   0 1 1 0];
   
      [pval chi2]=manteltwo(tA,  cA, tB, cB)
      
 %%     
   ple(tA, cA)
hold on
  ple(tB, cB)
hold off
   
      