MATLAB: How to specify stderr when using bootci to compute bootstrap studentized confidence interval

bootcibootstrapstudentized

I want to compute the studentized bootstrap interval for the mean. The quantity to be computed for each bootstrap sample should be:
(mean(x)-mean(data))./std(x)
where x is a bootstrap sample. I can program this on my own, but I am not sure how to specify the same thing using the function bootci:
ci = bootci(B,{function1,data},'type','stud','stderr',function2);
What should I write for function1 and function2? I have tried several things but the coverages I get from these intervals turn out to be wrong (compared to my own program which I know is correct). I am specifying something incorrectly. Do I specify the divisor std(bootstrapsample) in function1, or in function2 (or in both)? The documentation is sparse.

Best Answer

It is not exactly clear what you are trying to do as you introduce x without explaining what it is. Assuming that you want to bootstrap samples and create a confidence interval round the mean then you do not need to specify function2. function1 would simply be a handle to the mean function as this is what you are looking for the interval on.
ci = bootci(B,{@mean,data},'type','stud')
This will give you a confidence interval around the mean for the variables in each column of data.