CommencerCommencer gratuitement

Weight & height data

The bdims data set from the openintro package is loaded in your workspace. bdims contains physical measurements on a sample of 507 individuals, including their weight in kg (wgt) and height in cm (hgt). You will use these data to build insights into the relationship between weight and height.

Cet exercice fait partie du cours

Bayesian Modeling with RJAGS

Afficher le cours

Instructions

  • Construct a scatterplot of wgt (y-axis) vs hgt (x-axis) using ggplot() with a geom_point() layer.
  • Construct a scatterplot of wgt vs hgt which includes a geom_smooth() of the linear relationship between these 2 variables.

Exercice interactif pratique

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

# Construct a scatterplot of wgt vs hgt
ggplot(___, aes(x = ___, y = ___)) + 
    geom_point()

# Add a model smooth
ggplot(___, aes(x = ___, y = ___)) + 
    ___() + 
    geom_smooth(method = "lm", se = FALSE)
Modifier et exécuter le code