  alltimes =  [6 6 6 6  7 9 10 10  11 13 16 17 19 20 22 23 25 32 32 34 35];
   censor =    [1 0 0 0 0 1  1   0    1    0    0    1   1   1   0    0  1    1    1   1   1];
 %  alltimes = [1 1 2 2 3 4 4 5 5 8 8 8 8 11 11 12 12 15 17 22 23];
%  censor =[0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0];
%   alltimes = [1 1 2 2 3 4 4 5 5 8 8 8 8 11 11 12 12 15 17 22 23];
%   censor =[0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0];
  table = plorkm(alltimes, censor);
  table
  
  
  
%% 
% % Chada 
% times=        [1,1,1,1,1,1,1,1,1,1,2,2,2,2,...
%                       3,3,3,4,4,5,5,5,5,5,5,5,5,5,...
%                       6,6,7,10,10,12,12,13];
% censored =[1,1,1,1,1,1,1,1,0,0,1,1,0,0,...
%                       1,0,0,1,0,1,1,1,1,1,1,0,0,0,...
%                       0,0,0, 0, 0, 0, 0, 0];

     
                  
                  kmplot([times' censored'])


%% Midterm
times =      [2 2 3 4 4 5 6 7];
censored=[1 0 0 1 0 0 0 0];

 table = plorkm(times, censored) 

%%
close all
   kmplot([times' censored'])
   
   1-ecdf(times,'censoring',censored)
   
   
%%
  close all
   timesdrug =  [6 6 6 6  7 9 10 10  11 13 16 17 19 20 22 23 25 32 32 34 35];
   censordrug =    [0 0 0 1 0 1  0   1    1    0    0    1   1   1   0    0  1    1    1   1   1];
   x1=[timesdrug' censordrug'];
   timescontrol = [1 1 2 2 3 4 4 5 5 8 8 8 8 11 11 12 12 15 17 22 23];
   censorcontrol =[0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0];
   x2=[timescontrol' censorcontrol'];

   logrank(x1, x2)