> inference(y = d$sleep_hrs,
+ x = d$job,
+ est = "mean",
+ type = "ht",
+ null = 0,
+ alternative = "twosided",
+ method = "theoretical")
Response variable: numerical, Explanatory variable: categorical
Difference between two means
Summary statistics:
n_no = 12, mean_no = 7.2083,
Error in FUN(X[[1L]], ...) : could not find function "FUN"
# summary statistics and eda plots
cat("Summary statistics:\n")
if (est == "mean") {
for (i in 1:x_levels) {
cat("n_", names(by(y, x, length))[i], " = ", by(y, x, length)[i], ", ", sep = "")
cat("mean_", names(by(y, x, mean))[i], " = ", round(by(y, x, mean)[i], 4), ", ",
sep = "")
cat("sd_", names(by(y, x, sd))[i], " = ", round(by(y, x, sd)[i], 4), "\n", sep = "")
}