Statistics Toolbox
  Go to function:
    Search    Help Desk 
bootstrp    Examples

Bootstrap statistics through resampling of data.

Syntax

Description

bootstrp(nboot,'bootfun',d1,...) draws nboot bootstrap data samples and analyzes them using the function bootfun. nboot must be a positive integer. bootstrp passes the data d1, d2, etc., to bootfun.

[bootstat,bootsam] = bootstrap(...) returns the bootstrap statistics in bootstat. Each row of bootstat contains the results of applying 'bootfun' to one bootstrap sample. If 'bootfun' returns a matrix, then this output is converted to a long vector for storage in bootstat. bootsam is a matrix of indices into the rows of the data matrix.

Example

Correlate the LSAT scores and and law-school GPA for 15 students. These 15 data points are resampled to create 1000 different datasets, and the correlation between the two variables is computed for each dataset.

The histogram shows the variation of the correlation coefficient across all the bootstrap samples. The sample minimum is positive indicating that the relationship between LSAT and GPA is not accidental.



[ Previous | Help Desk | Next ]