Statistics Toolbox    
cdfplot

Plot of empirical cumulative distribution function

Syntax

Description

cdfplot(X) displays a plot of the empirical cumulative distribution function (cdf) for the data in the vector X. The empirical cdf is defined as the proportion of X values less than or equal to x.

This plot, like those produced by hist and normplot, is useful for examining the distribution of a sample of data. You can overlay a theoretical cdf on the same plot to compare the empirical distribution of the sample to the theoretical distribution.

The kstest, kstest2, and lillietest functions compute test statistics that are derived from the empirical cdf. You may find the empirical cdf plot produced by cdfplot useful in helping you to understand the output from those functions.

H = cdfplot(X) returns a handle to the cdf curve.

[h,stats] = cdfplot(X) also returns a stats structure with the following fields.

Field
Contents
stats.min
Minimum value
stats.max
Maximum value
stats.mean
Sample mean
stats.median
Sample median (50th percentile)
stats.std
Sample standard deviation

Examples

Generate a normal sample and an empirical cdf plot of the data.

See Also

ecdf, hist, kstest, kstest2, lillietest, normplot


  cdf chi2cdf