scale1_by_condition12 <- data_scalescomputed %>%
group_by(condition12) %>%
summarise(mean_scale1 = mean(scale1_index, na.rm = TRUE),
sd_scale1 = sd(scale1_index, na.rm = TRUE))5 Describe
5.1 getting a feel for your data
str
glimpse
skimr
5.2 counting things
group_by + summarise + count
n
tabyl
5.3 getting descriptives
group_by + summarise + mean & sd
5.3.1 Three things to remember
- When we compute means, we need to set the decimals via
round(). - We also need to tell R to calculate the mean, even if some of the contributing data points are missing. This is what
na.rm = TRUEdoes. - As noted above,
rowwiseasks R to do something for each row (which is what we want here – to compute the mean of the contributing items for each participant). Whenever we userowwise(orgroup_by), we need toungroup()at the end to avoid issues down the line.
5.4 tables??
gt
gt(scale1_by_condition12)apaTable