Survey.jl icon indicating copy to clipboard operation
Survey.jl copied to clipboard

general `CI` function

Open smishr opened this issue 2 years ago • 0 comments

The latest quantile fn calculates SE using bootweights.

Confidence intervals are important part of statistical analysis. Add Confidence interval lower and upper to package

Usually in surveys there are three options for CI calculation, preferred by different people, and is subjective which is "best".

  • estimate +- N(1-alpha) * SE
  • estimate +- t(sample size -1)(1-alpha) * SE
  • estimate +- e * SE, where e = margin of error (commonly taken e=2 in most surveys)

z-value is usually adequate, as n is large in most surveys. Also, for non-normal data and for more complex sample designs and estimators, the appropriate degrees of freedom are not obvious for using t.

Perhaps keyword options can be passed, and this CI function can be made more general like:

function ci(statistic, SE, type="normal" [,alpha=0.05, e=2] ) with type="t" and type="margin" support

smishr avatar Jan 19 '23 05:01 smishr