Datasets
box
Full name: Box (1950) Rat Growth Under Thyroid Treatment
Description: Body weight (g) of 27 rats measured at five time points (0–4 weeks) under one of three treatments: Control, Thioracil, or Thyroxin. Each rat belongs to exactly one treatment group, with unequal group sizes (10 Control, 10 Thioracil, 7 Thyroxin) but a balanced set of measurement times, yielding 135 observations. A classic worked example for growth-curve models with a treatment-by-time interaction and a per-subject random slope in time.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Subj | String | Rat identity | 27 levels |
Group | String | Treatment | Control, Thioracil, Thyroxin |
time | Int8 | Time in trial (weeks) | min 0, mean 2.0, max 4 |
resp | Int16 | Body weight (g) | min 46, mean 100.81, max 189 |
Example models:
# treatment-by-time interaction with a per-subject random slope in time
fit(MixedModel, @formula(resp ~ 1 + time * Group + (1 + time | Subj)), dataset(:box))
# quadratic growth, with treatment acting on the curvature
fit(MixedModel, @formula(resp ~ 1 + time + abs2(time) & Group + (1 + time | Subj)), dataset(:box))APA citation:
Box, G. E. P. (1950). Problems in the analysis of growth and wear curves. Biometrics, 6(4), 362–389. https://doi.org/10.2307/3001781
cbpp
Full name: Contagious Bovine Pleuropneumonia
Package origin: lme4
Description: Serological incidence of contagious bovine pleuropneumonia (CBPP) in zebu cattle from a longitudinal follow-up survey of 15 commercial herds in the Boji district of Ethiopia. Blood samples were collected quarterly to determine CBPP status. The dataset contains 56 observations with variables for herd identity, incidence count, period, and herd size. It is a canonical example for fitting binomial GLMMs with a grouped random effect.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
herd | String | Herd identity | 15 levels (H01–H15) |
period | String | Sampling period (quarterly) | 4 levels (1–4) |
incid | Int8 | Number of new CBPP cases | min 0, mean 1.77, max 12 |
hsz | Int8 | Herd size at start of period | min 2, mean 15.04, max 34 |
Example model:
# binomial GLMM: proportion seropositive, weighted by herd size
cbpp = dataset(:cbpp)
fit(MixedModel, @formula((incid / hsz) ~ 1 + period + (1 | herd)),
cbpp, Binomial(); wts=float(cbpp.hsz))APA citation:
Lesnoff, M., Laval, G., Bonnet, P., Abdicho, S., Workalemahu, A., Kifle, D., Peyraud, A., Lancelot, R., & Thiaucourt, F. (2004). Within-herd spread of contagious bovine pleuropneumonia in Ethiopian highlands. Preventive Veterinary Medicine, 64(1–2), 27–40. https://doi.org/10.1016/j.prevetmed.2004.04.002
contra
Full name: Contraceptive Use in Bangladesh
Package origin: MixedModels.jl (via mlmRev / MLwiN example datasets)
Description: Data on use of artificial contraception by 1,934 currently married women in Bangladesh from the 1988 Bangladesh Fertility Survey. Variables include district of residence (60 districts), whether the woman lives in an urban or rural area, her age (centred), number of living children, and a binary contraception use indicator. A standard example for binomial GLMMs with a random intercept for district.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
dist | String | District of residence | 60 levels |
urban | String | Urban or rural area | N, Y |
livch | String | Number of living children | 0, 1, 2, 3+ |
age | Float64 | Age (centred) | min −13.56, mean 0.00, max 19.44 |
use | String | Contraception use | N, Y |
Example models:
# Bernoulli GLMM with a random intercept for district
fit(MixedModel, @formula(use ~ 1 + age + abs2(age) + urban + livch + (1 | dist)),
dataset(:contra), Bernoulli())
# random intercept nested in urban-by-district, Helmert-coded urban
fit(MixedModel, @formula(use ~ 1 + age + abs2(age) + urban + livch + (1 | urban & dist)),
dataset(:contra), Bernoulli(); contrasts=Dict(:urban => HelmertCoding()))APA citation:
Steele, F., Diamond, I., & Amin, S. (1996). Immunization uptake in rural Bangladesh: A multilevel analysis. Journal of the Royal Statistical Society: Series A (Statistics in Society), 159(2), 289–299. https://doi.org/10.2307/2983285
The dataset itself originates from the 1988 Bangladesh Fertility Survey and is distributed as a worked example in the MLwiN multilevel modelling software package (Rasbash et al., 2009). The Steele et al. citation is the standard reference given with the dataset in mlmRev / MLwiN documentation.
d3
Full name: Three-factor Crossed Benchmark Dataset
Package origin: MixedModels.jl (benchmark dataset)
Description: A large synthetic dataset with three fully crossed grouping factors (g, h, i) and a single integer-valued covariate (u, taking values 0–29), used primarily to benchmark the fitting of linear mixed models with three-way crossed vector random effects of the form y ~ 1 + u + (1 + u | g) + (1 + u | h) + (1 + u | i). The generic variable names indicate it was generated for computational rather than substantive purposes.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
g | String | Grouping factor g | 4726 levels |
h | String | Grouping factor h | 172 levels |
i | String | Grouping factor i | 34 levels |
u | Int8 | Integer covariate | min 0, mean 13.66, max 29 |
y | Int8 | Response | min −50, mean 4.94, max 50 |
Example model:
# three-way crossed vector random effects (the benchmark model)
fit(MixedModel, @formula(y ~ 1 + u + (1 + u | g) + (1 + u | h) + (1 + u | i)), dataset(:d3))APA citation:
No published citation.
dyestuff
Full name: Yield of Dyestuff by Batch
Description: Yield (in grams of standard color) of Naphthalene Black 12B dyestuff from five preparations made from each of six batches of the intermediate product H-acid. This classic one-way balanced random-effects dataset (30 observations) was the primary motivating example in the lme4 and MixedModels.jl documentation for simple scalar random effects.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
batch | String | Batch identity | A, B, C, D, E, F |
yield | Int16 | Yield (grams of standard color) | min 1440, mean 1527.5, max 1635 |
Example model:
# one-way random effects: the classic scalar random-intercept model
fit(MixedModel, @formula(yield ~ 1 + (1 | batch)), dataset(:dyestuff))APA citation:
Davies, O. L., & Goldsmith, P. L. (Eds.). (1972). Statistical methods in research and production (4th ed., Section 6.4). Oliver and Boyd.
dyestuff2
Full name: Yield of Dyestuff by Batch (Constructed)
Description: A constructed dataset of the same structure as dyestuff (six batches, five preparations, 30 observations total) but with a large residual variance relative to the batch variance — a scenario in which the between-batch mean square is less than the within-batch mean square, illustrating a boundary case for variance component estimation. The data were constructed because such cases, while occurring in practice, were rarely published at the time.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
batch | String | Batch identity | A, B, C, D, E, F |
yield | Float64 | Yield (constructed) | min −0.89, mean 5.67, max 13.43 |
Example model:
# same model as dyestuff; here the batch variance is estimated at zero (singular fit)
fit(MixedModel, @formula(yield ~ 1 + (1 | batch)), dataset(:dyestuff2))APA citation:
Box, G. E. P., & Tiao, G. C. (1973). Bayesian inference in statistical analysis (Section 5.1.2). Addison-Wesley.
elp_ldt_item
Full name: English Lexicon Project — Lexical Decision Item Covariates
Description: Item-level covariates for the 80,962 letter strings (half words, half matched nonwords) used in the English Lexicon Project's lexical decision task, joined to trial-level data (ELP_ldt_trial) on item. Words and nonwords are organized in matched pairs (pairno), sorted alphabetically within pair by the word member. Covariates include word length and measures of orthographic neighborhood/bigram frequency used to model lexical decision performance.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
item | String | Letter string (word or nonword) | 80962 levels |
itemno | Int32 | Item index | min 1, mean 40481.5, max 80962 |
pairno | Int32 | Word/nonword pair index | min 1, mean 20241.0, max 40481 |
isword | Bool | Whether the item is a real word | false, true |
wrdlen | Int8 | Word length (characters) | min 1, mean 8.0, max 21 |
Ortho_N | Int8 | Orthographic neighborhood size (Coltheart's N) | min 0, mean 1.53, max 25 |
BG_Sum | Union{Missing, Int32} | Summed bigram frequency (177 missing) | min 11, mean 13938.41, max 59803 |
BG_Mean | Union{Missing, Float32} | Mean bigram frequency (177 missing) | min 5.5, mean 1921.26, max 6910.0 |
BG_Freq_By_Pos | Union{Missing, Int16} | Positional bigram frequency (4 missing) | min 0, mean 2043.08, max 6985 |
Example model:
This is a covariate table rather than a modelling table: join it to the trial-level responses on item and fit the model there — see the elp_ldt_trial example below.
APA citation:
Balota, D. A., Yap, M. J., Hutchison, K. A., Cortese, M. J., Kessler, B., Loftis, B., Neely, J. H., Nelson, D. L., Simpson, G. B., & Treiman, R. (2007). The English Lexicon Project. Behavior Research Methods, 39(3), 445–459. https://doi.org/10.3758/bf03193014
Joins to trial-level responses in ELP_ldt_trial (on item) and subject-level covariates in elp_ldt_subj (on subj).
elp_ldt_subj
Full name: English Lexicon Project — Lexical Decision Subject Covariates
Description: Subject-level covariates for the 814 participants who completed the lexical decision task in the English Lexicon Project, joined to trial-level data (elp_ldt_trial) on subj. Includes demographic and testing-session information (university site, sex, date of birth, session start times), a chronotype measure (Morningness–Eveningness Questionnaire, MEQ), vision/hearing self-ratings, and vocabulary/reading measures collected as part of the larger battery.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
subj | String | Subject identity | 814 levels |
univ | String | Testing site (university) | 6 levels |
sex | Union{Missing, String} | Sex (8 missing) | f, m |
frstLang | Union{Missing, String} | First language (8 missing) | English, other |
DOB | Date | Date of birth | 1938-06-07 to 1984-11-14 |
educatn | Int8 | Years of education | min 1, mean 8.9, max 28 |
MEQ | Union{Missing, Float32} | Morningness–Eveningness score (8 missing) | min 19.0, mean 44.49, max 75.0 |
vision | Union{Missing, Int8} | Self-rated vision, 0–7 scale (1 missing) | min 0, mean 5.51, max 7 |
hearing | Union{Missing, Int8} | Self-rated hearing, 0–7 scale (1 missing) | min 0, mean 5.86, max 7 |
preshlth | Union{Missing, Int8} | Self-rated present health (1 missing) | min 0, mean 5.49, max 7 |
pasthlth | Union{Missing, Int8} | Self-rated past health (1 missing) | min 0, mean 4.93, max 7 |
ncorrct | Union{Missing, Int8} | Vocabulary test items correct (18 missing) | min 5, mean 29.85, max 40 |
rawscor | Union{Missing, Int8} | Vocabulary test raw score (18 missing) | min 13, mean 31.99, max 40 |
vocabAge | Union{Missing, Float32} | Vocabulary age-equivalent score (19 missing) | min 10.3, mean 17.81, max 21.0 |
shipTime | Union{Missing, Int8} | Shipley vocabulary test time, minutes (1 missing) | min 0, mean 3.09, max 9 |
readTime | Union{Missing, Float32} | Reading time measure, minutes (1 missing) | min 0.0, mean 2.5, max 15.0 |
S1start | DateTime | Session 1 start time | 2001-03-16 to 2003-07-29 |
S2start | DateTime | Session 2 start time | 2001-03-19 to 2003-07-30 |
MEQstrt | Union{Missing, DateTime} | MEQ administration start time (7 missing) | 2001-03-22 to 2003-07-30 |
filename | String | Source raw-data filename | 814 levels |
Example model:
This is a covariate table rather than a modelling table: join it to the trial-level responses on subj for subject-level predictors — see the elp_ldt_trial example below.
APA citation:
Balota, D. A., Yap, M. J., Hutchison, K. A., Cortese, M. J., Kessler, B., Loftis, B., Neely, J. H., Nelson, D. L., Simpson, G. B., & Treiman, R. (2007). The English Lexicon Project. Behavior Research Methods, 39(3), 445–459. https://doi.org/10.3758/bf03193014
Joins to trial-level responses in elp_ldt_trial (on subj) and item-level covariates in elp_ldt_item (on item).
elp_ldt_trial
Full name: English Lexicon Project — Lexical Decision Trial Data
Description: Trial-level data from the lexical decision task (LDT) of the English Lexicon Project, in which 814 subjects each judged whether a displayed letter string was a word or a nonword across two testing sessions (2,000 trials per subject on day one). Contains 2,745,952 trials with accuracy and raw response time; response times include some implausible values (negative and multi-second latencies), so analyses typically restrict to a plausible range (e.g. 200–3,000 ms) before further modelling.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
subj | String | Subject identity | 814 levels |
item | String | Letter string presented | 80962 levels |
seq | Int16 | Trial sequence number within subject | min 1, mean 1687.21, max 3374 |
acc | Union{Missing, Bool} | Response accuracy (1370 missing) | false, true |
rt | Int16 | Response time (ms) | min −16160, mean 846.32, max 32061 |
Example models:
# join trial responses to the item-level covariates
trials = leftjoin(DataFrame(dataset(:elp_ldt_trial)), DataFrame(dataset(:elp_ldt_item)); on=:item)
# lexical-decision accuracy: Bernoulli GLMM
fit(MixedModel, @formula(acc ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)),
trials, Bernoulli(); contrasts=Dict(:isword => EffectsCoding()))
# response speed (1000/rt) as a linear mixed model
# (restrict rt to a plausible range, e.g. 200–3000 ms, before fitting)
fit(MixedModel, @formula(1000 / rt ~ 1 + isword * wrdlen + (1 | item) + (1 | subj)),
filter(:rt => r -> 200 <= r <= 3000, trials);
contrasts=Dict(:isword => EffectsCoding()))APA citation:
Balota, D. A., Yap, M. J., Hutchison, K. A., Cortese, M. J., Kessler, B., Loftis, B., Neely, J. H., Nelson, D. L., Simpson, G. B., & Treiman, R. (2007). The English Lexicon Project. Behavior Research Methods, 39(3), 445–459. https://doi.org/10.3758/bf03193014
Joins to item-level covariates in ELP_ldt_item (on item) and subject-level covariates in ELP_ldt_subj (on subj).
elstongrizzle
Full name: Elston & Grizzle (1962) Ramus Bone Growth
Description: Length (mm) of the ramus of the mandible ("ramus bone") in 20 boys, measured at four ages: 8, 8.5, 9, and 9.5 years, for 80 observations in a fully balanced longitudinal design. An introductory example for random-intercept-and-slope models of individual growth trajectories, with substantial variation in curve shape across subjects (some roughly linear, some concave up, some concave down).
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Subj | String | Boy identity | 20 levels |
time | Float64 | Age (years) | min 8.0, mean 8.75, max 9.5 |
resp | Float64 | Ramus bone length (mm) | min 45.0, mean 50.09, max 55.5 |
Example models:
# random intercept and slope in time
fit(MixedModel, @formula(resp ~ 1 + time + (1 + time | Subj)), dataset(:elstongrizzle))
# quadratic individual growth curves
fit(MixedModel, @formula(resp ~ 1 + time + abs2(time) + (1 + time + abs2(time) | Subj)),
dataset(:elstongrizzle))APA citation:
Elston, R. C., & Grizzle, J. E. (1962). Estimation of time-response curves and their confidence bands. Biometrics, 18(2), 148–159. https://doi.org/10.2307/2527453
fggk21
Full name: Fühner et al. (2021) Physical Fitness of Third-Graders (Emotikon Study)
Description: Physical-fitness component scores for 108,295 third-graders (all aged 8.0–9.0 years) from 515 primary schools across 9 yearly cohorts (2011–2019), yielding 525,126 scores. Each child was scored on up to five fitness components (Test): a 6-minute endurance run (Run, meters), a star-shaped coordination run (Star_r, m/s), a 20-meter sprint (S20_r, m/s), a standing long jump (SLJ, cm), and a 1-kg medicine ball push (BPT, meters). The size and nested structure (children within schools within cohorts) make it a realistic large-scale example for contrast coding of a multi-level factor and for principled model complexification.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Child | String | Child identity | 108295 levels |
School | String | School identity | 515 levels |
Cohort | String | Testing cohort (year) | 2011–2019 |
Sex | String | Sex | female, male |
age | Float64 | Age at testing (years) | min 7.99, mean 8.56, max 9.11 |
Test | String | Fitness component | BPT, Run, S20r, SLJ, Starr |
score | Float64 | Test score (units vary by Test) | min 1.14, mean 226.14, max 1530.0 |
Example models:
Because score units differ across the five components, the analyses in Fühner et al. and in the SMLP course materials model the score z-standardized within Test, against a centered age:
using StatsBase: zscore
df = transform(groupby(DataFrame(dataset(:fggk21)), :Test), :score => zscore => :zScore)
df.a1 = df.age .- 8.5 # age centered near the sampled range
# fitness component (Test) by age and sex, with by-child and by-school random effects
fit(MixedModel, @formula(zScore ~ 1 + Test * Sex * a1 + (1 + Test | Child) + (1 + Test | School)),
df; contrasts=Dict(:Test => SeqDiffCoding(), :Sex => EffectsCoding()))
# a common reduction drops the correlation parameters:
# ... + zerocorr(1 + Test | Child) + zerocorr(1 + Test + a1 | School)APA citation:
Fühner, T., Granacher, U., Golle, K., & Kliegl, R. (2021). Age and sex effects in physical fitness components of 108,295 third graders including 515 primary schools and 9 cohorts. Scientific Reports, 11, Article 17566. https://doi.org/10.1038/s41598-021-97000-4
grouseticks
Full name: Red Grouse Tick Infestation
Description: Counts of sheep ticks (Ixodes ricinus) on the heads of red grouse chicks (Lagopus lagopus scoticus) sampled in the field in Scotland during 1995–1997. The dataset contains 403 observations (individual chick-level) nested within 118 broods within 63 geographic locations, with altitude (height above sea level) and year as covariates. A worked example for overdispersed count (Poisson GLMM) analysis with nested grouping.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
index | String | Chick identity | 403 levels |
brood | String | Brood identity | 118 levels |
location | String | Geographic location | 63 levels |
height | Int16 | Altitude (m above sea level) | min 403, mean 462, max 533 |
year | String | Survey year | 1995, 1996, 1997 |
ticks | Int8 | Tick count on chick | min 0, mean 6.37, max 85 |
Example model:
# Poisson GLMM with nested (chick within brood within location) random intercepts
grouseticks = DataFrame(dataset(:grouseticks))
grouseticks.ch = grouseticks.height .- mean(grouseticks.height) # centered altitude
fit(MixedModel, @formula(ticks ~ 1 + year + ch + (1 | index) + (1 | brood) + (1 | location)),
grouseticks, Poisson())APA citation:
Elston, D. A., Moss, R., Boulinier, T., Arrowsmith, C., & Lambin, X. (2001). Analysis of aggregation, a worked example: Numbers of ticks on red grouse chicks. Parasitology, 122(5), 563–569. https://doi.org/10.1017/S0031182001007740
insteval
Full name: University Lecture/Instructor Evaluations at ETH
Description: Anonymized ratings of lectures and instructors by students at ETH Zürich. The dataset contains 73,421 observations from 2,972 students evaluating 1,128 instructors across up to 6 semesters back. Variables include student identifier (s), instructor identifier (d), student seniority (studage), lecture recency (lectage), whether the lecture was a service course for another department (service), department (dept), and numerical rating (y, scale 1–5). The stated goal of the underlying survey was to identify the "best liked professor." A medium-large example of a partially nested (students partially crossed with instructors) mixed-effects model.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
s | String | Student identity | 2972 levels |
d | String | Instructor identity | 1128 levels |
dept | String | Department | 14 levels |
studage | String | Student seniority (semesters) | 2, 4, 6, 8 |
lectage | String | Lecture recency (semesters ago) | 1, 2, 3, 4, 5, 6 |
service | String | Service course for another dept | N, Y |
y | Int8 | Rating | min 1, mean 3.21, max 5 |
Example models:
# students (s) partially crossed with instructors (d), plus a department effect
fit(MixedModel, @formula(y ~ 1 + (1 | s) + (1 | d) + (1 | dept)), dataset(:insteval))
# add the service-course fixed effect
fit(MixedModel, @formula(y ~ 1 + service + (1 | s) + (1 | d) + (1 | dept)), dataset(:insteval))APA citation:
No published citation. The dataset was collected at ETH Zürich, anonymised, and simplified for inclusion in lme4 by the package authors. It is described in:
Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1), 1–48. https://doi.org/10.18637/jss.v067.i01
kb07
Full name: Kronmüller & Barr (2007) Visual World Experiment
Description: Response time data from a visual world eye-tracking experiment in which 56 subjects selected objects on a monitor using a cursor. The 2×2×2 factorial design manipulated (1) whether auditory instructions maintained or broke a previously established reference precedent (prec: maintain vs. break), (2) whether instructions were given by the original speaker or a new speaker (spkr: old vs. new), and (3) whether the task was performed with or without a concurrent cognitive load of six random digits (load: yes vs. no). The dataset contains 1,789 observations of truncated reaction times (rttrunc) and raw reaction times (rtraw), and is a canonical example for maximal and parsimonious mixed-effects modelling in psycholinguistics.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
subj | String | Subject identity | 56 levels |
item | String | Item identity | 32 levels |
spkr | String | Speaker | new, old |
prec | String | Precedent condition | break, maintain |
load | String | Cognitive load | no, yes |
rt_trunc | Int16 | Truncated reaction time (ms) | min 579, mean 2182, max 5171 |
rt_raw | Int16 | Raw reaction time (ms) | min 579, mean 2226, max 15923 |
Example models:
contrasts = Dict(:spkr => HelmertCoding(), :prec => HelmertCoding(), :load => HelmertCoding())
# crossed random intercepts, additive fixed effects
fit(MixedModel, @formula(rt_trunc ~ 1 + spkr + prec + load + (1 | subj) + (1 | item)),
dataset(:kb07); contrasts)
# main-effects random slopes (a common parsimonious reduction)
fit(MixedModel, @formula(rt_trunc ~ 1 + spkr * prec * load +
(1 + spkr + prec + load | subj) + (1 + spkr + prec + load | item)),
dataset(:kb07); contrasts)
# maximal: full interaction in both fixed and random effects
fit(MixedModel, @formula(rt_trunc ~ 1 + spkr * prec * load +
(1 + spkr * prec * load | subj) + (1 + spkr * prec * load | item)),
dataset(:kb07); contrasts)APA citation:
Kronmüller, E., & Barr, D. J. (2007). Perspective-free pragmatics: Broken precedents and the recovery-from-preemption hypothesis. Journal of Memory and Language, 56(3), 436–455. https://doi.org/10.1016/j.jml.2006.05.002
Barr, D. J., Levy, R., Scheepers, C., & Tily, H. J. (2013). Random effects structure for confirmatory hypothesis testing: Keep it maximal. Journal of Memory and Language, 68(3), 255–278. https://doi.org/10.1016/j.jml.2012.11.001
kkl15
Full name: Kliegl, Kushela & Laubrock (2015) Visual-Attention Replication
Description: Reaction times from a larger conceptual replication and extension of kwdyz11, run at the University of Potsdam, examining effects of visual cueing under four cue-target relations (CTR). Two rectangles were displayed in cardinal (horizontal/vertical) or diagonal orientation relative to a central fixation point, with a small or large visual target appearing at one of the four rectangle ends; the target was cued validly on 70% of trials and invalidly (at each of the three other locations) on 10% of trials each. Adding diagonal orientations and a target-size manipulation to the original design, the study estimates the spatial–attraction correlation whose absence produced a singular fit in kwdyz11; it is analyzed on the raw response-time scale to preserve compatibility with that earlier study. 86 subjects contributed 53,765 trials.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Subj | String | Subject identity | 86 levels |
CTR | String | Cue-target relation | dod, dos, sod, val |
cardinal | String | Rectangle orientation | cardinal, diagonal |
size | String | Target size | big, small |
rt | Float32 | Reaction time (ms) | min 150.22, mean 293.15, max 749.48 |
Example models:
contrasts = Dict(:CTR => SeqDiffCoding(), :cardinal => EffectsCoding(), :size => EffectsCoding())
# full factorial fixed effects with correlated random slopes
fit(MixedModel, @formula(rt ~ 1 + CTR * cardinal * size + (1 + CTR * cardinal | Subj)),
dataset(:kkl15); contrasts)
# parsimonious reduction with uncorrelated random effects
fit(MixedModel, @formula(rt ~ 1 + CTR * cardinal * size + zerocorr(1 + CTR + cardinal | Subj)),
dataset(:kkl15); contrasts)APA citation:
Kliegl, R., Kushela, J., & Laubrock, J. (2015). Object orientation and target size modulate the speed of visual attention [Technical report]. Department of Psychology, University of Potsdam.
A conceptual replication and extension of kwdyz11 (Kliegl, Wei, Dambacher, Yan, & Zhou, 2011), designed to estimate the spatial–attraction correlation that produced a singular fit in the original study.
kwdyz11
Full name: Kliegl, Wei, Dambacher, Yan & Zhou (2011) Visual-Attention Experiment
Description: Reaction times from a cueing experiment examining spatial, object-based, and attractor-like effects of visual attention under four cue-target relations (CTR). Two rectangles were displayed above and below (or, in a second orientation, to the left and right of) a central fixation point; subjects reacted to a small visual target appearing at one of the four rectangle ends, cued validly on 70% of trials and invalidly (at each of the three other locations) on 10% of trials each. 61 subjects contributed 28,710 trials. The attraction effect proved close to zero as a fixed effect but showed a reliable variance component, and the originally reported model was singular — motivating the replication and extension in kkl15.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Subj | String | Subject identity | 61 levels |
Item | String | Item identity | 480 levels |
CTR | String | Cue-target relation | dod, dos, sod, val |
dir | String | Rectangle orientation | hor, ver |
rt | Float32 | Reaction time (ms) | min 150.1, mean 370.43, max 705.7 |
Example models:
This dataset is the standard contrast-coding showcase: the same model is refit under different codings of the four-level factor CTR.
# Helmert-coded cue-target relation, correlated random slopes for CTR
fit(MixedModel, @formula(rt ~ 1 + CTR + (1 + CTR | Subj)),
dataset(:kwdyz11); contrasts=Dict(:CTR => HelmertCoding()))
# the same model on the log scale
fit(MixedModel, @formula(log(rt) ~ 1 + CTR + (1 + CTR | Subj)),
dataset(:kwdyz11); contrasts=Dict(:CTR => HelmertCoding()))APA citation:
Kliegl, R., Wei, P., Dambacher, M., Yan, M., & Zhou, X. (2011). Experimental effects and individual differences in linear mixed models: Estimating the relationship between spatial, object, and attraction effects of visual attention. Frontiers in Psychology, 1, Article 238. https://doi.org/10.3389/fpsyg.2010.00238
Replicated and extended, with additional target-size and rectangle-orientation manipulations, in kkl15 (Kliegl, Kushela, & Laubrock, 2015).
machines
Full name: Machine Productivity Scores
Description: Scores from a designed experiment comparing three brands of industrial machines. Six workers were chosen randomly from a factory and each worker operated each machine three times, yielding 54 observations in a balanced crossed design. A classic example from the split-plot/repeated-measures literature, analyzed with a random intercept for worker and a random worker-by-machine interaction.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Worker | String | Worker identity | 1, 2, 3, 4, 5, 6 |
Machine | String | Machine brand | A, B, C |
score | Float32 | Productivity score | min 43.0, mean 59.65, max 72.1 |
Example model:
# machine fixed effect with a random worker intercept and worker-by-machine interaction
fit(MixedModel, @formula(score ~ 1 + Machine + (1 | Worker) + (1 | Worker & Machine)),
dataset(:machines))APA citation:
Milliken, G. A., & Johnson, D. E. (1992). Analysis of messy data: Vol. I. Designed experiments (p. 285). Chapman and Hall.
Pinheiro, J. C., & Bates, D. M. (2000). Mixed-effects models in S and S-PLUS (pp. 233–234). Springer. https://doi.org/10.1007/b98882
ml1m
Full name: MovieLens 1M Ratings
Description: Approximately one million anonymous movie ratings (1–5 stars) from the MovieLens collaborative filtering system, contributed by 6,040 users who each rated at least 20 of approximately 3,700 movies. Collected by the GroupLens Research Group at the University of Minnesota. Included in MixedModels.jl as a large-scale benchmark for two-way crossed random effects models (users crossed with movies), illustrating the computational advantages of the blocked Cholesky approach.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
G | String | User identity | 6040 levels |
H | String | Movie identity | 3706 levels |
Y | Int8 | Rating (1–5 stars) | min 1, mean 3.58, max 5 |
Example model:
# two-way crossed random effects: users (G) crossed with movies (H)
fit(MixedModel, @formula(Y ~ 1 + (1 | G) + (1 | H)), dataset(:ml1m))APA citation:
Harper, F. M., & Konstan, J. A. (2016). The MovieLens datasets: History and context. ACM Transactions on Interactive Intelligent Systems, 5(4), Article 19. https://doi.org/10.1145/2827872
ml32_movies
Full name: MovieLens 32M Movie Metadata
Description: Titles and genre tags for the 87,585 movies included in the MovieLens 32M dataset, joined to ml32_ratings on movieId. Each movie's title includes its release year, and genres is a pipe-separated list drawn from 20 possible genre tags (including "(no genres listed)"). Collected and distributed by the GroupLens Research Group at the University of Minnesota.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
movieId | Int64 | Movie identity | min 1, mean 157651.37, max 292757 |
title | String | Movie title (with release year) | 87382 levels |
genres | String | Pipe-separated genre tags | 20 distinct tags |
Example model:
This is a metadata table: join it to ml32_ratings on movieId to add title/genre predictors — see the ml32_ratings example below.
APA citation:
Harper, F. M., & Konstan, J. A. (2016). The MovieLens datasets: History and context. ACM Transactions on Interactive Intelligent Systems, 5(4), Article 19. https://doi.org/10.1145/2827872
Joins to per-rating data in ml32_ratings (on movieId). See also the smaller ml1m (MovieLens 1M) dataset above.
ml32_ratings
Full name: MovieLens 32M Ratings
Description: 32,000,204 ratings (0.5–5.0 stars, half-star increments) from 200,948 users across 84,432 movies in the MovieLens 32M dataset, collected between January 1995 and October 2023. Joins to ml32_movies on movieId for title and genre metadata. A much larger successor to ml1m, useful as a benchmark for two-way crossed random-effects models (users crossed with movies) at substantially greater scale.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
userId | Int64 | User identity | 200948 levels |
movieId | Int64 | Movie identity | 84432 levels |
rating | Float64 | Rating (0.5–5.0 stars, half-star increments) | min 0.5, mean 3.54, max 5.0 |
timestamp | Int64 | Rating time (Unix epoch seconds) | 1995-01-09 to 2023-10-13 |
Example model:
# two-way crossed random effects at scale: users crossed with movies
fit(MixedModel, @formula(rating ~ 1 + (1 | userId) + (1 | movieId)), dataset(:ml32_ratings))APA citation:
Harper, F. M., & Konstan, J. A. (2016). The MovieLens datasets: History and context. ACM Transactions on Interactive Intelligent Systems, 5(4), Article 19. https://doi.org/10.1145/2827872
Joins to movie metadata in ml32_movies (on movieId). See also the smaller ml1m (MovieLens 1M) dataset above.
mmec
Full name: Malignant Melanoma Mortality in the European Community
Description: Counts of malignant melanoma deaths and expected deaths (based on age and sex), together with a UV radiation index, across 354 counties nested within 78 regions within 9 European nations (Belgium, West Germany, Denmark, France, Ireland, Italy, Luxembourg, Netherlands, United Kingdom). A standard example for Poisson GLMMs with region-level random intercepts and a national-level offset, first distributed with the MLwiN multilevel modelling software.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
nation | String | Nation | 9 levels |
region | String | Region (within nation) | 78 levels |
county | String | County (within region) | 354 levels |
deaths | Int16 | Observed melanoma deaths | min 0, mean 27.83, max 313 |
expected | Float64 | Expected deaths (age/sex adjusted) | min 0.69, mean 27.80, max 258.86 |
uvb | Float64 | UV radiation index (centered) | min −8.90, mean 0.00, max 13.36 |
Example model:
# Poisson GLMM with a region random intercept and a population offset
mmec = dataset(:mmec)
fit(MixedModel, @formula(deaths ~ 1 + uvb + (1 | region)),
mmec, Poisson(); offset=log.(mmec.expected))APA citation:
Langford, I. H., Bentham, G., & McDonald, A.-L. (1998). Multilevel modelling of geographically aggregated health data: A case study on malignant melanoma mortality and UV exposure in the European community. Statistics in Medicine, 17(1), 41–58. https://doi.org/10.1002/(SICI)1097-0258(19980115)17:1<41::AID-SIM721>3.0.CO;2-4
mrk17_exp1
Full name: Masson, Rabe & Kliegl (2017) Semantic Priming Experiment 1
Description: Response times from correct responses in a lexical decision task (LDT) in which 73 subjects decided whether a target string was a word or a non-word. The 2×2×2 factorial design manipulated prime-target relatedness (related vs. unrelated; P), target frequency (high vs. low; F), and target display quality (clear vs. degraded; Q). Following Masson & Kliegl (2013), the experiment also tracked lagged target type (word vs. non-word on the previous trial; lT) and lagged quality (lQ) as additional covariates. Correct responses to word targets in the 300–3,000 ms range yielded 16,409 analyzable observations. A standard RePsychLing benchmark for high-dimensional crossed random-effects models.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
subj | String | Subject identity | 73 levels |
item | String | Item identity | 240 levels |
trial | Int16 | Trial number within subject | min 2, mean 240, max 480 |
F | String | Target frequency | HF, LF |
P | String | Prime relatedness | rel, unr |
Q | String | Display quality | clr, deg |
lQ | String | Lagged display quality | clr, deg |
lT | String | Lagged target type | NW, WD |
rt | Int16 | Response time (ms) | min 301, mean 647, max 2994 |
Example models:
contrasts = Dict(:F => EffectsCoding(), :P => EffectsCoding(), :Q => EffectsCoding(),
:lQ => EffectsCoding(), :lT => EffectsCoding())
# maximal model on the speed scale (1000/rt)
fit(MixedModel, @formula(1000 / rt ~ 1 + F * P * Q * lQ * lT +
(1 + F + P + Q + lQ + lT | subj) + (1 + P + Q + lQ + lT | item)),
dataset(:mrk17_exp1); contrasts)
# zero-correlation-parameter reduction
fit(MixedModel, @formula(1000 / rt ~ 1 + F * P * Q * lQ * lT +
zerocorr(1 + F + P + Q + lQ + lT | subj) + zerocorr(1 + P + Q + lQ + lT | item)),
dataset(:mrk17_exp1); contrasts)APA citation:
Masson, M. E. J., Rabe, M. M., & Kliegl, R. (2017). Modulation of additive and interactive effects in lexical decision by trial history. Memory & Cognition, 45(3), 480–492. https://doi.org/10.3758/s13421-016-0666-z
oxboys
Full name: Heights of Boys in Oxford
Package origin: nlme
Description: Height (cm) of 26 boys from Oxford, England, measured on 9 occasions, with age standardized (via a fitted growth curve) to run from −1 to 1 across the study period. 234 observations in a fully balanced design (9 occasions per boy). A classic example, popularized by Pinheiro & Bates (2000), for fitting random-intercept-and-slope growth-curve models.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Subj | String | Boy identity | 26 levels |
occasion | Int8 | Measurement occasion | 1–9 |
age | Float64 | Standardized age | min −1.0, mean 0.02, max 1.0055 |
height | Float64 | Height (cm) | min 126.2, mean 149.52, max 174.8 |
Example model:
# random intercept and slope in (standardized) age
fit(MixedModel, @formula(height ~ 1 + age + (1 + age | Subj)), dataset(:oxboys))APA citation:
Pinheiro, J. C., & Bates, D. M. (2000). Mixed-effects models in S and S-PLUS. Springer. https://doi.org/10.1007/b98882
The growth measurements were originally collected by Tuddenham, R. D., & Snyder, M. M. (1954). Physical growth of California boys and girls from birth to eighteen years. University of California Publications in Child Development, 1, 183–364.
oxide
Full name: Oxide Layer Thickness in Semiconductor Manufacturing
Description: Thickness of the silicon dioxide (oxide) layer on silicon wafers measured at three sites on each of three wafers selected from each of eight lots obtained from two furnace sources, for a total of 72 observations. A passive data collection study from the semiconductor industry intended to estimate variance components and identify assignable causes of observed variability. A four-level nested design (sites within wafers within lots within sources).
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
Source | String | Furnace source | 1, 2 |
Lot | String | Lot identity (within source) | 8 levels |
Wafer | String | Wafer identity (within lot) | 1, 2, 3 |
Site | String | Measurement site (within wafer) | 1, 2, 3 |
Thickness | Float64 | Oxide layer thickness | min 1980, mean 2000, max 2036 |
Example models:
# variance components: wafers nested within lots
fit(MixedModel, @formula(Thickness ~ 1 + (1 | Lot / Wafer)), dataset(:oxide))
# add a source fixed effect and source-varying random effects
fit(MixedModel, @formula(Thickness ~ 1 + Source + (1 + Source | Lot) + (1 + Source | Lot & Wafer)),
dataset(:oxide))APA citation:
Littell, R. C., Milliken, G. A., Stroup, W. W., & Wolfinger, R. D. (1996). SAS system for mixed models (p. 155). SAS Institute.
Pinheiro, J. C., & Bates, D. M. (2000). Mixed-effects models in S and S-PLUS (Appendix A.20). Springer. https://doi.org/10.1007/b98882
pastes
Full name: Paste Strength by Batch and Cask
Description: Strength measurements of a chemical paste product from 60 cask samples: three casks are drawn from each of 10 batches, with two strength measurements per cask, yielding a nested random-effects structure (cask nested within batch).
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
batch | String | Batch identity | 10 levels (A–J) |
cask | String | Cask identity (within batch) | a, b, c |
strength | Float64 | Paste strength | min 54.2, mean 60.05, max 66.0 |
Example models:
# batch-only random intercept
fit(MixedModel, @formula(strength ~ 1 + (1 | batch)), dataset(:pastes))
# cask nested within batch
fit(MixedModel, @formula(strength ~ 1 + (1 | batch / cask)), dataset(:pastes))APA citation:
Davies, O. L., & Goldsmith, P. L. (Eds.). (1972). Statistical methods in research and production (4th ed., Section 6.5). Oliver and Boyd.
penicillin
Full name: Variation in Penicillin Testing
Description: Diameter (mm) of the zone of inhibition of bacterial growth for six penicillin samples tested on each of 24 agar plates using the Bacillus subtilis plate assay method, yielding 144 observations. Plates and samples are fully crossed (a two-way crossed design with no interaction term). A classic example for fitting models with crossed random effects, originating from an investigation into the variability between penicillin samples.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
plate | String | Plate identity | 24 levels |
sample | String | Penicillin sample | A, B, C, D, E, F |
diameter | Int8 | Zone of inhibition diameter (mm) | min 18, mean 22.97, max 27 |
Example model:
# fully crossed random effects for plate and sample
fit(MixedModel, @formula(diameter ~ 1 + (1 | plate) + (1 | sample)), dataset(:penicillin))APA citation:
Davies, O. L., & Goldsmith, P. L. (Eds.). (1972). Statistical methods in research and production (4th ed., Section 6.6). Oliver and Boyd.
sleepstudy
Full name: Reaction Times in a Sleep Deprivation Study
Description: Average reaction time per day (ms) on a 10-minute psychomotor vigilance test for 18 subjects in the most severe sleep restriction arm (3 hours time-in-bed per night) of a multi-condition sleep dose-response study. The dataset covers 10 days (days 0–1: adaptation/training; day 2: baseline; days 3–9: sleep restriction), giving 180 observations (18 subjects × 10 days). A ubiquitous example for fitting linear mixed models with random slopes for time.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
subj | String | Subject identity | 18 levels |
days | Int8 | Day of study | min 0, mean 4.5, max 9 |
reaction | Float64 | Average reaction time (ms) | min 194.33, mean 298.51, max 466.35 |
The lme4 help page contains a slight inaccuracy: sleep restriction began after day 2 (the baseline), not day 0 (see Belenky et al., 2003, p. 2, and lme4 GitHub issue #615).
Example models:
# random intercept only
fit(MixedModel, @formula(reaction ~ 1 + days + (1 | subj)), dataset(:sleepstudy))
# uncorrelated random intercept and slope
fit(MixedModel, @formula(reaction ~ 1 + days + zerocorr(1 + days | subj)), dataset(:sleepstudy))
# maximal: correlated random intercept and slope for days
fit(MixedModel, @formula(reaction ~ 1 + days + (1 + days | subj)), dataset(:sleepstudy))APA citation:
Belenky, G., Wesensten, N. J., Thorne, D. R., Thomas, M. L., Sing, H. C., Redmond, D. P., Russo, M. B., & Balkin, T. J. (2003). Patterns of performance degradation and restoration during sleep restriction and subsequent recovery: A sleep dose-response study. Journal of Sleep Research, 12(1), 1–12. https://doi.org/10.1046/j.1365-2869.2003.00337.x
verbagg
Full name: Verbal Aggression Item Responses
Description: Item responses to a 24-item questionnaire on verbal aggression administered to 316 participants, yielding 7,584 observations. Participants indicated whether they would want to react aggressively and whether they would actually react, across scenarios involving frustrating situations and three aggression modes (curse, scold, shout) in two situational types (self-to-blame vs. other-to-blame). Variables include trait anger (STAXI; anger), gender, behavior type (btype), situation type (situ), mode, polytomous response (resp: no/perhaps/yes), and a binary dichotomization thereof (r2: N/Y). Originally collected by Vansteelandt (2000) and used throughout De Boeck & Wilson (2004) to illustrate explanatory item response models.
Columns:
| Name | Type | Description | Summary |
|---|---|---|---|
subj | String | Subject identity | 316 levels |
item | String | Item identity | 24 levels |
anger | Int8 | Trait anger score (STAXI) | min 11, mean 20.0, max 39 |
gender | String | Gender | F, M |
btype | String | Behavior type | curse, scold, shout |
situ | String | Situation type | other, self |
mode | String | Response mode | do, want |
resp | String | Polytomous response | no, perhaps, yes |
r2 | String | Binary response | N, Y |
Example model:
# Bernoulli GLMM for the dichotomized response, crossed subject and item effects
fit(MixedModel, @formula(r2 ~ 1 + anger + gender + btype + situ + mode + (1 | subj) + (1 | item)),
dataset(:verbagg), Bernoulli())APA citation:
De Boeck, P., & Wilson, M. (Eds.). (2004). Explanatory item response models: A generalized linear and nonlinear approach. Springer. https://doi.org/10.1007/978-1-4757-3990-9
The original data collection is attributed to Vansteelandt, K. (2000). Psychometric modelling of verbal aggression [Doctoral dissertation, KU Leuven]. The dataset was formerly available from the UC Berkeley BEAR Center (no longer accessible; archived at the Internet Archive).