Math calculator

Mixed Model Calculator

Variance in two parts.

Variance in two parts

Twenty-four groups of fifteen. The between-group variance is 25.419 and the within-group variance 79.946, giving an intraclass correlation of 0.2412 — F is 5.769 with p = 0.0000000000000755, so the grouping is unmistakable. The design effect at fifteen per group is 4.3774, so 360 observations carry the information of 82.24. The consequence is the pair of standard errors below: ignoring the grouping gives 0.54100 for the grand mean and respecting it gives 1.13189, which is 2.0922 times larger and exactly the square root of the design effect.

360 observations · 24 groups · 15.00 per group on average

Intraclass correlation 0.2412 — 360 observations carry the information of 82.24

Ignoring the grouping gives a standard error of 0.54100 for the overall mean. Respecting it gives 1.13189 — 2.0922 times larger, which is exactly the square root of the design effect. An analysis treating these rows as independent reports an interval 0.478 times the width it should be.

Intraclass correlation

0.2412

between over total variance

Design effect

4.3774

effective n 82.24 of 360

Standard error inflated

2.0922×

0.5410 becomes 1.1319

Group effect

5.769

F on 23 and 336 df, p = 7.55e-14

Where the variance sits

The two variance components with their shares and the mean squares behind them
ComponentVarianceShareFrom
Between groups25.418624.12%mean square 461.225
Within groups79.945975.88%mean square 79.946
Total105.3645100%grand mean 61.6900

The between-group variance is the difference between the two mean squares, divided by the group size. When the between-group mean square is the smaller of the two the difference is negative, which is impossible for a variance, and it is truncated to zero — so estimates pile up at zero whenever the true correlation is small.

Group means, pulled towards the centre

Each group’s observed mean and its shrunk estimate
GroupnObserved meanShrunk estimatePulled by
11560.27360.5190.246
21561.41361.4610.048
31559.49359.8740.381
41566.17365.396-0.777
51567.16766.217-0.949
61566.28065.484-0.796
71574.22772.054-2.173
81566.64065.782-0.858
91563.00062.773-0.227
101561.63361.6430.010
111555.45356.5341.081
121558.31358.8990.585

The shrinkage factor here is 0.8267: each group mean is pulled that far from the grand mean towards its own observed value. A small group with an extreme mean gets pulled hardest, which is the point — its mean is the least reliable, and treating it at face value is how a league table ends up with a tiny unit at the top.

The standard error ratio is exactly the square root of the design effect, which the verification suite asserts on eighty generated designs along with the design effect matching its closed form at the average group size. The correlation estimator is separately checked for bias across 120 replications at a known true value.

This is the classical variance-components estimator, not restricted maximum likelihood. It is exact arithmetic on the mean squares and it can return a negative between-group variance, which is truncated to zero. Likelihood-based software will give a slightly different correlation on the same data, and will not produce a negative estimate to truncate.

Two variance components Both standard errors Shrunk group means Moments, not likelihood

What this tool shows

On the shipped preset the intraclass correlation is 0.2412, so 360 observations carry the information of 82.24 — and the standard error for the overall mean goes from 0.54100 to 1.13189. Exactly 2.0922 times larger, which is the square root of the design effect. An analysis treating those 360 rows as independent reports a confidence interval less than half the width it should have, and nothing inside that analysis says so.

  • Between-group and within-group variance components, with the mean squares they come from
  • The intraclass correlation and the design effect it implies at the average group size
  • Both standard errors for the overall mean — ignoring the grouping and respecting it
  • Shrunk group means, with the factor that pulls each towards the centre
  • An F test for whether the grouping matters at all
  • A preset where the between-group variance estimate is negative and truncated to zero
Two variance components Both standard errors Shrunk group means Moments, not likelihood

Method of moments, not restricted maximum likelihood.

Updated 13 September 2026 · Works in any browser, no installation

A random-intercept model splits the variance into a part that differs between groups and a part that differs within them, and the ratio between them is the intraclass correlation. Everything else follows: how much of a study’s apparent size is real, how far a group mean should be trusted, and how wide the confidence interval on the overall mean actually is. Ignoring the grouping does not produce a slightly wrong answer — it produces one that is confidently too narrow.

At a glance

Formula shown
From a one-way layout: MSB = SSB/(k − 1) and MSW = SSW/(n − k). The within-group variance is MSW and the between-group variance is (MSB − MSW)/n₀, where n₀ adjusts for unequal group sizes. The intraclass correlation is between over total. The design effect at average group size m is 1 + (m − 1)ρ, and the standard error of the overall mean is inflated by exactly its square root.
Scenario support
Estimating an intraclass correlation for a future cluster trial, checking whether repeated measures or multi-site data need a clustered analysis, producing group estimates that are not distorted by small groups, and judging how much of a dataset’s size is genuine information.
Educational estimate
Planning support from the values you enter — not professional advice.

The interval that is half the width it should be

The two standard errors on this page are the practical consequence of everything else, and the gap between them is larger than people expect.

Ignoring the grouping: 0.54100. The number an ordinary analysis of 360 rows would report.

Respecting it: 1.13189. 2.0922 times larger, and exactly the square root of the design effect of 4.3774.

So the honest interval is more than twice as wide. A result significant at p = 0.02 on the naive analysis is not significant at all once the clustering is accounted for.

And the naive analysis gives no warning. It reports a tidy interval from 360 observations, and the only way to know is to have looked at the grouping.

How much of a sample is real

The design effect converts a sample size into the information it actually carries, and the conversion can be brutal.

360 observations in 24 groups of 15, at a correlation of 0.2412. The design effect is 4.3774.

