Code
library(ESRM64503)
library(tidyverse)
library(kableExtra)
library(gt)
data("dataTestExperiment")
dataTestExperiment |>
group_by(Senior, New) |>
summarise(
Mean = mean(Test),
SD = sd(Test),
SE = sd(Test) / sqrt(25)
) |>
mutate(
Statistics = paste0(signif(Mean, 4), "(", round(SD, 2), ")", "[", round(SE, 2), "]")
) |>
dplyr::select(-c(Mean, SD, SE)) |>
mutate(
Senior = factor(Senior, levels = 0:1, labels = c("Freshmen", "Senior")),
New = factor(New, levels = 0:1, labels = c("Old", "New")),
) |>
pivot_wider(names_from = Senior, values_from = Statistics) |>
kable()
New | Freshmen | Senior |
---|---|---|
Old | 80.2(2.6)[0.52] | 82.36(2.93)[0.59] |
New | 87.96(2.24)[0.45] | 87.08(2.9)[0.58] |