Ammonium
\(H_o : \alpha_i = 0\)
\(H_a: \alpha_i \ne 0\)
StirRate
\(H_o: \beta_j = 0\)
\(H_a: \beta_j \ne 0\)
Temperature
\(H~o: \gamma_k = 0\)
\(H~a: \gamma_k \ne 0\)
\(H~o: \alpha\beta_{ij} = 0\) \(H~a: \alpha\beta_{ij} \ne 0\)
\(H~o: \alpha\gamma_{ik} = 0\) \(H~a: \alpha\gamma_{ik} \ne 0\)
\(H~o: \beta\gamma_{jk} = 0\) \(H~a: \beta\gamma_{jk} \ne 0\)
\(H~o: \alpha\beta\gamma_{ijk} = 0\) \(H~a: \alpha\beta\gamma_{ijk} \ne 0\)
Model Equation
\(Y_{ijkl} = \mu + \alpha_i + \beta_j + \alpha\beta_{ij} + \alpha\gamma_{ik} + \beta\gamma_{jk} + \alpha\beta\gamma_{ijk} + \epsilon_{ijkl}\)
We start testing hypothesis of the highest model interraction
dat<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/PowderProduction.csv")
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.
dat$Ammonium<-as.fixed(dat$Ammonium)
dat$StirRate<-as.fixed(dat$StirRate)
dat$Temperature<-as.fixed(dat$Temperature)
model<-lm(Density~Ammonium*StirRate*Temperature, data = dat)
gad(model)
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 11.1803 0.010175 *
## StirRate 1 70.686 70.686 17.8037 0.002918 **
## Temperature 1 0.328 0.328 0.0826 0.781170
## Ammonium:StirRate 1 28.117 28.117 7.0817 0.028754 *
## Ammonium:Temperature 1 0.022 0.022 0.0055 0.942808
## StirRate:Temperature 1 10.128 10.128 2.5510 0.148890
## Ammonium:StirRate:Temperature 1 1.519 1.519 0.3826 0.553412
## Residual 8 31.762 3.970
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the result, values of “Prob > F” less than 0.0500 indicate model terms are significant, in this case, Ammonium:StirRate:Temperature is insignificant, hence we fail to reject Ho
Model Equation
\(Y_{ijkl} = \mu + \alpha_i + \beta_j + \alpha\beta_{ij} + \alpha\gamma_{ik} + \beta\gamma_{jk} + \epsilon_{ijkl}\)
model1<-lm(Density~Ammonium+StirRate+Temperature+Ammonium*StirRate+Temperature*Ammonium+StirRate*Temperature, data = dat)
gad(model1)
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 12.0037 0.007109 **
## StirRate 1 70.686 70.686 19.1150 0.001792 **
## Temperature 1 0.328 0.328 0.0886 0.772681
## Ammonium:StirRate 1 28.117 28.117 7.6033 0.022206 *
## Ammonium:Temperature 1 0.022 0.022 0.0059 0.940538
## StirRate:Temperature 1 10.128 10.128 2.7389 0.132317
## Residual 9 33.281 3.698
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the result, values of “Prob > F” less than 0.0500 indicate model terms are significant, in this case, StirRate:Temperature, Ammonium:Temperature are insignificant, hence we fail to reject Ho This model terms will be dropped
Model Equation
\(Y_{ijkl} = \mu + \alpha_i + \beta_j + \alpha\beta_{ij} + \epsilon_{ijkl}\)
model3<-lm(Density~Ammonium+StirRate+Temperature+Ammonium*StirRate, data = dat)
gad(model3)
## Analysis of Variance Table
##
## Response: Density
## Df Sum Sq Mean Sq F value Pr(>F)
## Ammonium 1 44.389 44.389 11.2425 0.006443 **
## StirRate 1 70.686 70.686 17.9028 0.001410 **
## Temperature 1 0.328 0.328 0.0830 0.778613
## Ammonium:StirRate 1 28.117 28.117 7.1211 0.021851 *
## Residual 11 43.431 3.948
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the result, values of “Prob > F” less than 0.0500 indicate model terms are significant, in this case, Ammonium:StirRate, Ammonium, StirRate are significant model terms, hence we reject Ho.
interaction.plot(dat$Ammonium, dat$StirRate, dat$Density, type = "o", main="Interaction plot",col=5:7,ylab = "Density", xlab = "StirRate", trace.label = "Ammonium", lwd=3,lty = 1, ylim = c(5,20 ),pch = c(16))
#interaction.plot(culture,time,response1,fun="mean",type = "b", col = 5:7,
#main ="Interraction Plot", ylab = "Virus response", xlab = "Culture medium",
#trace.label = "Time", lwd = 3, lty = 1, ylim = c(20,40), pch = c(4,2))