I have a list of 500 data (y=500)
I am using bootstrap method in matlab in order to calculate confidence interval.
I am using bootci function,
bootci(1000,@mean,randsample(y, 50, true))
Normally: Here the 50 random data is re-sampled(with replacement) 1000 times from the same 50 data.
I want: Can i do something so the 50 data will be re-sampled 1000 times from not fixed 50 random data but from 500(entire) data?
Is there any other function helps to do it? any solution please?
Is this what you are looking for?:
bootci(1000, @(x) mean(randsample(x, 50, true)), y)
By moving the resampling inside the bootfun
you will get a (potentially) new 50-element sample during each bootsrap sampling (1000 times). Furthermore, by specifying y
as the data argument for bootci
you achieve that the 500-element (full) data is sampled.