MEANCIBOOT This macro is designed to calculate bootstrap confidence intervals for a population mean. RUNNING THE MACRO Calling statement meanciboot c1 ; siglev k1 (95) ; nboot k1 (2000); means c1 ; quantiles c1-c3 ; tvalues c1. Input Input to the macro must be a single column, containing only numerical values. Subcommands siglev The significance level of the confidence interval, expressed as a percentage. The default is 95 (corresponding to 95% significance); other standard choices are 90, 98 or 99. nboot The number of bootstrap samples used. The default is 2000. It is not recommend to use less than 1000 for the construction of confidence intervals. means Specify a column in which to store bootstrap sample means. quantiles Specify three columns in which to store ranks corresponding to the lower and upper confidence interval limits, for the standard percentile method (column 1), the BC method (column 2) and the BCa method (column 3). tvalues Specify a column in which to bootstrap sample t-statistics. Output Basic information (number of data points, significance level, number of bootstrap samples) Sample mean, with associated standard error Sample standard deviation Bootstrap standard deviation about the estimated mean Overall bootstrap mean Estimated bias correction (for BC and BCa methods) Estimated acceleration (for BCa method) Standard bootstrap confidence interval Bootstrap confidence intervals using : Estimate -/+ 1.96*bootstrap standard deviation, Bootstrap-t method, Efron percentile method, Hall percentile method, BC method, BCa method. Speed of macro : FAST Missing data : Allowed ALTERNATIVE PROCEDURES Standard procedures tinterval c1 This produces a confidence interval about a mean value, in the situation in which variance is unknown. zinterval k1 c1 This produces a confidence interval about a mean value, where the variance is known to be k1. REFERENCES MANLY, F.J. (1997) Randomization, bootstrap and Monte Carlo methods in biology, Chapman and Hall, London (Chapter 3). EFRON, B. & TIBSHIRANI, J. (1993) An introduction to the Bootstrap, Chapman and Hall, London (Chapters 12-14). WORKED EXAMPLE FOR MEANCIBOOT Name of dataset EXPONENTIAL Description The data are 20 realisations from an Exponential distribution with rate parameter 1. Source MANLY, F.J. (1997) Randomization, bootstrap and Monte Carlo methods in biology, Chapman and Hall, London. Data Number of observations = 20 Number of variables = 1 3.56 0.69 0.10 1.84 3.93 1.25 0.18 1.13 0.27 0.50 0.67 0.01 0.61 0.82 1.70 0.39 0.11 1.20 1.21 0.72 Worksheet C1 Data Aims of analysis To create confidence intervals for the population mean. Standard procedure MTB > Retrieve "N:\resampling\Examples\Exponential.MTW". Retrieving worksheet from file: N:\resampling\Examples\Exponential.MTW # Worksheet was saved on 23/08/01 12:16:52 Results for: Exponential.MTW MTB > OneT c1. One-Sample T: C1 Variable C1 N 20 Mean 1.044 StDev SE Mean 1.060 0.237 95.0% CI (0.549, 1.540) Resampling procedure MTB > % N:\resampling\library\meanciboot c1 ; SUBC> siglev 95 ; SUBC> nboot 1000 ; 2 SUBC> means c3 ; SUBC> quantiles c5-c7 ; SUBC> tvalues c9. Executing from file: N:\resampling\library\meanciboot.MAC Data Display STANDARD CONFIDENCE INTERVALS Data Display (WRITE) Number of data values 20 Mean of data values 1.0445 Standard deviation of data values 1.0597 Standard error of the mean 0.23695 Significance level for confidence intervals 95 Estimated confidence interval, lower bound (Standard t method) Estimated confidence interval, upper bound (Standard t method) 0.54855 1.5404 BOOTSTRAP CONFIDENCE INTERVALS Data Display (WRITE) Number of bootstrap samples 1000 Overall mean for bootstrap samples 1.042 Standard deviation of bootstrap means 0.2407 Estimated bias-correction (for BC, BCa) 0.0652 Estimated acceleration (for BCa) 0.0612 Confidence limits Data Display (WRITE) Estimate -/+ 1.96*boot sd Bootstrap-t method 0.5727 0.6405 1.516 1.932 Efron percentile method Hall percentile method 0.6255 0.5355 1.553 1.463 BC percentile method BCa percentile method 0.6400 0.6650 1.580 1.718 Modified worksheet C3 A column containing 1000 sample means, one for each bootstrap resample C5 Upper and lower rank positions for percentile confidence limits using the Efron method C6 Upper and lower rank positions for percentile confidence limits using the Efron method C7 Upper and lower rank positions for percentile confidence limits using the Efron method C9 A column containing 1000 t-statistics for sample means, one for each bootstrap resample Columns c5 - c7 each contain 2 values. 3 Discussion There is a fair amount of variation between the different confidence intervals. All 7 intervals include the true population mean of one. The Efron percentile method produces the shortest interval in this case, the bootstrap t-interval the longest. The bootstrap-t and BCa intervals generally imply larger values for the mean, whilst the Hall, standard t and estimate -/+ 1.96 * bootstrap standard deviation intervals generally imply smaller values for the mean. These are not general properties of the different methods, however. Manly (1997) performs a simulation study to investigate the coverage of the different bootstrap intervals for a sample of 20 observations from an exponential distribution with rate parameter one. He finds that the bootstrap-t method (with 95.2% coverage) has the closest coverage to the nominal 95% level, closely followed by the BCa method (with 92.4% coverage). 4