Effective sample size: 82.24. Less than a quarter of what was collected.

The groups are doing the work, not the observations within them. Twenty-four groups is closer to the truth about this study’s size than 360 rows is.

Which is the number to carry into any planning, and the reason the design effect page exists as a separate step: the correlation estimated here is exactly what a future trial has to plan around.

Group means pulled towards the centre

The shrunk estimates are the part of a mixed model that looks like cheating and is not.

Each group mean is pulled towards the grand mean, by a factor that depends on how much information that group carries.

Small groups are pulled hardest. Their means are the least reliable, so more of the estimate comes from the population.

The shrinkage factor on the shipped preset is 0.8267, so each group keeps most of its own signal — a consequence of the correlation being high and the groups being reasonably sized.

This is why league tables are misleading. The top of an unshrunk ranking is dominated by small units with lucky results, and shrinking is what stops a hospital with eleven patients topping a mortality table.

A variance estimate that comes out negative

The second preset produces something the method can produce and the parameter cannot be, and the page says so rather than hiding it.

F is 0.708 — below 1. The between-group mean square is smaller than the within-group one.

So the between-group variance estimate is negative. It is a difference of mean squares, and nothing forces that difference to be positive.

It is truncated to exactly zero, because a variance cannot be negative, and the correlation and design effect follow at 0 and 1.

The truncation has a cost worth knowing. Estimates pile up at zero whenever the true correlation is small, so a reported ICC of 0 means “small, possibly zero” rather than “none” — and averaging several such estimates biases upward.

Method of moments, not likelihood

This page states its estimator because the answer differs from what likelihood-based software returns, and the difference is systematic rather than random.

The components come from the one-way mean squares. Exact arithmetic, no iteration, and reproducible to the last digit.

It is unbiased, which the verification suite checks by averaging 120 replications at a known true correlation of 0.2 and recovering it to within 0.02.

It is noisy at few groups, and it can go negative. Restricted maximum likelihood constrains the estimate to be non-negative and is more efficient with unbalanced groups.

For an ICC to plan a trial around, the difference rarely matters. For a fitted model with covariates and several random effects it does, and that is a job for dedicated software rather than a page like this one.

A single ICC estimate is not precise

The estimator being unbiased says nothing about how close any single estimate is, and the gap between those two facts catches people out.

Averaged over 120 replications at a true 0.2, the estimate recovers it. That is what unbiased means.

Any single study of thirty groups can land well away from it. The between-group variance is estimated from the number of groups, not the number of observations.

So the number of groups is what drives the precision, and adding more people to existing groups barely improves it.

Which is why an ICC from a pilot should be treated as a range. Planning a cluster trial at the point estimate from twenty groups is planning at the middle of a wide distribution.

Reporting a variance decomposition

Four items, and the second is what lets a reader judge how much to trust the first.

Give both variance components, not just the correlation. The ratio hides whether the total variance is large or small.

Give the number of groups. It determines the precision of the correlation, and the observation count does not.

Give the effective sample size. It is the honest description of how much information the study carries.

And say which estimator you used. Method of moments and restricted maximum likelihood differ, and only one of them can return a negative estimate to truncate.

Sources and methodology

References for variance components and shrinkage.

Method. The variance components come from the one-way mean squares with the n₀ adjustment that makes the estimator unbiased under unequal group sizes, which means the whole calculation is exact arithmetic rather than an iterative fit — reproducible to the last digit and capable of returning a negative between-group variance, which is truncated to zero and reported as such. The verification suite checks the estimator for bias directly, averaging 120 replications at a known true correlation of 0.2 and requiring recovery to within 0.02. It separately asserts the identities the page prints: the design effect matches its closed form at the average group size, the standard-error ratio is exactly the square root of that design effect, and every shrunk mean lies between its group mean and the grand mean — each on eighty generated designs. That engine is verified on every change against 128 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Design EffectThe design effect 1 + (m − 1)ρ with the effective sample size it implies, the ceiling of 1/ρ effective observations per cluster, and the marginal gain from each extra person.
Cluster Sample SizeClusters needed for a target power, with the individual-randomisation comparison and the whole trade-off between more clusters and bigger ones.
Intraclass CorrelationAll six ICC forms from one subject-by-rater matrix, with the rater means that drive them apart: one 8x3 matrix gives ICC(1,1) = 0.1277 and ICC(3,1) = 0.9852.
One-Way ANOVAThe full F table with eta and omega squared, plus every pairwise gap — because a significant F says something differs and never says which, and ten groups tested pairwise carry a 90% false-positive rate.
VarianceSample and population variance from your data, with a live simulation that shows exactly how much the wrong divisor costs — 20% low at n = 5, closing as the sample grows.
Repeated Measures ANOVAGreenhouse-Geisser, Huynh-Feldt and Mauchly computed together, with the p-value under all four sphericity assumptions: the shipped example goes from 0.031895 to 0.085420.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. This is the classical method-of-moments estimator rather than restricted maximum likelihood: it is exact arithmetic on the mean squares, and it can produce a negative between-group variance, which is truncated to zero. Estimates therefore pile up at zero when the true correlation is small, and the precision of any single estimate is governed by the number of groups rather than the number of observations.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Published a random-intercept fit from the one-way variance components.
  2. Printed both standard errors for the overall mean, ignoring and respecting the grouping.
  3. Added shrunk group means with the factor that pulls each towards the centre.
  4. Shipped a preset where the between-group variance estimate is negative and truncated to zero.
  5. Stated that this is method of moments rather than restricted maximum likelihood.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.