\(H_{1}\): At least one (\(\tau \beta_{ij}\)) \(\neq\) 0
library(GAD)
## 载入需要的程辑包:matrixStats
## 载入需要的程辑包:R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
density <- c(570,565,583,528,547,521,1063,1080,1043,988,1026,1004,565,510,590,526,538,532)
temp <- c(rep(800,6),rep(825,6),rep(850,6))
temp <- as.fixed(temp)
position <- c(rep(1,3),rep(2,3),rep(1,3),rep(2,3),rep(1,3),rep(2,3))
position <- as.fixed(position)
data2 <- as.data.frame(cbind(density,temp,position))
data2
## density temp position
## 1 570 1 1
## 2 565 1 1
## 3 583 1 1
## 4 528 1 2
## 5 547 1 2
## 6 521 1 2
## 7 1063 2 1
## 8 1080 2 1
## 9 1043 2 1
## 10 988 2 2
## 11 1026 2 2
## 12 1004 2 2
## 13 565 3 1
## 14 510 3 1
## 15 590 3 1
## 16 526 3 2
## 17 538 3 2
## 18 532 3 2
model<-aov(density~temp+position+temp*position)
GAD::gad(model)
## Analysis of Variance Table
##
## Response: density
## Df Sum Sq Mean Sq F value Pr(>F)
## temp 2 945342 472671 1056.117 3.25e-14 ***
## position 1 7160 7160 15.998 0.001762 **
## temp:position 2 818 409 0.914 0.427110
## Residual 12 5371 448
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
temp <- as.random(temp)
position <- as.random(position)
model<-aov(density~temp+position+temp*position)
GAD::gad(model)
## Analysis of Variance Table
##
## Response: density
## Df Sum Sq Mean Sq F value Pr(>F)
## temp 2 945342 472671 1155.518 0.0008647 ***
## position 1 7160 7160 17.504 0.0526583 .
## temp:position 2 818 409 0.914 0.4271101
## Residual 12 5371 448
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
position <- as.fixed(position)
model<-aov(density~temp+position+temp*position)
GAD::gad(model)
## Analysis of Variance Table
##
## Response: density
## Df Sum Sq Mean Sq F value Pr(>F)
## temp 2 945342 472671 1056.117 3.25e-14 ***
## position 1 7160 7160 17.504 0.05266 .
## temp:position 2 818 409 0.914 0.42711
## Residual 12 5371 448
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(a) p-value of temperature is 3.25e-14, p-value of position is 0.001762, p-value of interaction is 0.427110.
(b) p-value of temperature is 0.0008647, p-value of position is 0.0526583, p-value of interaction is 0.4271101.
(c) p-value of temperature is 3.25e-14, p-value of position is 0.05266, p-value of interaction is 0.42711.
(d)
1.The interaction’s p-value remained unchanged, regardless of whether or not the factors were considered fixed, random, or mixed.This strongly implies that the interaction between the two factors is not significant(p-value>0.05). The way we calculate the f-statistics is the same (MSAB/MSE) regardless of whether the factors were considered fixed, random, or mixed.
2. The temperature/position’s p-value was the same when the factors were considered fixed and when the factors were considered mixed. When the factors were considered random, the temperature/position’s p-value increased significantly.