
clear all
close all force
 disp('Chada Example')
 lw = 3; 
 set(0, 'DefaultAxesFontSize', 16);
 fs = 15;
 msize = 10;
 
%  
% 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];
% 
% % Calculate and plot empirical
% % cdf and confidence bounds
% [f,x,flo,fup] = ecdf(times,'censoring', censored);
% figure(2)
% stairs(x,1-f,'LineWidth',2)
% table =[x 1-f];
% hold on
% stairs(x,1-flo,'r:','LineWidth',2)
% stairs(x,1-fup,'r:','LineWidth',2)
% legend('Empirical','LCB','UCB',...
%        'Location','NE')
% hold off
% %print -depsc 'C:\Brani\Courses\bmestatu\BMESBOOK\Survival\kapmei.eps'
%  


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];

     
                  
                 [table] =  ple(times,  censored) 


% print -depsc 'C:\STAT\Survival\Survivaleps\kapmei.eps'
 


%%
[table]=ple(times, censored)