Confidence Interval for a Ratio of Variances Calculator
Sample variances of 25 and 16 from 20 and 24 observations give a ratio of 1.5625, and the 95 percent interval around it includes 1. Enter both variances, both sample sizes and a confidence level to compare the spread of two groups. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Sample variance 1
- 25
- Size 1
- 20
- Sample variance 2
- 16
- Size 2
- 24
- Confidence level
- 0.95
- Variance ratio
- 1.5625
- Lower bound
- 0.6580426644
- Upper bound
- 3.8512324568
- Numerator degrees freedom
- 19
This confidence interval for a ratio of variances calculator estimates how much the variability of one normally distributed population differs from another. Provide two positive sample variances, their sample sizes, and a confidence level expressed as a decimal. The calculator returns the observed variance ratio, the two-sided confidence bounds, both degrees of freedom, and the F critical values used. It is designed for independent random samples and makes the calculation reproducible without tables or manual interpolation.
Enter comparable sample statistics
Enter the first sample variance in the numerator position and the second sample variance in the denominator position. Both values must be positive and should be calculated with the usual n minus one denominator. The corresponding sizes are the numbers of observations used to calculate those variances, not degrees of freedom; the calculator subtracts one from each size.
Each size must be at least two because a smaller sample cannot supply positive degrees of freedom for this procedure. Write the confidence level as a decimal, such as 0.95 for a 95 percent interval. The two variables must use compatible measurement units if the ratio is to have a useful interpretation.
For example, two variances measured in square millimeters form a dimensionless ratio, while variances from unrelated scales do not support a meaningful direct comparison. If you have sample standard deviations, square them before entry. The order matters: exchanging the samples replaces the reported ratio with its reciprocal and also exchanges the roles of the F-distribution degrees of freedom.
Record that order consistently when comparing results across reports or automated runs.
How the F interval is calculated
The point estimate is the first sample variance divided by the second. Under independent sampling from normal populations, a scaled ratio of the two sample variances follows an F distribution with n one minus one numerator degrees of freedom and n two minus one denominator degrees of freedom. The calculator divides the probability outside the requested confidence level equally between the lower and upper tails.
It obtains both F critical values by evaluating the regularized incomplete beta function and applying a fixed bisection search. The upper critical value divides the observed ratio to produce the lower confidence bound, while the lower critical value divides the ratio to produce the upper bound. This reversal is essential and is a frequent error in hand calculations.
The returned critical values and degrees of freedom expose every quantity needed to audit the result. All iterations are bounded, and the implementation uses no lookup service, random simulation, current date, or external state. The calculation does not round intermediate quantities; display values are normalized only at the final output stage.
Interpret the bounds with the assumptions in view
A ratio of one means that the two population variances are equal, so an interval containing one indicates that equality remains compatible with the data at the selected confidence level. An interval entirely above one supports greater variability in the first population, while an interval entirely below one supports greater variability in the second. This is closely related to a two-sided F test, but the interval is often more informative because it gives a range of plausible effect sizes rather than only a rejection decision.
Confidence has a repeated-sampling meaning: under the model assumptions, the stated proportion of intervals constructed from repeated samples would contain the true variance ratio. It is not a posterior probability for this one fixed interval. Normality and independence matter strongly here.
Variance methods are especially sensitive to outliers, skewed distributions, heavy tails, clustered measurements, and dependence between the samples. Inspect the raw observations and the sampling design before relying on the interval. Larger samples usually narrow the interval, whereas small samples can create very wide asymmetric bounds.
What you can do with it
Compare manufacturing consistency
Estimate how the variance of measurements from one production line compares with that of another line under comparable sampling conditions.
Report a variability effect size
Add an interval for the variance ratio to a study instead of reporting only whether an F test rejects equal variances.
FAQ
What assumptions does this confidence interval require?
It assumes two independent random samples from approximately normal populations. Outliers, skewness, heavy tails, or dependent samples can make coverage inaccurate.
Which sample belongs in the numerator?
The first sample is the numerator and the second is the denominator. Reverse them if the reciprocal comparison is the quantity you want to report.
Can I enter standard deviations?
Not directly. Square each sample standard deviation to obtain the corresponding positive sample variance before using the calculator.
What does it mean if the interval contains one?
A population variance ratio of one remains compatible with the observations at the chosen confidence level; the interval does not establish that the variances are identical.
Why does each sample need at least two observations?
Because the calculator subtracts one from each size to get the degrees of freedom, and a single observation would leave none. Enter the number of observations, not the degrees of freedom.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/stat/ci-ratio-variances \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"sample_variance_1":25,"size_1":20,"sample_variance_2":16,"size_2":24,"confidence_level":0.95}'const res = await fetch("https://api.kit.forhosting.com/stat/ci-ratio-variances", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"sample_variance_1": 25,
"size_1": 20,
"sample_variance_2": 16,
"size_2": 24,
"confidence_level": 0.95
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/ci-ratio-variances",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"sample_variance_1": 25,
"size_1": 20,
"sample_variance_2": 16,
"size_2": 24,
"confidence_level": 0.95
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/ci-ratio-variances", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"sample_variance_1":25,"size_1":20,"sample_variance_2":16,"size_2":24,"confidence_level":0.95}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"sample_variance_1":25,"size_1":20,"sample_variance_2":16,"size_2":24,"confidence_level":0.95}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/ci-ratio-variances", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"sample_variance_1": 25,
"size_1": 20,
"sample_variance_2": 16,
"size_2": 24,
"confidence_level": 0.95
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.ci_ratio_variances",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
How the F interval is calculated
Consequently, identical inputs produce identical numeric output in the browser and through the API.
Interpret the bounds with the assumptions in view
For reproducible reporting or batch analysis, the same deterministic result is available through the API for $0.002 per request.
Integration use cases
Validate analytical pipelines
Generate deterministic F critical values and confidence bounds for regression tests, reports, or statistical workflow checks.
Technical questions
Why must each sample size be at least two?
A sample smaller than two has no positive degrees of freedom for a sample variance, so the request returns an invalid-input error.
What does API use cost?
Each API request costs $0.002; the same deterministic calculation is also available in the browser.