how to find confidence interval for not normally distributed data

7 次查看(过去 30 天)
hi,
I wanted to find 95% confidence interval for not normally distributed but I am getting error 'BOOTFUN returns a NaN or Inf'. I dont whats the problem. Please if somebody can help me on this. I have posted code and also attcahed by data.
dData=[R.X1]';
ci = bootci(1000, {@mean, dData}, 'type', 'per', 'alpha', .95)
Error using bootci (line 152)
BOOTFUN returns a NaN or Inf.

回答(1 个)

Jaynik
Jaynik 2024-3-8
Hi Shagun,
I tried reproducing the issue in MATLAB R2023a but the code works without any error. The problem you're encountering might be due to an older release of MATLAB. Please update MATLAB and try again.
Also, the 'alpha', .95 part in your code is incorrect if you're trying to set the confidence level to 95%. The alpha parameter should be set to the significance level which would be 0.05. Hence, the line would become:
ci = bootci(1000, {@mean, dData}, 'type', 'per', 'alpha', .05);

Community Treasure Hunt

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

Start Hunting!

Translated by