Session Ready
Exercise

NHANES RCBD

Recall that our blocked experiment involved a treatment wherein the doctor asks the patient to reduce their fat or calories in their diet, and we're testing the effect this has on weight (bmxwt). We plan to block by gender, which in the NHANES dataset is stored as riagendr. Recall that blocking is done to create experimental groups that are as similar as possible. Blocking this experiment by gender means that if we observe an effect of the treatment on bmxwt, it's more likely that the effect was actually due to the treatment versus the individual's gender.

In your R code, you denote a blocked experiment by using a formula that looks like: outcome ~ treatment + blocking_factor in the appropriate modeling function.

nhanes_final is available.

Instructions
100 XP
  • Use aov() to create nhanes_rcbd. Recall that the treatment is stored in mcq365d and you're testing the outcome bmxwt, with the blocking factor riagendr.
  • Examine the results of nhanes_rcbd with summary().
  • Use dplyr functions to examine the mean weights by mcq365d and riagendr.