Learn R Programming

datarium: Data bank for statistical analyses and visualization

Contains 23 curated data sets for teaching classical statistical inference in R. Each data set is paired with the analysis it is designed to teach — one data set per test. The same map is available in R via ?datarium. Each analysis below links to its worked tutorial on Datanovia.

Comparing means

AnalysisData set
One-sample t-testmice
Paired-samples t-testmice2
Two-samples (independent) t-testgenderweight

Analysis of variance (ANOVA)

AnalysisData set
Two-way ANOVAjobsatisfaction
Three-way ANOVAheadache, heartattack
One-way repeated measures ANOVAselfesteem
Two-way repeated measures ANOVAselfesteem2
Three-way repeated measures ANOVAweightloss
Two-way mixed ANOVAanxiety, depression
Three-way mixed ANOVAperformance
Two-way ANCOVAstress

Categorical data and proportions

AnalysisData set
Chi-square test of independenceproperties, housetasks.raw
Categorical descriptive statisticstitanic.raw
McNemar’s testantismoking
Cochran’s Q testtaskachievment
Cochran-Armitage trend testrenalstone

Regression

AnalysisData set
Linear regressionmarketing
Poisson regression (count data)infections
Logistic regression (real, messy clinical data)heartdisease

Time series

AnalysisData set
Time seriesAirPassengersDf

Helper functions

The two data sets (Titanic and housetasks) are frequency/contingency table. We’ll create our demo data sets by recovering the original data from Titanic and housetasks tables.

To do so, first copy and paste the following helper function:

counts_to_cases <- function(x, countcol = "Freq") {
    if(!inherits(x, "table")) x <- as.table(as.matrix(x))
      x <- as.data.frame(x)
    # Get the row indices to pull from x
    idx <- rep.int(seq_len(nrow(x)), x[[countcol]])
    # Drop count column
    x[[countcol]] <- NULL
    # Get the rows from x
    x <- x[idx, ]
    rownames(x) <- 1:nrow(x)
    x
}

Then, recover the original data as follow:

# Load the data
data("Titanic")
data("housetasks", package = "factoextra")

# Recover the original raw data
titanic.raw <- counts_to_cases(Titanic)
housetasks.raw <- counts_to_cases(housetasks)

Copy Link

Version

Install

install.packages('datarium')

Monthly Downloads

1,700

Version

0.2.0

License

GPL-2

Maintainer

Alboukadel Kassambara

Last Published

July 23rd, 2026

Functions in datarium (0.2.0)

properties

Properties Data for Chi-square Test of Independence
mice2

Mice Weight Data for Paired-Samples Mean Test
infections

Infection Count Data for Poisson Regression
jobsatisfaction

Job Satisfaction Data for Two-Way ANOVA
marketing

Marketing Data Set
renalstone

Risk of Renal Stone Data for Cochran-Armitage Trend Test
taskachievment

Task Achievment Data for Cochran's Q Test
selfesteem2

Self Esteem Score Data for Two-way Repeated Measures ANOVA
titanic.raw

Survival of Passengers on the Titanic
weightloss

Weight Loss Score Data for Three-way Repeated Measures ANOVA
housetasks.raw

Housetasks
heartdisease

Heart Disease Data (UCI, Four Sites, with Real Missing Values)
headache

Headache Data for Three Way ANOVA
depression

Depression Data for Two Way Mixed ANOVA
antismoking

Anti-Smoking Emotive Communication Data for McNemar Test
genderweight

Weight Data By Gender for Two-Samples Mean Test
AirPassengersDf

Air Passengers
heartattack

Heart Attack Data for Three Way ANOVA
datarium

datarium: Data Bank for Statistical Analysis and Visualization
performance

Performance Data for Three-Way Mixed ANOVA
anxiety

Anxiety Data for Two-Way Mixed ANOVA
selfesteem

Self-Esteem Score Data for One-way Repeated Measures ANOVA
stress

Stress Data for Two-Way ANCOVA
mice

Mice Weight Data for One Sample Mean Test