library(agricolae)
## Warning: package 'agricolae' was built under R version 4.0.5
r1 <- c(17.6,18.9,16.3,17.4,20.1,21.6)
r2 <- c(16.9,15.3,18.6,17.1,19.5,20.3)
r3 <- c(21.4,23.6,19.4,18.5,20.5,22.3)
r4 <- c(19.3,21.1,16.9,17.5,18.3,19.8)
life <- c(r1,r2,r3,r4)
type <- c(rep(1,6),rep(2,6),rep(3,6),rep(4,6))
dat1 <- cbind(life,type)
dat1 <- as.data.frame(dat1)
dat1$type <- as.factor(dat1$type)
aov.model<-aov(life~type,data=dat1)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## type 3 30.17 10.05 3.047 0.0525 .
## Residuals 20 65.99 3.30
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
LSD.test(aov.model,"type",p.adj = "none",console=TRUE)
##
## Study: aov.model ~ "type"
##
## LSD t Test for life
##
## Mean Square Error: 3.299667
##
## type, means and individual ( 95 %) CI
##
## life std r LCL UCL Min Max
## 1 18.65000 1.952178 6 17.10309 20.19691 16.3 21.6
## 2 17.95000 1.854454 6 16.40309 19.49691 15.3 20.3
## 3 20.95000 1.879096 6 19.40309 22.49691 18.5 23.6
## 4 18.81667 1.554885 6 17.26975 20.36358 16.9 21.1
##
## Alpha: 0.05 ; DF Error: 20
## Critical Value of t: 2.085963
##
## least Significant Difference: 2.187666
##
## Treatments with the same letter are not significantly different.
##
## life groups
## 3 20.95000 a
## 4 18.81667 ab
## 1 18.65000 b
## 2 17.95000 b
plot(aov.model)
library(MASS)
## Warning: package 'MASS' was built under R version 4.0.5
r1 <- c(110,157,194,178)
r2 <- c(1,2,4,18)
r3 <- c(880,1256,5276,4355)
r4 <- c(495,7040,5307,10050)
r5 <- c(7,5,29,2)
failure_time <- c(r1,r2,r3,r4,r5)
material <- c(rep(1,4),rep(2,4),rep(3,4),rep(4,4),rep(5,4))
dat2 <- cbind(failure_time,material)
dat2 <- as.data.frame(dat2)
dat2$material <- as.factor(dat2$material)
aov.model<-aov(failure_time~material,data=dat2)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## material 4 103191489 25797872 6.191 0.00379 **
## Residuals 15 62505657 4167044
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(aov.model)
boxcox(failure_time~material)
dat2$failure_time <- log(dat2$failure_time)
aov.model<-aov(failure_time~material,data=dat2)
plot(aov.model)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## material 4 165.06 41.26 37.66 1.18e-07 ***
## Residuals 15 16.44 1.10
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
r1 <- c(31,10,21,4,1)
r2 <- c(62,40,24,30,35)
r3 <- c(53,27,120,97,68)
count <- c(r1,r2,r3)
method <- c(rep(1,5),rep(2,5),rep(3,5))
dat3 <- cbind(count,method)
dat3 <- as.data.frame(dat3)
dat3$method <- as.factor(dat3$method)
aov.model<-aov(count~method,data=dat3)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## method 2 8964 4482 7.914 0.00643 **
## Residuals 12 6796 566
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(aov.model)
boxcox(count~method)
dat3$count <- sqrt(dat3$count)
aov.model<-aov(count~method,data=dat3)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## method 2 63.90 31.95 9.84 0.00295 **
## Residuals 12 38.96 3.25
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
kruskal.test(life~type,data=dat1)
##
## Kruskal-Wallis rank sum test
##
## data: life by type
## Kruskal-Wallis chi-squared = 6.2177, df = 3, p-value = 0.1015