Compute the histogram bar heights based on the empirical cumulative distribution function.

Generate failure times from a Birnbaum-Saunders distribution.

Assuming that the end of the study is at time 0.9, mark the generated failure times that are larger than 0.9 as censored data and store that information in a vector.

Compute the empirical cumulative distribution function for the data.

Now, find the bar heights of the histogram using the cumulative distribution function estimate.

ans =
2.3529 0.0715
1.7647 0.1565
1.4117 0.2415
1.5294 0.3265
1.0588 0.4115
0.4706 0.4965
0.4706 0.5815
0.9412 0.6665
0.2353 0.7515
0.2353 0.8365

Compute the bar heights for six bins using the empirical cumulative distribution function and also return the bin centers.

Generate failure times from a Birnbaum-Saunders distribution.

Assuming that the end of the study is at time 0.9, mark the generated failure times that are larger than 0.9 as censored data and store that information in a vector.

First, compute the empirical cumulative distribution function for the data.

Now, estimate the histogram with six bins using the cumulative distribution function estimate.

ans =
1.9764 0.0998
1.7647 0.2415
1.1294 0.3831
0.4235 0.5248
0.7764 0.6665
0.2118 0.8081

Draw the histogram of the empirical cumulative distribution histogram for specified bin centers.

Generate failure times from a Birnbaum-Saunders distribution.

Assuming that the end of the study is at time 0.9, mark the generated failure times that are larger than 0.9 as censored data and store that information in a vector.

Define bin centers.

Compute the empirical cumulative distribution function for the data and draw the histogram for specified bin centers.

Generate right-censored survival data and compare the histogram from cumulative distribution function with the known probability distribution function.

Generate failure times from an exponential distribution with mean failure time of 15.

Generate drop-out times from an exponential distribution with mean failure time of 30.

Record the minimum of these times as the observed failure times.

Generate censoring by finding the generated failure times that are greater than the drop-out times.

Calculate the empirical cdf and plot a histogram using the empirical cumulative distribution function.

Superimpose a plot of the known population pdf.