Help with MATLAB bootci function.

13 views (last 30 days)
Nicholas Owen
Nicholas Owen on 20 Sep 2021
Answered: Ayush Modi on 22 Feb 2024
Hi All,
I have some data that is heavily skewed towards the right (see below). This data consists of range values from subsets of a greater data set.
I am trying to use 'bootci' to find confidence intervals but I am having issues with the 'bootfun' input.
I have tried a number of options including @mean, @range, @std as well as a number of formulas, however the resulting confidence intervals are way off (very low and narrow).
Information in other community questions have not been able to help, although this page got close - https://comp.soft-sys.matlab.narkive.com/txMFOYpl/can-anyone-tell-me-how-to-use-the-bootci-function.
What exactly is the bootfun input and how can I apply it in a way that will yeild a 95% confidence interval of the skewed data?
Thanks in advance!

Answers (1)

Ayush Modi
Ayush Modi on 22 Feb 2024
Hi Nicholas,
The "bootfun" input parameter in the "bootci" function is a handle to a function that computes the statistic of interest from the resampled data. With skewed data, using the mean as the statistic might not always be appropriate because the mean is sensitive to outliers and skewness. Instead, you might consider trimmed mean using "trimmean" function or custom statistics function, which can give a better central tendency measure for skewed distributions.
Here is an example how you can use custom function handle in "bootci" function:
ci = bootci(nboot, @(data) customFunction(data), data);
Please refer to the following MathWorks documentation for more information on the "bootci" function:

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!