how do i group by male and female when sex is the variable when doing IDQ, Mode, skew and kurtosis

Nhis7 %>% group_by(sex) %>%
summarise(sd = sd(hourssleep, na.rm = T),
median = median(hourssleep, na.rm = T),
range = paste(min(hourssleep, na.rm = T), "-", max(hourssleep, na.rm = T)),
n = sum(!
this worked for sd, mean, and range but I have no idea how to split up hours sleep by sex for skew, kurtosis , coefficient of variation, quintiles.

this is my first ever computer class!! thanks!!!


Hi @Laurabell.
Welcome to the RStudio Community Forum.

Google is your friend! Try searching for

calculate skewness in R

You are already splitting your dataset using the group_by() function.