In Chapter 12 , Experiments with Random Factors , of the book Design and Analysis of Experiments, written by Douglas C. Montgomery , at the end of the chapter , Example 12-2 is done by SAS . In Example 12-2 , , the model is a two-factor factorial random effect model .The output is given in Table 12-17

I am trying to fit the model in R by `lmer` .

Code:

```
library(lme4)
fit <- lmer(y~(1|operator)+(1|part),data=dat)
```

Code:

```
est_ope=VarCorr(fit)$operator[1]
est_part = VarCorr(fit)$part[1]
sig = summary(fit)$sigma
est_res = sig^2
```

Any help is appreciated . Thank you .