CommencerCommencer gratuitement

Tests for two groups

Besides looking at associations between two or more continuous numeric variables, it is also useful to look for associations between a continuous numeric variable and a group variable, such as between abalone length and the dichotomous adult variable in abaloneKeep.

To look at this relationship, in this exercise, you will perform a t-test to determine if there a difference in abalone lengths between infants and adults.

The abaloneKeep dataset, dplyr and ggplot2 packages have been loaded for you.

Cet exercice fait partie du cours

R For SAS Users

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Get n, mean, sd for length by adult groups
abaloneKeep %>% 
  ___ %>%
  ___ %>%
  summarise(across(everything(), list(___ = ~ mean(.x),
                                      ___ = ~ sd(.x))),
            N = ___)
Modifier et exécuter le code