Invntr
Source

All instruments

hypothesis_test

Classical tests on small data sets: one-sample, paired and two-sample t (Student and Welch), one-way ANOVA, χ-square goodness of fit and independence, or a plain p-value from a t, z, χ-square or F statistic.

Gives the statistic, degrees of freedom, exact p-value (own incomplete β and γ functions), critical value, effect size and confidence interval.

Field
Measurement and data
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replayhypothesis_test 0.1.0 · files c02180cc8c4e…d08b
  1. r0001Cauchy closed form: t with 1 df, two-sided p(t = 1) = 1 - (2/π) atan(1) = 0.5, tails 1/4 and 3/4passed

    p_value0.5 ± 5 × 10⁻⁷0.5lockedunder 0.01 % of the tolerance used
    p_upper0.25 ± 2.5 × 10⁻⁷0.25lockedunder 0.01 % of the tolerance used
    p_lower0.75 ± 7.5 × 10⁻⁷0.75lockedunder 0.01 % of the tolerance used
  2. r0002Cauchy closed form: t with 1 df, upper tail of t = √(3) is 1/2 - atan(√3)/π = 1/6passed

    p_value0.166667 ± 1.7 × 10⁻⁷0.166667lockedunder 0.01 % of the tolerance used
  3. r0003t with 2 df closed form p = 1 - t/√(t²+2): p(4.302652729749464) = 0.05, and the 5 % critical value is √(2·0.9025/0.0975) (textbook 4.3027)passed

    p_value0.05 ± 5 × 10⁻⁸0.05lockedunder 0.01 % of the tolerance used
    critical_value4.30265 ± 4.3 × 10⁻⁶4.30265lockedunder 0.01 % of the tolerance used
  4. r0004χ-square with 2 df closed form p = exp(-x/2): p(-2 ln 0.05 = 5.9915) = 0.05, critical value 5.991464547107982passed

    p_value0.05 ± 5 × 10⁻⁸0.05lockedunder 0.01 % of the tolerance used
    critical_value5.99146 ± 6 × 10⁻⁶5.99146lockedunder 0.01 % of the tolerance used
  5. r0005χ-square with 2 df closed form p = exp(-x/2) deep in the tail: p(40) = exp(-20)passed

    p_value2.06115 × 10⁻⁹ ± 2.1 × 10⁻¹⁵2.06115 × 10⁻⁹lockedunder 0.01 % of the tolerance used
  6. r0006F(1, 2) = t(2)²: F = 18.51282051282051 (= 4.3027²) gives p = 0.05 and is its own 5 % critical valuepassed

    p_value0.05 ± 5 × 10⁻⁸0.05lockedunder 0.01 % of the tolerance used
    critical_value18.5128 ± 1.9 × 10⁻⁵18.5128lockedunder 0.01 % of the tolerance used
  7. r0007normal: two-sided p(z = 1.96) = erfc(1.96/√2) = 0.04999579029644086; 5 % critical value is the textbook 1.959963984540054passed

    p_value0.0499958 ± 5 × 10⁻⁸0.0499958lockedunder 0.01 % of the tolerance used
    critical_value1.95996 ± 2 × 10⁻⁶1.95996lockedunder 0.01 % of the tolerance used
  8. r0008large df limit: t with 10⁶ df, p(1.96) tends to the normal 0.0499958; tolerance 10⁻⁶ absolute because the t-to-normal gap is of order 1/df (about 3 × 10⁻⁷ here)passed

    p_value0.0499958 ± 10⁻⁶0.0499961locked28 % of the tolerance used
  9. r0009Student pooled t by hand, [1,2,3] vs [4,5,6]: t = -3/√(2/3), df 4, p from the 4-df closed form 1 - x(1 + (1-x²)/2) with x = t/√(t²+4), d = -3, Hedges g = -3 √(2/π)passed

    statistic-3.67423 ± 3.7 × 10⁻⁶-3.67423lockedunder 0.01 % of the tolerance used
    df4 ± 4 × 10⁻⁶4lockedunder 0.01 % of the tolerance used
    p_value0.0213116 ± 2.1 × 10⁻⁸0.0213116lockedunder 0.01 % of the tolerance used
    cohen_d-3 ± 3 × 10⁻⁶-3lockedunder 0.01 % of the tolerance used
    hedges_g-2.39365 ± 2.4 × 10⁻⁶-2.39365lockedunder 0.01 % of the tolerance used
    estimate-3 ± 3 × 10⁻⁶-3lockedunder 0.01 % of the tolerance used
    pooled_sd1 ± 10⁻⁶1lockedunder 0.01 % of the tolerance used
    reject_null= truetruelockedexact match
  10. r0010identical group means: Welch t on [1,2,3] vs [3,2,1] gives t = 0, p = 1, df 4 (equal variances and sizes)passed

    statistic0 ± 10⁻¹²0lockedunder 0.01 % of the tolerance used
    p_value1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance used
    df4 ± 4 × 10⁻⁶4lockedunder 0.01 % of the tolerance used
    reject_null= falsefalselockedexact match
  11. r0011one-sample t by hand, [5,7,9] against μ₀ = 5: t = √3, df 2, p = 1 - √(3/5), 95 % interval 7 ± 4.3027·2/√3, d = 1passed

    statistic1.73205 ± 1.7 × 10⁻⁶1.73205lockedunder 0.01 % of the tolerance used
    df2 ± 2 × 10⁻⁶2lockedunder 0.01 % of the tolerance used
    p_value0.225403 ± 2.3 × 10⁻⁷0.225403lockedunder 0.01 % of the tolerance used
    ci_low2.03172 ± 2 × 10⁻⁶2.03172lockedunder 0.01 % of the tolerance used
    ci_high11.9683 ± 1.2 × 10⁻⁵11.9683lockedunder 0.01 % of the tolerance used
    se1.1547 ± 1.2 × 10⁻⁶1.1547lockedunder 0.01 % of the tolerance used
    cohen_d1 ± 10⁻⁶1lockedunder 0.01 % of the tolerance used
  12. r0012Welch t by hand, [0,2] vs [3,5]: t = -3/√2, Welch-Satterthwaite df = 2, p = 1 - |t|/√(t²+2)passed

    statistic-2.12132 ± 2.1 × 10⁻⁶-2.12132lockedunder 0.01 % of the tolerance used
    df2 ± 2 × 10⁻⁶2lockedunder 0.01 % of the tolerance used
    p_value0.16795 ± 1.7 × 10⁻⁷0.16795lockedunder 0.01 % of the tolerance used
  13. r0013Welch-Satterthwaite by hand, [1,2,3,4,5] vs [2,4,6]: t = -1/√(11/6), df = 484/137passed

    statistic-0.738549 ± 7.4 × 10⁻⁷-0.738549lockedunder 0.01 % of the tolerance used
    df3.53285 ± 3.5 × 10⁻⁶3.53285lockedunder 0.01 % of the tolerance used
    se1.35401 ± 1.4 × 10⁻⁶1.35401lockedunder 0.01 % of the tolerance used
  14. r0014paired t by hand, [10,12,14] vs [5,5,5]: differences 5,7,9, t = 7 √(3)/2, df 2, p = 1 - t/√(t²+2)passed

    statistic6.06218 ± 6.1 × 10⁻⁶6.06218lockedunder 0.01 % of the tolerance used
    df2 ± 2 × 10⁻⁶2lockedunder 0.01 % of the tolerance used
    p_value0.0261483 ± 2.6 × 10⁻⁸0.0261483lockedunder 0.01 % of the tolerance used
    estimate7 ± 7 × 10⁻⁶7lockedunder 0.01 % of the tolerance used
  15. r0015one-way ANOVA of two groups equals t²: [[1,2,3],[4,5,6]] gives F = 13.5 on (1, 4) df, the same p as the pooled t (0.0213116...), η squared = 13.5/17.5passed

    statistic13.5 ± 1.3 × 10⁻⁵13.5lockedunder 0.01 % of the tolerance used
    df1 ± 10⁻⁶1lockedunder 0.01 % of the tolerance used
    df24 ± 4 × 10⁻⁶4lockedunder 0.01 % of the tolerance used
    p_value0.0213116 ± 2.1 × 10⁻⁸0.0213116lockedunder 0.01 % of the tolerance used
    eta_squared0.771429 ± 7.7 × 10⁻⁷0.771429lockedunder 0.01 % of the tolerance used
    ss_between13.5 ± 1.3 × 10⁻⁵13.5lockedunder 0.01 % of the tolerance used
    ss_within4 ± 4 × 10⁻⁶4lockedunder 0.01 % of the tolerance used
  16. r0016goodness of fit by hand, [30,10,20] against equal shares: χ₂ = 10, df 2, p = exp(-5), Cohen w = √(1/6)passed

    statistic10 ± 10⁻⁵10lockedunder 0.01 % of the tolerance used
    df2 ± 2 × 10⁻⁶2lockedunder 0.01 % of the tolerance used
    p_value0.00673795 ± 6.7 × 10⁻⁹0.00673795lockedunder 0.01 % of the tolerance used
    cohens_w0.408248 ± 4.1 × 10⁻⁷0.408248lockedunder 0.01 % of the tolerance used
  17. r0017independence by hand, [[20,10,30],[10,20,30]]: χ₂ = 20/3, df 2, p = exp(-10/3), Cramer V = √(1/18)passed

    statistic6.66667 ± 6.7 × 10⁻⁶6.66667lockedunder 0.01 % of the tolerance used
    df2 ± 2 × 10⁻⁶2lockedunder 0.01 % of the tolerance used
    p_value0.035674 ± 3.6 × 10⁻⁸0.035674lockedunder 0.01 % of the tolerance used
    cramers_v0.235702 ± 2.4 × 10⁻⁷0.235702lockedunder 0.01 % of the tolerance used
  18. r00182 × 2 with Yates by hand, [[10,20],[20,10]]: χ₂ = 4·(4.5²)/15 = 5.4, df 1, p = erfc(√2.7)passed

    statistic5.4 ± 5.4 × 10⁻⁶5.4lockedunder 0.01 % of the tolerance used
    df1 ± 10⁻⁶1lockedunder 0.01 % of the tolerance used
    p_value0.0201368 ± 2 × 10⁻⁸0.0201368lockedunder 0.01 % of the tolerance used
    phi0.3 ± 3 × 10⁻⁷0.3lockedunder 0.01 % of the tolerance used
  19. r0019χ-square with 4 df closed form p = exp(-x/2)(1 + x/2): p(6) = 4 exp(-3)passed

    p_value0.199148 ± 2 × 10⁻⁷0.199148lockedunder 0.01 % of the tolerance used
  20. r0020F(2, 4) closed form p = (1 + f/2)⁻²: p(3) = 0.16, 5 % critical value 2(√20 - 1)passed

    p_value0.16 ± 1.6 × 10⁻⁷0.16lockedunder 0.01 % of the tolerance used
    critical_value6.94427 ± 6.9 × 10⁻⁶6.94427lockedunder 0.01 % of the tolerance used
  21. r0021Cauchy closed form, one-sided critical values past the median: t with 1 df, alternative greater, α = 0.75 has critical value tan(π(1/2 - 3/4)) = -1; p(t = 1) = 1/4passed

    critical_value-1 ± 10⁻⁶-1lockedunder 0.01 % of the tolerance used
    p_value0.25 ± 2.5 × 10⁻⁷0.25lockedunder 0.01 % of the tolerance used
    reject_null= truetruelockedexact match
  22. r0022Cauchy closed form: t with 1 df, alternative less, α = 0.75 has critical value +1; p(t = 1) = 3/4passed

    critical_value1 ± 10⁻⁶1lockedunder 0.01 % of the tolerance used
    p_value0.75 ± 7.5 × 10⁻⁷0.75lockedunder 0.01 % of the tolerance used
  23. r0023non-integer df, F(2, n) closed form p = (1 + 2f/n)^(-n/2) for any n: F(2, 484/137) at f = 1.7passed

    p_value0.303959 ± 3 × 10⁻⁷0.303959lockedunder 0.01 % of the tolerance used
  24. r0024non-integer df, F(m, 2) closed form p = 1 - (m f/(2 + m f))^(m/2) for any m: F(2.7, 2) at f = 3.3passed

    p_value0.239198 ± 2.4 × 10⁻⁷0.239198lockedunder 0.01 % of the tolerance used
  25. r0025three-group ANOVA by hand, [[1,2,3],[2,3,4],[5,6,7]]: SSB = 26, SSW = 6, F = 13 on (2, 6) df, p = (1 + 2·13/6)⁻³ = 27/4096 exactlypassed

    statistic13 ± 1.3 × 10⁻⁵13lockedunder 0.01 % of the tolerance used
    df2 ± 2 × 10⁻⁶2lockedunder 0.01 % of the tolerance used
    df26 ± 6 × 10⁻⁶6lockedunder 0.01 % of the tolerance used
    p_value0.0065918 ± 6.6 × 10⁻⁹0.0065918lockedunder 0.01 % of the tolerance used
    ss_between26 ± 2.6 × 10⁻⁵26lockedunder 0.01 % of the tolerance used
    ss_within6 ± 6 × 10⁻⁶6lockedunder 0.01 % of the tolerance used
    eta_squared0.8125 ± 8.1 × 10⁻⁷0.8125lockedunder 0.01 % of the tolerance used
  26. r0026Welch p at non-integer df 484/137, [1,2,3,4,5] vs [2,4,6]: NOT a closed form; p = 0.50621417165285 from Simpson integration of the t density (python math, 200000 panels, two routes agreeing to 1.4 × 10⁻¹⁴), independent of this programpassed

    p_value0.506214 ± 5.1 × 10⁻⁷0.506214lockedunder 0.01 % of the tolerance used
