Está en la página 1de 5

pr.

R
Pc

Wed Jan 25 21:51:27 2017


TdS <- rep(rep(1:2,each=8),3)
TdS <- factor(TdS,labels=c("TdS1","TdS2"))
EV <- rep(1:3,each=16)
EV <- factor(EV,labels=c("EV1","EV2","EV3"))

Crecimiento<-
c(7,22,15,26,20,23,28,36,62,38,45,70,42,60,30,36,202,180,215,190,195,186,
184,172,150,126,129,112,134,142,136,144,73,76,81,70,115,77,112,98,46,38,4
3,52,49,72,70,62)
Inv <- data.frame(TdS,EV,Crecimiento)
rm(TdS,EV,Crecimiento)
attach(Inv)

#interacciones
interaction.plot(TdS,EV,Crecimiento)
interaction.plot(EV,TdS,Crecimiento)

#ANOVA
a<-lm(Crecimiento~TdS*EV)
anva<-aov(a)
summary(anva)

## Df Sum Sq Mean Sq F value Pr(>F)


## TdS 1 5526 5526 30.50 1.93e-06 ***
## EV 2 137900 68950 380.53 < 2e-16 ***
## TdS:EV 2 14396 7198 39.72 2.07e-10 ***
## Residuals 42 7610 181
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

#comparacion de medias Tukey


library(agricolae)

HSD.test(anva,"TdS",group=T,console=TRUE)

##
## Study: anva ~ "TdS"
##
## HSD Test for Crecimiento
##
## Mean Square Error: 181.1935
##
## TdS, means
##
## Crecimiento std r Min Max
## TdS1 100.12500 72.02072 24 7 215
## TdS2 78.66667 42.01725 24 30 150
##
## alpha: 0.05 ; Df Error: 42
## Critical Value of Studentized Range: 2.853999
##
## Honestly Significant Difference: 7.841865
##
## Means with the same letter are not significantly different.
##
## Groups, Treatments and means
## a TdS1 100.1
## b TdS2 78.67

HSD.test(anva,c("TdS","EV"),group=T,console=TRUE)

##
## Study: anva ~ c("TdS", "EV")
##
## HSD Test for Crecimiento
##
## Mean Square Error: 181.1935
##
## TdS:EV, means
##
## Crecimiento std r Min Max
## TdS1:EV1 22.125 8.675705 8 7 36
## TdS1:EV2 190.500 13.458932 8 172 215
## TdS1:EV3 87.750 17.998016 8 70 115
## TdS2:EV1 47.875 14.327172 8 30 70
## TdS2:EV2 134.125 11.933596 8 112 150
## TdS2:EV3 54.000 12.615184 8 38 72
##
## alpha: 0.05 ; Df Error: 42
## Critical Value of Studentized Range: 4.221779
##
## Honestly Significant Difference: 20.09194
##
## Means with the same letter are not significantly different.
##
## Groups, Treatments and means
## a TdS1:EV2 190.5
## b TdS2:EV2 134.1
## c TdS1:EV3 87.75
## d TdS2:EV3 54
## d TdS2:EV1 47.88
## e TdS1:EV1 22.12
#Supuestos
plot(a)

También podría gustarte