Contains data organized by topic: categorical data, regression model, means comparisons, independent and repeated measures ANOVA, mixed ANOVA and ANCOVA.
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)
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.