How to calculate the Confidence Interval for a Bland-Altman plot in Excel?
Code to Calculate Confidence Interval for Linear Regression (Sklearn)?
95% Confidence interval for proportion with poisson distribution
Options:
-
The skellam distribution is the distribution of the difference in Poisson variables. You should be able construct a distribution and then get the middle 95% by evaluating inverse cdf (0.025) and icdf(0.975)
https://en.m.wikipedia.org/wiki/Skellam_distribution
2) assume normality, which is pretty reasonable given the sample size. Mean is u1 - u2, and variance is u1 + u2. This is the simplest, but doesn't account for the block correlation.
3) run a Clustered bootstrap: similar to a simulation except you redraw from the sample and draw the clusters together. Then take quantiles of the difference between the two outcomes. This is the most accurate.
See cluster data block bootstrap on wikipedia. It sounds tricky, but it's literally just a couple lines of Python.
More on reddit.comCluster data describes data where many observations per unit are observed. This could be observing many firms in many states, or observing students in many classes https://en.m.wikipedia.org/wiki/Bootstrapping_(statistics)
ELI5 95% Confidence Interval
You're doing a survey on something...let's say favourite fruit. If you want to know what everyone's answer from your kindergarten class is you could easily just ask each one of them. Then you'd have 100% confidence that you've got the right answer.
However, the bigger the population you want to ask...let's say your whole town of 10,000 people...the harder it is to ask all those people!
So you take a sample. You try to pick a group that represents the whole town. The bigger the sample you take, the closer to having a good representation of everyone in town. But after a while, you start getting diminishing returns. Adding one more person to the sample doesn't add as much as the person before, and so on.
But because you're only talking to a few people out of the whole town, you can't be 100% sure. Depending on how many people you talk to, you can say you're 99% sure, or 95%, or any other number for that matter.
More on reddit.comHow to interpret confidence intervals?
If you repeatedly draw samples and use each of them to find a bunch of 95% confidence intervals for the population mean, then the true population mean will be contained in about 95% of these confidence intervals. The remaining 5% of intervals will not contain the true population mean.
What is the z-score for 95% confidence interval?
The z-score for a two-sided 95% confidence interval is 1.959, which is the 97.5-th quantile of the standard normal distribution N(0,1).
What will increase the width of a confidence interval?
The width of a confidence interval increases when the margin of error increases, which happens when the:
- Significance level increases;
- Sample size decreases; or
- Sample variance increases.