Data Bank for Statistical Analysis and Visualization

Contains data organized by topics: categorical data, regression model, means comparisons, independent and repeated measures ANOVA, mixed ANOVA and ANCOVA. The package code is under GPL-2; the data sets are covered by the terms in the 'LICENSE.note' file (the author's data sets under CC0 1.0, and the 'heartdisease' data under CC BY 4.0, see the 'heartdisease' help page).


R buildstatus CRAN_Status_Badge Downloads TotalDownloads

datarium: Data bank for statistical analyses and visualization datarium hex logo

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

Analysis Data set
One-sample t-test mice
Paired-samples t-test mice2
Two-samples (independent) t-test genderweight

Analysis of variance (ANOVA)

Analysis Data set
Two-way ANOVA jobsatisfaction
Three-way ANOVA headache, heartattack
One-way repeated measures ANOVA selfesteem
Two-way repeated measures ANOVA selfesteem2
Three-way repeated measures ANOVA weightloss
Two-way mixed ANOVA anxiety, depression
Three-way mixed ANOVA performance
Two-way ANCOVA stress

Categorical data and proportions

Analysis Data set
Chi-square test of independence properties, housetasks.raw
Categorical descriptive statistics titanic.raw
McNemar’s test antismoking
Cochran’s Q test taskachievment
Cochran-Armitage trend test renalstone

Regression

Analysis Data set
Linear regression marketing
Poisson regression (count data) infections
Logistic regression (real, messy clinical data) heartdisease

Time series

Analysis Data set
Time series AirPassengersDf

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)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("datarium")

0.2.0 by Alboukadel Kassambara, 2 months ago


https://rpkgs.datanovia.com/datarium/


Report a bug at https://github.com/kassambara/datarium/issues


Browse source code at https://github.com/cran/datarium


Authors: Alboukadel Kassambara [aut, cre]


Documentation:   PDF Manual  


GPL-2 license


Suggests knitr


See at CRAN