MATLAB: Color of Kaplan meiern with ecdf function color kaplan-meier ecdf Hello, How can I change the color of plots that are made with ecdf? ecdf(days,'frequency',s_xrt,'function','survivor'); Best Answer You cannot. Instead, ask for the outputs and plot the data yourself.Example —rng default % for reproducibilityfailuretime = random('birnbaumsaunders',0.3,1,100,1);T = 0.9;cens = (failuretime>T);[f,x,flo,fup] = ecdf(failuretime,'function','cumulative hazard',...'censoring',cens,'bounds','on');figure(1)stairs(x, f, '-r')hold onstairs(x, flo, ':g', 'LineWidth',1)stairs(x, fup, ':g', 'LineWidth',1)hold offxlabel('x')ylabel('H(x)')gridExperiment to get the result you want. Related SolutionsMATLAB: How can I put the histfit function in terms of probability That is not directly possible with histfit, however it is not impossible: data = randn(1,100)+1; % Create Vectorfigurehistfit(data) % Originalhh = histfit(data);figureybar = hh(1).YData;bar(hh(1).XData, ybar/sum(ybar), 'BarWidth',1) % Probabilityhold onplot(hh(2).XData, hh(2).YData/sum(ybar), 'r', 'LineWidth',2)hold off. MATLAB: Compute the p-value of Kaplan Meier curve See here:https://www.mathworks.com/matlabcentral/fileexchange/22317-logrankBtw, at some point you probably wanna consider moving to R for statistical analysis (MATLAB is very underdeveloped for such purposes). In that case, see R survfit. Related QuestionGraficar una señal discreta a partir de una matrizHow to plot pdf and cdf on the histogramsCompare empirical CDF and lognormal CDFDoes the ecdf function return duplicate x valuesHow to go about finding the standard normal probability based on the z-scoreNeed help making a stairs graph
Best Answer