Mixed-Effects Models Calculator

Linear and generalized mixed-effects models for clustered and repeated data, with random intercepts and slopes, intraclass correlations, and proper degrees of freedom, in your browser.

What this calculator does

Mixed-Effects Models is Module 15 of Analysis Studio, and it sits in the subscription set. It fits:

  • Linear mixed models for continuous outcomes measured in clusters or repeated over time
  • Generalized mixed models for binary and count outcomes on the same structures
  • Random intercepts, which let each group carry its own level, and random slopes, which let an effect differ by group

The results report the variance components and the intraclass correlation beside the fixed effects, and the degrees of freedom use the Kenward-Roger or Satterthwaite corrections rather than the row count, so a study of thirty patients in six clinics is not credited with thirty independent observations of a clinic-level effect.

Promotion, stated with its date: through March 31, 2027, this module runs free on screen, like every module. Downloads and Copy Results stay with the subscription throughout. After the promotion, the module returns to the subscription set at $299 per year.

The method, in plain terms

Cases inside a group resemble each other: patients in one clinic share the clinic, students in one classroom share the teacher, repeated occasions share the person. A model that treats every row as independent pretends the study collected more evidence than it did, and its intervals come out too narrow. The mixed model splits the variation into the part between groups and the part within them. The fixed effects answer the study question; the random effects carry the group structure; and the intraclass correlation states what share of the variation sits between groups, which is the number that decides how much the clustering mattered.

Worked example

Thirty patients in six clinics, five per clinic, with recovery scores averaging 8.40, 6.30, 7.38, 5.58, 8.96, and 6.88 across the clinics and 7.25 overall. A random-intercept fit of the same scores gives:

  • Overall level (fixed intercept): 7.25
  • Between-clinic variance: 1.32
  • Within-clinic variance: 0.17
  • Intraclass correlation: 0.89

The reading is that the clinics differ far more than the patients inside a clinic do: about 89 percent of the variation sits between clinics. Any treatment comparison run on these data has to carry that structure, because the effective evidence about a clinic-level difference is six clinics, not thirty patients.

When the calculator fits, and when it does not

It fits when:

  • Cases are nested in groups: clinics, schools, sites, households, or repeated occasions within a person.
  • The groups themselves vary, and the analysis should say how much, rather than absorbing them as a set of dummy variables.
  • Occasions are missing unevenly across cases. The mixed model uses each case's available occasions under a stated missing-data assumption, where a repeated-measures table would drop the case.

It does not fit when:

  • Each case is measured once and the groups are the treatment itself, with no interest in group variation. A fixed-effects specification in the regression module is the direct answer.
  • The number of groups is very small, two or three, so the between-group variance is estimated from almost nothing. The module names that case rather than dressing it in a variance component.
  • The structure is a survey design with weights and strata. The design-based modules carry that structure; a random intercept is not a substitute for the design.

Run it

Module 15: Mixed-Effects ModelsOpen in Analysis Studio →

Load your data, pick the outcome, the fixed predictors, and the grouping variable, decide whether the design calls for random slopes, and read the variance components before the fixed-effect table.

Questions

What does the intraclass correlation tell me? The share of the total variation that sits between groups. Near zero, the grouping barely matters and simpler models lose little. High, as in the worked example at 0.89, the group is most of the story, and any analysis that ignores it will overstate its own precision badly.

Random or fixed effects for my groups? Random when the groups are a sample of a larger population of groups and the variation among them is itself a quantity of interest: clinics, schools, sites. Fixed when the groups in hand are the whole population of interest and each one needs its own stated estimate.

Why do the degrees of freedom change? Because the evidence about a group-level effect is counted in groups, not in rows. The Kenward-Roger and Satterthwaite corrections compute the degrees of freedom the design actually carries, which is why a thirty-row table from six clinics does not get twenty-some degrees of freedom for a clinic-level comparison.

Do I need random slopes as well as intercepts? When the effect of a predictor plausibly differs by group: a treatment that works better in some clinics than others, a growth rate that varies by student. The module fits the slope structure the design states and reports whether the slope variation is material.

What if my outcome is binary or a count? Use the generalized form of the same module. The random structure is stated the same way, and the link function changes to match the outcome, logistic for binary and log for counts.

More Analysis Studio Modules