Problem 14.3
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
machine <- c(rep(1,8),rep(2,8),rep(3,8))
spindle <- rep(c(rep(1,4),rep(2,4)),3)
observation <- 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)
machine <- as.fixed(machine)
spindle <- as.random(spindle)
dat <- data.frame(machine,spindle,observation)
dat
## machine spindle observation
## 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
model <- lm(observation~machine+spindle%in%machine)
gad(model)
## Analysis of Variance Table
##
## Response: observation
## 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
Model Equation: Y-ijk = mu + alpha_i + beta_j(i) + e_ijk, where spindle is nested within machine. Hypothesis Test:
Null H_0: alpha_i = 0 for all i Alternative H_a: alpha_i != 0 for some i
Null H_0: beta_j(i) = 0 for all i,j Alternative H_a: beta_j(i) != 0 for some i,j
From the summary we see that, the factor machine is not significant since P value (0.2915630) is higher than \(\alpha = 0.05\) level of significance thus we fail to reject \(H_0\). On the other hand, the factor spindle is nested within the factor machine is significant since P value (0.0004428) is lower than \(\alpha = 0.05\) level of significance thus we reject \(H_0\).
Source Code:
library(GAD)
machine <- c(rep(1,8),rep(2,8),rep(3,8))
spindle <- rep(c(rep(1,4),rep(2,4)),3)
observation <- 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)
machine <- as.fixed(machine)
spindle <- as.random(spindle)
dat <- data.frame(machine,spindle,observation)
dat
model <- lm(observation~machine+spindle%in%machine)
gad(model)