Trying to shade the area between upper and lower confidence bands on Kaplan Meier Curve

4 visualizaciones (últimos 30 días)
Hi everyone,
This is my first time posting here. I am a total beginner. I am trying to shade the area between upper and lower confidence bands on kaplan meier curve, without any success. See below the code I used to plot the curve and confidence bands. I have searched the forums and tried several variations of patch and fill functions that I saw in replies, but nothing has worked for me. I have attached a sample of the data I am trying to plot. I shall be highly grateful for any guidance in this regard. Thanks in advance
plot(timeDays,probability,'b', 'LineWidth', 2);
ylabel('Survival probability');
title('Kaplan-Meier curve with confidence bands');
hold on
%% upper and lower confidence bands
plot(timeDays,lower, 'b');
hold off

Respuesta aceptada

David Hill
David Hill el 18 de Sept. de 2023
A=readmatrix('data table.csv','Range','A13:D408');
hold on;
patch([timeDays, fliplr(timeDays)], [Lower, fliplr(Upper)], 'g','FaceAlpha',0.2);

Más respuestas (0)


Más información sobre Graphics Performance en Help Center y File Exchange.





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by