library(GAD)
library(MASS)
method<-c(rep(1,6),rep(2,6),rep(3,6),rep(4,6))
method
## [1] 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4
obs<-c(.34,.12,1.23,.70,1.75,.12,
.91,2.94,2.14,2.36,2.86,4.55,
6.31,8.37,9.75,6.09,9.82,7.24,
17.15,11.82,10.97,17.20,14.35,16.82)
obs
## [1] 0.34 0.12 1.23 0.70 1.75 0.12 0.91 2.94 2.14 2.36 2.86 4.55
## [13] 6.31 8.37 9.75 6.09 9.82 7.24 17.15 11.82 10.97 17.20 14.35 16.82
method<-as.fixed(method)
The linear effects model is
\[y_{ij}=\mu+\tau_i+\epsilon_{ij}\]
where \(\mu\) is the overall mean, \(\tau_i\) is the effect of estimation method \(i\), and \(\epsilon_{ij}\) is the random error.
Hypotheses: \[H_0:\mu_1=\mu_2=\mu_3=\mu_4\] \[H_a:\text{At least one }\mu_i \text{ is different.}\]
model<-lm(obs~method)
gad(model)
## $anova
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## method 3 708.68 236.225 76.287 4.004e-11 ***
## Residuals 20 61.93 3.097
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)
The residual plots suggest that the residuals are approximately normally distributed. The spread of the residuals appears to increase as the fitted values increase, suggesting that the variance is not constant.
aov.model<-aov(obs~method)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## method 3 708.7 236.2 76.29 4e-11 ***
## Residuals 20 61.9 3.1
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(aov.model)
The residual plots indicate that the constant variance assumption may not be satisfied, so a transformation should be considered.
boxcox(aov.model)
The Box-Cox plot suggests a value of \(\lambda\) near 0.6. Since \(\lambda=0.5\) is within the confidence interval and is close to the maximum, a square-root transformation is appropriate.
obs.trans<-sqrt(obs)
aov.trans<-aov(obs.trans~method)
summary(aov.trans)
## Df Sum Sq Mean Sq F value Pr(>F)
## method 3 32.69 10.898 81.17 2.27e-11 ***
## Residuals 20 2.69 0.134
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(aov.trans)
The residual plots show improvement after applying the transformation. The p-value is less than 0.05, therefore we reject \(H_0\) at the \(\alpha=0.05\) level of significance. There is sufficient evidence to conclude that at least one estimation method has a different mean peak discharge.
kruskal.test(obs~method)
##
## Kruskal-Wallis rank sum test
##
## data: obs by method
## Kruskal-Wallis chi-squared = 21.156, df = 3, p-value = 9.771e-05
The p-value is less than 0.05, therefore we reject \(H_0\) at the \(\alpha=0.05\) level of significance. There is sufficient evidence to conclude that the four estimation methods do not all produce equivalent peak discharge estimates.
library(GAD)
library(MASS)
method<-c(rep(1,6),rep(2,6),rep(3,6),rep(4,6))
method
obs<-c(.34,.12,1.23,.70,1.75,.12,
.91,2.94,2.14,2.36,2.86,4.55,
6.31,8.37,9.75,6.09,9.82,7.24,
17.15,11.82,10.97,17.20,14.35,16.82)
obs
method<-as.fixed(method)
model<-lm(obs~method)
gad(model)
plot(model)
aov.model<-aov(obs~method)
summary(aov.model)
plot(aov.model)
boxcox(aov.model)
obs.trans<-sqrt(obs)
aov.trans<-aov(obs.trans~method)
summary(aov.trans)
plot(aov.trans)
kruskal.test(obs~method)