mayer79 / confintr

R package for calculation of standard and bootstrap confidence intervals
https://mayer79.github.io/confintr/
GNU General Public License v2.0
15 stars 2 forks source link

Suggestion: Confidence intervals of ratio and difference in variance and standard deviation #8

Open DrJerryTAO opened 1 year ago

DrJerryTAO commented 1 year ago

Hi @mayer79, would you consider adding function for confidence intervals of variance and standard deviation ratio and difference between two (independent) samples? I once wrote R functions that calculate student and percentile bootstrap confidence intervals of standard deviation ratios between two independent samples, based on both raw ratio and its logarithm. I do not think the asymptotic "normal" bootstrap is appropriate, as the ratios are usually skewed. It is probably better to generate confidence intervals of variance ratios first, then transform them to those of standard deviation ratios. I assume the logarithm of a ratio is less skewed than its raw form and possibly has a better property when forming confidence intervals, but I have not explored its theoretic or empirical basis. I can show my script if needed.

The following sources might be helpful

mayer79 commented 1 year ago

Thanks a lot for this great input. I'd love to have some of those methods in {confintr}! Is your code publicly available?

Before adding new methods to {confintr}, I would like to improve the unit tests. Somehow, I find it very difficult to write good tests, especially with the Bootstrap.

DrJerryTAO commented 1 year ago

What did you mean by "unit tests?"

You can find my script at https://github.com/MrJerryTAO/ under the file balance.IPW_MrJerryTAO.R. But I realized that I made a mistake in the variance of of the sample standard deviation. However, it might be better to use the variance of of the sample variance directly, as the formula for variance of of the sample standard deviation comes from a delta method approximation based on the variance of of the sample variance directly.