# R for Psychological Research, Lesson 14: One-sample t-test
# Code from the lesson page, in order. Run it line by line with Ctrl+Enter (Cmd+Enter on a Mac).
# Lines that start with # are comments: R ignores them.


# ---- Set up ----

library(tidyverse)
library(rstatix)
students <- read_csv("data/students.csv", show_col_types = FALSE)


# ---- Describe first ----

students %>% get_summary_stats(Wellbeing_T1, type = "mean_sd")


# ---- Run the test ----

students %>% t_test(Wellbeing_T1 ~ 1, mu = 4)


# ---- How big is the difference? ----

students %>% cohens_d(Wellbeing_T1 ~ 1, mu = 4)
