Skip to contents

Data from a randomized blocked experiment to investigate the effect of a drug added to the feed of chicks in an attempt to promote growth. The comparison is between three treatments: standard feed (control), standard feed plus low dose of drug, standard feed plus high dose of drug. The experimental unit is a group of chicks, reared and fed together in the birdhouse. The experimental units are grouped three to a block, with physically adjacent units going in the same block.

Usage

chickens

Format

A data frame with 24 rows and 3 columns:

block

Block corresponding to a bird house

dose

Dose of drug added to the diet (control, low or high)

weight

Average weight per bird (in pounds) at maturity for the group of birds in each experimental unit

Source

Snee, R.D. (1985) Graphical display of results of three-treatment randomized block experiments. Applied Statistics, 34, 71-7.

Examples

library(hsds)
library(ggplot2)
library(lme4)
#> Loading required package: Matrix

# Plot of the average weight per diet, on top of a box plot
ggplot(chickens, aes(x = dose, y = weight)) +
  geom_boxplot(color = "gray") +
  geom_line(aes(color = block, group = block)) +
  geom_point(aes(color = block), size = 2) +
  theme_classic()


# Model of the weight by dose, taking into account the random variation within
# each individual unit
mod <- lmer(weight ~ dose + (1 | block), data = chickens)
summary(mod)
#> Linear mixed model fit by REML ['lmerMod']
#> Formula: weight ~ dose + (1 | block)
#>    Data: chickens
#> 
#> REML criterion at convergence: -43
#> 
#> Scaled residuals: 
#>      Min       1Q   Median       3Q      Max 
#> -1.59348 -0.62704 -0.02187  0.75035  1.42969 
#> 
#> Random effects:
#>  Groups   Name        Variance Std.Dev.
#>  block    (Intercept) 0.000994 0.03153 
#>  Residual             0.004765 0.06903 
#> Number of obs: 24, groups:  block, 8
#> 
#> Fixed effects:
#>             Estimate Std. Error t value
#> (Intercept)  3.86625    0.02683 144.100
#> doselow      0.13875    0.03451   4.020
#> dosehigh     0.17125    0.03451   4.962
#> 
#> Correlation of Fixed Effects:
#>          (Intr) doselw
#> doselow  -0.643       
#> dosehigh -0.643  0.500

# The `modelbased` package is great to estimate marginal means
modelbased::estimate_means(mod, at = c("dose"))
#> Error in loadNamespace(x): there is no package called ‘modelbased’

# Or to estimate contrasts to see if there is a significant difference in weight
# between diets
modelbased::estimate_contrasts(mod, contrast = "dose", p_adjust = "tukey")
#> Error in loadNamespace(x): there is no package called ‘modelbased’