26 of 26 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
testwelch_tWhich test to run.
xFirst sample (t tests). Any one unit; the estimate and interval come back in it.
ySecond sample (paired, two-sample and Welch t), same unit as x.
mu00.0Null value of the mean (one-sample) or of the mean difference (paired, two-sample), in the unit of x.
groupsANOVA: one list of values per group.
observedGoodness of fit: observed counts per category.
expectedGoodness of fit: expected counts or proportions per category (rescaled to the observed total). Left out: equal shares.
ddof10Goodness of fit: parameters estimated from the data, taken off the degrees of freedom.
tableIndependence: contingency table of counts, rows by columns.
yatesfalseIndependence: Yates' continuity correction (2 × 2 tables only).
statistic1p_value: the statistic to convert.
distributiontp_value: the null distribution.
df1p_value: degrees of freedom (numerator for F). At most 10⁶: above that the p-value loses digits and the run is refused.
df21p_value: denominator degrees of freedom for F. At most 10⁶: above that the p-value loses digits and the run is refused.
alternativetwo_sidedAlternative hypothesis for t and z. Chi-square and F are always upper-tailed.
alpha10.05Significance level.
confidence10.95Confidence level of the intervals.

Readings

NameUnitMeaning
statistic1
df1
df21
p_value1
p_two_sided1
p_upper1
p_lower1
critical_value1
alpha1
confidence1
cohen_d1
hedges_g1
eta_squared1
omega_squared1
cohens_w1
cramers_v1
phi1
effect_size1
n_total1

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call