From grimoire
Computes and interprets confidence intervals for means, proportions, differences, and regression parameters with proper statistical methodology.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:calculate-confidence-intervalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Compute and correctly interpret confidence intervals to quantify estimation uncertainty for means, proportions, differences, and regression parameters.
Compute and correctly interpret confidence intervals to quantify estimation uncertainty for means, proportions, differences, and regression parameters.
Adopted by: APA Publication Manual 7th ed. (requires CIs for all primary statistics), CONSORT clinical trial reporting standards, New England Journal of Medicine statistical reporting guidelines, Cochrane Collaboration meta-analysis methods.
Impact: Gardner & Altman (BMJ 1986) demonstrated that CIs convey more information than p-values alone; NEJM mandated CIs in 1988 and subsequent studies showed 40% reduction in dichotomous "significant/not significant" misinterpretation. APA made CIs required in 2010.
Why best: A CI provides the precision of an estimate (width) and its plausible range simultaneously, whereas a p-value alone conflates effect size with sample size. CIs are directly usable for clinical or practical significance assessment.
Sources: Neyman Philos Trans R Soc (1937); Gardner & Altman BMJ 292:746 (1986); APA 7th ed. §7.5.
Identify the estimator and its distribution — determine what parameter you are estimating (mean, proportion, difference, correlation, regression coefficient) and the sampling distribution of the estimator (normal, t, chi-square, F, binomial).
Choose the confidence level — use 95% as default (α=0.05); use 99% for regulatory submissions or when Type I error must be minimized; use 90% only when justified by domain convention. State the level explicitly.
Calculate for a population mean (σ unknown) — CI = x̄ ± t_(α/2, n−1) × (s/√n), where t_(α/2, n−1) is the critical value from the t-distribution with n−1 degrees of freedom; use z=1.96 only when n ≥ 30 and σ is known.
Calculate for a proportion — for n×p ≥ 5 and n×(1−p) ≥ 5, use Wilson interval (preferred over Wald): p̂ ± z_(α/2) × √[p̂(1−p̂)/n]. For small samples, use exact Clopper-Pearson method.
Calculate for difference of two means — CI = (x̄₁ − x̄₂) ± t × SE_diff where SE_diff = √(s₁²/n₁ + s₂²/n₂); use Welch-Satterthwaite degrees of freedom if variances are unequal.
Calculate using software — in R: t.test(x, conf.level=0.95)$conf.int; in Python: scipy.stats.t.interval(0.95, df=n-1, loc=mean, scale=sem); in SPSS: enable "Confidence intervals" in Descriptives/Compare Means.
Bootstrap when assumptions fail — for non-normal distributions or complex estimators, use percentile bootstrap: resample with replacement B=10,000 times, compute statistic each time, take 2.5th and 97.5th percentiles as CI bounds.
Report completely — state: estimate [lower CI, upper CI], 95% CI. Example: "Mean difference = 3.2 kg [1.8, 4.6], 95% CI." Always include the confidence level; "95% CI" is not implicit.
npx claudepluginhub jeffreytse/grimoire --plugin grimoireGuides researchers through sample size and power calculations for medical studies, with decision-tree test selection, reproducible R/Python code, and IRB-ready justification.
Provides Python patterns for loading datasets with pandas, exploratory data analysis (descriptive stats, distributions, correlations), statistical tests (t-test, ANOVA), and confidence intervals using scipy and numpy.
Selects statistical tests, interprets effect sizes and confidence intervals, conducts power analysis, verifies assumptions for quantitative research data analysis.