Problem 14.3

This is an example of a nested design with two factors machine and spindle where the spindle is nested within the machine

Factor A is machine and it has three levels (I=3) and Factor B is spindle and it has two levels (J=2) and the number of replicates are four(4) [K=4].

Machine (Factor A) has fixed effect and spindle Factor(B) has random effect. This is a mixed effects model

The model equation is

\(Y_{ijk}\) = \(\mu\) + \(\alpha_i\) + \(\beta_{j(i)}\) + \(\epsilon_{ijk}\)

Data entry

machine<-c(rep(1,8),rep(2,8),rep(3,8))
spindle<-c(rep(1,4),rep(2,4))
spindle<-rep(spindle,3)
values<-c(12,9,11,12,8,9,10,8,
          14,15,13,14,12,10,11,13,
          14,10,12,11,16,15,15,14)

data<-data.frame(machine,spindle,values)
data
data$machine <- as.fixed(data$machine)
data$spindle <- as.random(data$spindle)

The hypotheses that we are testing in this experiment are

Hypothesis for nested factor (spindle) [random effect]

Null Hypothesis: \(\sigma^2_\beta = 0\)

Alternate Hypothesis: \(\sigma^2_\beta\) \(\neq 0\)

Hypothesis for main factor (machine) [fixed effect]

Null Hypothesis: \(\alpha_i = 0\)

Alternate Hypothesis: \(\alpha_i \neq 0\)

Data Analysis

model<-lm(values~machine+spindle %in% machine,data = data)
gad(model)

From the above analysis we can say that the p-value for the nested factor (spindle) is 0.00044 and it is very less than the \(\alpha\) value of 0.05. Hence we we reject Null Hypothesis and claim that spindle has a signifcant effect on the model.

But the p-value for the main factor (machine) is 0.2915 and it is greater than the \(\alpha\) value of 0.05. Hence we fail to reject the null hypothesis and claim that machine does not have a significant effect on the model.

Source Code

library(GAD)
machine<-c(rep(1,8),rep(2,8),rep(3,8))
spindle<-c(rep(1,4),rep(2,4))
spindle<-rep(spindle,3)
values<-c(12,9,11,12,8,9,10,8,
          14,15,13,14,12,10,11,13,
          14,10,12,11,16,15,15,14)

dat<-data.frame(machine,spindle,values)
data
data$machine <- as.fixed(data$machine)
data$spindle <- as.random(data$spindle)
model<-lm(values~machine+spindle %in% machine,data = dat)
gad(model)