Variations on Nested Designs

A short description of the post.

Kris Sankaran true
12-16-2021

Readings 14.2, 14.3, Rmarkdown

Nested designs are versatile; they can be applied to many levels of nesting and in conjunction with factors.

General Nested Designs

display(readImage("https://uwmadison.box.com/shared/static/hacac7wv04k9ua657et7hzd8wg1827ln.png"))
A three level nested design.

Figure 1: A three level nested design.

Almost the same methodology used in 2-level nested designs carries over to more general levels. Graphically, the tree of effects grows deeper. Since there are more parameters at deeper levels of nesting, it is often a good idea to fit those parameters using random effects.

Simultaneous Nesting and Factors

Nested terms can be included in standard factorial models. Consider the following setting (Example 14.2),

####(readImage("https://uwmadison.box.com/shared/static/ijhv501h8c07j2xvonxcsg4rkhjoh840.png"))

The operator effect is nested within the layout effect. It should also be treated as a random effect, because we want to understand variation across all possible operators, when choosing a particular layout and fixture design. Therefore, a reasonable model is

\[\begin{align*} y_{ijkl} &= \mu + \alpha_{i} + \beta_{j} + \tau_{k\left(j\right)} + \left(\alpha\beta\right)_{ij} + \left(\alpha \tau\right)_{ik\left(j\right)} \end{align*}\]

Since this model has both random and fixed effect terms, it is called a mixed effects model. It is fit below.

assembly <- read_csv("https://uwmadison.box.com/shared/static/gvev45mtp69fb19ng37nlntyiy4x6dmj.csv") %>%
  mutate_at(vars(Operator, Layout, Fixture), as.factor)
ggplot(assembly) +
  geom_point(aes(x = Operator, y = Time)) +
  facet_grid(Fixture ~ Layout, scale = "free_x")
Assembly time as a function of layout (columns) and fixture (rows). Note operators are nested within layouts.

Figure 2: Assembly time as a function of layout (columns) and fixture (rows). Note operators are nested within layouts.

fit <- aov(Time ~ Fixture * Layout +  Error(Layout / Operator), data = assembly)
summary(fit)

Error: Layout
       Df Sum Sq Mean Sq
Layout  1  4.083   4.083

Error: Layout:Operator
          Df Sum Sq Mean Sq F value Pr(>F)
Residuals  6  71.92   11.99               

Error: Within
               Df Sum Sq Mean Sq F value   Pr(>F)    
Fixture         2  82.79   41.40  12.232 8.84e-05 ***
Fixture:Layout  2  19.04    9.52   2.813   0.0732 .  
Residuals      36 121.83    3.38                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The ANOVA table suggests that layout doesn’t have much of an effect, but that certain fixtures are easier to assemble than others. The fact that there is an interaction between fixtures and operators suggests that the operators who are much worse at some fixtures than others could be retrained.