Q.14.3

Here Factor A (Machine) has 3 levels and Factor B (Spindle) has 2 levels.

The given experiment is an nested design in which Factor B (Spindle) is nested within the Factor A (Machine)

Hence model equation will be

\(Y_{ijk} = \mu+\alpha_i + \beta_j(i) + \epsilon_ijk\)

In question it is asked to analyze the data considering both the factors as fixed but according to nested factors video of week 14, to perform the gad analysis we have to consider nested factor as random

Hence we will consider Factor B (Spindle) as random

machine<-c(rep(1,8),rep(2,8),rep(3,8))
spindle<-rep(c(rep(1,4),rep(2,4)),3)
observations<-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)
dataframe<-data.frame(machine,spindle,observations)
dataframe
##    machine spindle observations
## 1        1       1           12
## 2        1       1            9
## 3        1       1           11
## 4        1       1           12
## 5        1       2            8
## 6        1       2            9
## 7        1       2           10
## 8        1       2            8
## 9        2       1           14
## 10       2       1           15
## 11       2       1           13
## 12       2       1           14
## 13       2       2           12
## 14       2       2           10
## 15       2       2           11
## 16       2       2           13
## 17       3       1           14
## 18       3       1           10
## 19       3       1           12
## 20       3       1           11
## 21       3       2           16
## 22       3       2           15
## 23       3       2           15
## 24       3       2           14

Hypothesis to be tested

For Factor A (Machine)

Null Hypothesis :- \(\alpha_i= 0\)

Alternate Hypothesis :- \(\alpha_i\neq0\)

For Factor B (Spindle)

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

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

library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
machine<-as.fixed(machine)
spindle<-as.random(spindle)
model<-lm(observations~machine+spindle%in%machine)
gad(model)
## Analysis of Variance Table
## 
## Response: observations
##                 Df Sum Sq Mean Sq F value    Pr(>F)    
## machine          2  55.75 27.8750  1.9114 0.2915630    
## machine:spindle  3  43.75 14.5833  9.9057 0.0004428 ***
## Residual        18  26.50  1.4722                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)

From the results of gad model, the p-value for spindle nested in machine is 0.0004428, which is lesser than \(\alpha\) =0.05. Hence we conclude that we reject the null hypothesis and state that spindle has a significant effect on the model

From the results of gad model, the p-value for machine is 0.2915630, which is greater than \(\alpha\) =0.05. Hence we conclude that we failed to reject the null hypothesis and state that machine has a no significant effect on the model

From the residual plots we can conclude that data is fairly normally distributed and hence model is adequate.

All Code

machine<-c(rep(1,8),rep(2,8),rep(3,8))
spindle<-rep(c(rep(1,4),rep(2,4)),3)
observations<-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)
dataframe<-data.frame(machine,spindle,observations)
dataframe

library(GAD)
machine<-as.fixed(machine)
spindle<-as.random(spindle)
model<-lm(observations~machine+spindle%in%machine)
gad(model)
plot(model)