Aan de slagGa gratis aan de slag

BIBD - cat's kidney function

To be sure we truly understand what a BIBD looks like, let's build a dataset containing a BIBD from scratch.

Say we want to test the difference between four different wet foods in cats' diets on their kidney function. Cat food, however, is expensive, so we'll only test 3 foods per block to save some money. The blocking factor is the color of cat, as we aren't interested in that as part of our experiment. The outcome will be measured blood creatinine level, an indicator of kidney function and dysfunction in cats and humans alike.

Deze oefening maakt deel uit van de cursus

Experimental Design in R

Cursus bekijken

Oefeninstructies

  • The custom function lambda() has been loaded for you. Calculate lambda with t = 4, k = 3, and r = 3 to make sure a BIBD is possible.
  • Run the code to assemble the dataset. You can see the order in which the food treatments are used in each block.
  • Create cat_model with aov() according to the description of the experiment above and examine the results with summary(). Does type of wet food make a difference on creatinine levels?

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate lambda
___

# Build the data.frame
creatinine <- c(1.98, 1.97, 2.35, 2.09, 1.87, 1.95, 2.08, 2.01, 1.84, 2.06, 1.97, 2.22)
food <- as.factor(c("A", "C", "D", "A", "B", "C", "B", "C", "D", "A", "B", "D"))
color <- as.factor(rep(c("Black", "White", "Orange", "Spotted"), each = 3))
cat_experiment <- as.data.frame(cbind(creatinine, food, color))

# Create cat_model and examine with summary()
___ <- ___ (___ ~ ___ + color, data = ___)
___
Code bewerken en uitvoeren