resistance = read.table("resistance.txt",header=T)
head(resistance)
## score lignee
## 1 54 HM008
## 2 50 HM008
## 3 50 HM008
## 4 58 HM008
## 5 57 HM008
## 6 55 HM008
tail(resistance)
## score lignee
## 35 59 HM013
## 36 57 HM013
## 37 53 HM013
## 38 60 HM013
## 39 52 HM013
## 40 55 HM013
attach(resistance)
names(resistance)
## [1] "score" "lignee"
table(lignee)
## lignee
## A17 DZA45 HM008 HM013
## 10 10 10 10
tapply(score,lignee,mean)
## A17 DZA45 HM008 HM013
## 56.4 61.6 53.6 55.6
tapply(score,lignee,summary)
## $A17
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 54.00 55.00 55.50 56.40 57.75 61.00
##
## $DZA45
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 58.00 58.25 61.50 61.60 64.50 66.00
##
## $HM008
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 50.00 50.25 53.50 53.60 56.50 58.00
##
## $HM013
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 52.00 52.25 55.50 55.60 58.50 60.00
hist(score,breaks=15, ylab='effectifs')
boxplot(score~lignee,col="green",ylab="score")
shapiro.test(score[lignee=="HM008"])
##
## Shapiro-Wilk normality test
##
## data: score[lignee == "HM008"]
## W = 0.87013, p-value = 0.1003
shapiro.test(score[lignee=="A17"] )
##
## Shapiro-Wilk normality test
##
## data: score[lignee == "A17"]
## W = 0.89716, p-value = 0.2038
shapiro.test(score[lignee=="DZA45"])
##
## Shapiro-Wilk normality test
##
## data: score[lignee == "DZA45"]
## W = 0.87013, p-value = 0.1003
shapiro.test(score[lignee=="HM013"])
##
## Shapiro-Wilk normality test
##
## data: score[lignee == "HM013"]
## W = 0.87013, p-value = 0.1003
bartlett.test(score~lignee)
##
## Bartlett test of homogeneity of variances
##
## data: score by lignee
## Bartlett's K-squared = 1.4289, df = 3, p-value = 0.6988
res = aov(score~lignee)
summary(res) # ou summary(aov(score~lignee))
## Df Sum Sq Mean Sq F value Pr(>F)
## lignee 3 348.8 116.27 12.18 1.18e-05 ***
## Residuals 36 343.6 9.54
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pf(12.18,df1=3,df2=36,lower.tail=F)
## [1] 1.185722e-05
t.test(score[lignee=="DZA45"],score[lignee=="HM013"],var.equal=T)
##
## Two Sample t-test
##
## data: score[lignee == "DZA45"] and score[lignee == "HM013"]
## t = 4.0575, df = 18, p-value = 0.0007389
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 2.893286 9.106714
## sample estimates:
## mean of x mean of y
## 61.6 55.6
t.test(score[lignee=="DZA45"],score[lignee=="HM008"],var.equal=T)
##
## Two Sample t-test
##
## data: score[lignee == "DZA45"] and score[lignee == "HM008"]
## t = 5.41, df = 18, p-value = 3.856e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 4.893286 11.106714
## sample estimates:
## mean of x mean of y
## 61.6 53.6
t.test(score[lignee=="DZA45"],score[lignee=="A17"],var.equal=T)
##
## Two Sample t-test
##
## data: score[lignee == "DZA45"] and score[lignee == "A17"]
## t = 4.0716, df = 18, p-value = 0.0007161
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 2.516808 7.883192
## sample estimates:
## mean of x mean of y
## 61.6 56.4
t.test(score[lignee=="A17"],score[lignee=="HM013"],var.equal=T)
##
## Two Sample t-test
##
## data: score[lignee == "A17"] and score[lignee == "HM013"]
## t = 0.62639, df = 18, p-value = 0.5389
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.883192 3.483192
## sample estimates:
## mean of x mean of y
## 56.4 55.6
t.test(score[lignee=="HM008"],score[lignee=="HM013"],var.equal=T)
##
## Two Sample t-test
##
## data: score[lignee == "HM008"] and score[lignee == "HM013"]
## t = -1.3525, df = 18, p-value = 0.193
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -5.106714 1.106714
## sample estimates:
## mean of x mean of y
## 53.6 55.6
t.test(score[lignee=="A17"],score[lignee=="HM008"],var.equal=T)
##
## Two Sample t-test
##
## data: score[lignee == "A17"] and score[lignee == "HM008"]
## t = 2.1924, df = 18, p-value = 0.04174
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.1168082 5.4831918
## sample estimates:
## mean of x mean of y
## 56.4 53.6
# le test nécessite de charger la librairie laercio
library(laercio)
LDuncan(res,conf.level = 0.99)
##
## DUNCAN TEST TO COMPARE MEANS
##
## Confidence Level: 0.99
## Dependent Variable: score
## Variation Coefficient: 5.439099 %
##
##
## Independent Variable: lignee
## Factors Means
## DZA45 61.6 a
## A17 56.4 b
## HM013 55.6 b
## HM008 53.6 b
A completer chez vous!