Position<-c(rep(1,9),rep(2,9))
temp<-c(800,825,850)
temp<-rep(temp,6)
obs<-c(570,1063,565,
565,1080,510,
583,1043,590,
528,988,526,
547,1026,538,
521,1004,532)
dat1<-data.frame(Position,temp,obs)
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.
dat1$Position<-as.fixed(dat1$Position)
dat1$temp<-as.fixed(dat1$temp)
model1<-aov(obs~Position+temp+Position*temp,data = dat1)
gad(model1)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## Position 1 7160 7160 15.998 0.001762 **
## temp 2 945342 472671 1056.117 3.25e-14 ***
## Position:temp 2 818 409 0.914 0.427110
## Residual 12 5371 448
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
P values are:
For Position = 0.0017
Temp = 3.25e-14
Interaction = 0.4271
dat1$Position<-as.random(dat1$Position)
dat1$temp<-as.random(dat1$temp)
model2<-aov(obs~Position+temp+Position*temp,data = dat1)
gad(model2)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## Position 1 7160 7160 17.504 0.0526583 .
## temp 2 945342 472671 1155.518 0.0008647 ***
## Position:temp 2 818 409 0.914 0.4271101
## Residual 12 5371 448
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
P values are:
For Position = 0.0526
Temp = 0.0008
Interaction = 0.4271
dat1$Position<-as.fixed(dat1$Position)
dat1$temp<-as.random(dat1$temp)
model3<-lm(obs~Position+temp+Position*temp,data = dat1)
gad(model3)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## Position 1 7160 7160 17.504 0.05266 .
## temp 2 945342 472671 1056.117 3.25e-14 ***
## Position:temp 2 818 409 0.914 0.42711
## Residual 12 5371 448
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
P values are:
For Position = 0.05266
Temp = 3.25e-14
Interaction = 0.4271
The p values for part A and C for temperature remains the same and that of position changes.
The p values for part A and B for temperature and position remains the same.
The p values for interaction remains the same throughout.