MATLAB: Calculating 95% confidence intervals when there are nans in the dataset

confidence intervalnormfit

I used normfit to calculate the 95% CI for data that did not have nans HOWEVER now I have a bunch of data that does have nans that I need to calculate 95% CI of the mean. Anyone have any ideas how best to do this?

Best Answer

Why not remove the nans
[muhat,sigmahat,muci,sigmaci] = normfit(data(~isnan(data)));
Related Question