Vous êtes sur la page 1sur 27

Trabajo de diseo experimental

Universidad de sucre
Facultad: Educacin y ciencias
Programa: Biologa
Docente: Melba Morrison
Estudiante: Neider Lozano Cabrales

> #ejercicio ejemplo


> #datos
> pokmno2<-c(14.1,9.4,9.3,10.9,6.3);pokmno2
[1] 14.1 9.4 9.3 10.9 6.3
> po<-c(10.0,7.1,14.2,14.8,18.9);po
[1] 10.0 7.1 14.2 14.8 18.9
> saco<-c(18.3,17.5,14.9,16.2,23.1);saco
[1] 18.3 17.5 14.9 16.2 23.1
> nada<-c(21.0,18.0,17.3,16.8,21.9);nada
[1] 21.0 18.0 17.3 16.8 21.9
> resp<-c(pokmno2,po,saco,nada);resp
[1] 14.1 9.4 9.3 10.9 6.3 10.0 7.1 14.2 14.8 18.9 18.3 17.5 14.9 16.2 23.1
[16] 21.0 18.0 17.3 16.8 21.9
> trat<-gl(4,5,labels =c("pokmno2","po","saco","nada"))
> #analisis de varianzamodelo#analisis de varianza
> modelo<-aov(resp~trat)
> anova(modelo)
Analysis of Variance Table
> #resumen numerico
> tapply(resp,trat,mean)
pokmno2
10

po
13

saco
18

19

> tapply(resp,trat,var)

nada

pokmno2

po

saco

nada

8.040 20.825 9.800 5.285


> tapply(resp,trat,sum)
pokmno2
50

po
65

saco
90

nada

95

> tapply(resp,trat,length)
pokmno2
5

po
5

saco

nada

> tapply(resp,trat,t.test,mu> tapply(resp,trat,t.test,mu=15)


$pokmno2

One Sample t-test

data: X[[i]]
t = -3.943, df = 4, p-value = 0.01692
alternative hypothesis: true mean is not equal to 15
95 percent confidence interval:
6.479275 13.520725
sample estimates:
mean of x
10

$po

One Sample t-test

data: X[[i]]
t = -0.97999, df = 4, p-value = 0.3826
alternative hypothesis: true mean is not equal to 15

95 percent confidence interval:


7.333739 18.666261
sample estimates:
mean of x
13
$saco

One Sample t-test


data: X[[i]]
t = 2.1429, df = 4, p-value = 0.09877
alternative hypothesis: true mean is not equal to 15
95 percent confidence interval:
14.11298 21.88702
sample estimates:
mean of x
18
$nada
One Sample t-test
data: X[[i]]
t = 3.8907, df = 4, p-value = 0.01768
alternative hypothesis: true mean is not equal to 15
95 percent confidence interval:
16.14552 21.85448
sample estimates:
mean of x
19

20
15
10

pokmno2

po

> # aplicacion 1
> #datos
> T45<-c(1.39,1.19,1.01,0.99);T45
[1] 1.39 1.19 1.01 0.99
> T90<-c(1.19,0.91,1.15,1.05);T90
[1] 1.19 0.91 1.15 1.05
> T135<-c(1.10,1.18,1.14,1.34);T135
[1] 1.10 1.18 1.14 1.34
> T180<-c(1.07,1.25,0.85,1.23);T180
[1] 1.07 1.25 0.85 1.23
> T225<-c(1.03,1.40,0.97,1.20);T225
[1] 1.03 1.40 0.97 1.20
> T270<-c(1.03,1.12,1.17,1.36);T270

saco

nada

[1] 1.03 1.12 1.17 1.36


> resp<-c(T45,T90,T135,T180,T225,T270);resp
[1] 1.39 1.19 1.01 0.99 1.19 0.91 1.15 1.05 1.10 1.18 1.14 1.34 1.07 1.25 0.85
[16] 1.23 1.03 1.40 0.97 1.20 1.03 1.12 1.17 1.36
trat<-gl(6,4,labels =c("T45","T190","T135","T180","T225","T270"))
> #analisis de varianza
> modelo<-aov(resp~trat)
> anova(modelo)
Analysis of Variance Table
Response: resp
Df Sum Sq Mean Sq F value Pr(>F)
trat

5 0.03733 0.0074667 0.2941 0.9099

Residuals 18 0.45700 0.0253889


> #resumen numerico
> tapply(resp,trat,mean)
T45 T190 T135 T180 T225 T270
1.145 1.075 1.190 1.100 1.150 1.170
> tapply(resp,trat,var)
T45

T190

T135

T180

T225

T270

0.03476667 0.01556667 0.01106667 0.03426667 0.03726667 0.01940000


> tapply(resp,trat,sum)
T45 T190 T135 T180 T225 T270
4.58 4.30 4.76 4.40 4.60 4.68
> tapply(resp,trat,length)
T45 T190 T135 T180 T225 T270
4

> mean(resp)
[1] 1.138333
> tapply(resp,trat,t.test,ma=1.138333)
$T45

One Sample t-test


data: X[[i]]
t = 12.282, df = 3, p-value = 0.001163
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.8483034 1.4416966
sample estimates:
mean of x
1.145
$T190
One Sample t-test
data: X[[i]]
t = 17.232, df = 3, p-value = 0.0004258
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.8764687 1.2735313
sample estimates:
mean of x
1.075
$T135
One Sample t-test
data: X[[i]]
t = 22.624, df = 3, p-value = 0.0001891
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
1.022606 1.357394
sample estimates:
mean of x
1.19
$T180

One Sample t-test


data: X[[i]]
t = 11.885, df = 3, p-value = 0.001281
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.8054446 1.3945554
sample estimates:
mean of x
1.1
$T225
One Sample t-test
data: X[[i]]
t = 11.914, df = 3, p-value = 0.001272
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.8428211 1.4571789
sample estimates:
mean of x
1.15
$T270

One Sample t-test

data: X[[i]]
t = 16.8, df = 3, p-value = 0.0004592
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.9483683 1.3916317
sample estimates:

mean of x
1.17
> #prueba de normalidad
> shapiro.test(resp)
Shapiro-Wilk normality test
data: resp
W = 0.97638, p-value = 0.821
> #prueba de homogeneidad de varianza
> bartlett.test(resp~trat)
Bartlett test of homogeneity of variances
data: resp by trat
Bartlett's K-squared = 1.5685, df = 5, p-value = 0.905

0.9

1.0

1.1

1.2

1.3

1.4

> boxplot(resp~trat)

T45

T190

T135

T180

T225

T270

> # Aplicacin 2
># Datos

> Ticopor<-c(5.33,4.95,5.10,7.14,7.84);Ticopor
[1] 5.33 4.95 5.10 7.14 7.84

> t.test(Ticopor,mu=5.05)

One Sample t-test

data: Ticopor
t = 1.7249, df = 4, p-value = 0.1596
alternative hypothesis: true mean is not equal to 5.05
95 percent confidence interval:
4.427008 7.716992
sample estimates:
mean of x
6.072

> Tbiopak<-c(6.59,7.90,4.48,7.32,6.41);Tbiopak
[1] 6.59 7.90 4.48 7.32 6.41
> t.test(Tbiopak,mu=5.05)

One Sample t-test

data: Tbiopak
t = 2.5703, df = 4, p-value = 0.06196
alternative hypothesis: true mean is not equal to 5.05
95 percent confidence interval:
4.9305 8.1495
sample estimates:
mean of x
6.54

> TCryvac<-c(4.95,4.44,3.48,3.92,8.62);TCryvac
[1] 4.95 4.44 3.48 3.92 8.62

> t.test(TCryvac,mu=5.05)

One Sample t-test

data: TCryvac
t = 0.0348, df = 4, p-value = 0.9739
alternative hypothesis: true mean is not equal to 5.05
95 percent confidence interval:
2.532528 7.631472
sample estimates:
mean of x
5.082

> TShopak<-c(2.41,2.83,2.97,2.38,2.11);TShopak
[1] 2.41 2.83 2.97 2.38 2.11
> t.test(TShopak,mu=5.05)

One Sample t-test

data: TShopak
t = -15.9321, df = 4, p-value = 9.073e-05
alternative hypothesis: true mean is not equal to 5.05
95 percent confidence interval:
2.102589 2.977411
sample estimates:
mean of x
2.54

> resp<-c(Ticopor,Tbiopak,TCryvac,TShopak);resp
[1] 5.33 4.95 5.10 7.14 7.84 6.59 7.90 4.48 7.32 6.41 4.95 4.44 3.48 3.92

[15] 8.62 2.41 2.83 2.97 2.38 2.11


> trat<-gl(4,5,labels=c("Ticopor","Tbiopak","TCryvac","TShopar"))
> repet<-c(1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5);repet
[1] 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
> datos<-data.frame(repet,trat,resp);datos
repet

trat resp

1 Ticopor 5.33

2 Ticopor 4.95

3 Ticopor 5.10

4 Ticopor 7.14

5 Ticopor 7.84

1 Tbiopak 6.59

2 Tbiopak 7.90

3 Tbiopak 4.48

4 Tbiopak 7.32

10

5 Tbiopak 6.41

11

1 TCryvac 4.95

12

2 TCryvac 4.44

13

3 TCryvac 3.48

14

4 TCryvac 3.92

15

5 TCryvac 8.62

16

1 TShopar 2.41

17

2 TShopar 2.83

18

3 TShopar 2.97

19

4 TShopar 2.38

20

5 TShopar 2.11

> tapply(resp,trat,length)
Ticopor Tbiopak TCryvac TShopar
5

> tapply(resp,trat,sum)

Ticopor Tbiopak TCryvac TShopar


30.36 32.70 25.41 12.70
> tapply(resp,trat,mean)
Ticopor Tbiopak TCryvac TShopar
6.072 6.540 5.082 2.540
> tapply(resp,trat,var)
Ticopor Tbiopak TCryvac TShopar
1.75517 1.68025 4.21592 0.12410
> shapiro.test(resp)

Shapiro-Wilk normality test

data: resp
W = 0.9463, p-value = 0.3139

> bartlett.test(resp~trat)

Bartlett test of homogeneity of variances

data: resp by trat


Bartlett's K-squared = 8.0604, df = 3, p-value = 0.04478

> modelo<-aov(resp~trat)
> anova(modelo)
Analysis of Variance Table

Response: resp
Df Sum Sq Mean Sq F value Pr(>F)
trat

3 47.827 15.9424 8.2014 0.001564 **

Residuals 16 31.102 1.9439

--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1

2.8

3.0

3.2

3.4

boxplot(resp~trat)

H1

H2

H3

> #aplicacin 3
>#datos
> RC<-c(4,2,5,2,2,1,2,3,2,4);RC
[1] 4 2 5 2 2 1 2 3 2 4
> t.test(RC,mu=2.7)
One Sample t-test
data: RC
t = 0, df = 9, p-value = 1
alternative hypothesis: true mean is not equal to 2.7

H4

95 percent confidence interval:


1.804612 3.595388
sample estimates:
mean of x
2.7
> BSN<-c(10,10,12,11,10,12,14,12,14,11);BSN
[1] 10 10 12 11 10 12 14 12 14 11
> t.test(BSN,mu=11.6)
One Sample t-test
data: BSN
t = 0, df = 9, p-value = 1
alternative hypothesis: true mean is not equal to 11.6
95 percent confidence interval:
10.523 12.677
sample estimates:
mean of x
11.6

> PP<-c(1,1,2,3,1,1,2,2,3);PP
[1] 1 1 2 3 1 1 2 2 3
> t.test(PP,mu=1.7)
One Sample t-test
data: PP
t = 0.28, df = 8, p-value = 0.7866
alternative hypothesis: true mean is not equal to 1.7
95 percent confidence interval:
1.137221 2.418334
sample estimates:
mean of x
1.777778

> BSA<-c(8,9,9,5,7,8,7,4,12,9);BSA
[1] 8 9 9 5 7 8 7 4 12 9
> t.test(BSA,mu=7.8)
One Sample t-test
data: BSA
t = 0, df = 9, p-value = 1
alternative hypothesis: true mean is not equal to 7.8
95 percent confidence interval:
6.189785 9.410215
sample estimates:
mean of x
7.8
> resp<-c(RC,BSN,PP,BSA);resp
[1] 4 2 5 2 2 1 2 3 2 4 10 10 12 11 10 12 14 12 14 11 1 1 2 3
[25] 1 1 2 2 3 8 9 9 5 7 8 7 4 12 9
> trat<-gl(4,10,labels=c("RC","BSN","PP","BSA"))
> trat<-rep(1:4,c(10,10,9,10));trat
[1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4
[38] 4 4
> trat<-factor(trat,labels=c("RC","BSN","PP","BSA"));trat
[1] RC RC RC RC RC RC RC RC RC RC BSN BSN BSN BSN BSN BSN BSN
BSN
[19] BSN BSN PP PP PP PP PP PP PP PP PP BSA BSA BSA BSA BSA BSA BSA
[37] BSA BSA BSA
Levels: RC BSN PP BSA
> split(resp,trat)
$RC
[1] 4 2 5 2 2 1 2 3 2 4

$BSN
[1] 10 10 12 11 10 12 14 12 14 11

$PP
[1] 1 1 2 3 1 1 2 2 3

$BSA
[1] 8 9 9 5 7 8 7 4 12 9

> repet<c(1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,10)
;repet
[1] 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4
[25] 5 6 7 8 9 1 2 3 4 5 6 7 8 9 10
> datos<-data.frame(repet,trat,resp);datos
repet trat resp
1

1 RC

2 RC

3 RC

4 RC

5 RC

6 RC

7 RC

8 RC

9 RC

10

10 RC

11

1 BSN 10

12

2 BSN 10

13

3 BSN 12

14

4 BSN 11

15

5 BSN 10

16

6 BSN 12

17

7 BSN 14

18

8 BSN 12

19

9 BSN 14

20

10 BSN 11

21

1 PP

22

2 PP

23

3 PP

24

4 PP

25

5 PP

26

6 PP

27

7 PP

28

8 PP

29

9 PP

30

1 BSA

31

2 BSA

32

3 BSA

33

4 BSA

34

5 BSA

35

6 BSA

36

7 BSA

37

8 BSA

38

9 BSA 12

39

10 BSA

> #Resumen numerico por tratamiento#


> tapply(resp,trat,length)
RC BSN PP BSA
10 10 9 10
> tapply(resp,trat,sum)

RC BSN PP BSA
27 116 16 78
> tapply(resp,trat,mean)
RC

BSN

PP

BSA

2.700000 11.600000 1.777778 7.800000


> tapply(resp,trat,var)
RC

BSN

PP

BSA

1.5666667 2.2666667 0.6944444 5.0666667


> shapiro.test(resp)
Shapiro-Wilk normality test
data: resp
W = 0.8872, p-value = 0.0009666
> #Analisis de varianza#
> modelo<-aov(resp~trat)
> anova(modelo)
Analysis of Variance Table
Response: resp
Df Sum Sq Mean Sq F value
trat

Pr(>F)

3 615.11 205.038 83.781 4.809e-16 ***

Residuals 35 85.66 2.447


--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> boxplot(resp~trat,horizontal=TRUE,main="poblacion de aves")

RC

BSN

PP

BSA

poblacion de aves

10

12

14

> #Aplicacin 4
>datos
>
fondoarenoso<c(4.09,4.14,3.85,4.04,3.21,4.27,3.81,4.02,3.08,4.72,4.03,4.07,3.
83);fondoarenoso
[1] 4.09 4.14 3.85 4.04 3.21 4.27 3.81 4.02 3.08 4.72 4.03 4.07 3.83
>manglar<c(3.80,3.96,4.05,3.47,3.89,3.46,3.94,3.58,4.03,3.68,3.76,3.91,3.32,
4.21,3.86,4.02);manglar
[1] 3.80 3.96 4.05 3.47 3.89 3.46 3.94 3.58 4.03 3.68 3.76 3.91 3.32 4.21 3.86
[16] 4.02
>pastomarino<c(3.78,4.19,4.27,3.65,3.99,3.61,3.55,3.41,3.82,4.11,3.60,3.90,3
.99,3.94,3.35);pastomarino

[1] 3.78 4.19 4.27 3.65 3.99 3.61 3.55 3.41 3.82 4.11 3.60 3.90 3.99 3.94 3.35
> resp<-c(fondoarenoso,manglar,pastomarino);resp
[1] 4.09 4.14 3.85 4.04 3.21 4.27 3.81 4.02 3.08 4.72 4.03 4.07 3.83 3.80 3.96
[16] 4.05 3.47 3.89 3.46 3.94 3.58 4.03 3.68 3.76 3.91 3.32 4.21 3.86 4.02
3.78
[31] 4.19 4.27 3.65 3.99 3.61 3.55 3.41 3.82 4.11 3.60 3.90 3.99 3.94 3.35
> trat<c(1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,
3,3,3)
> trat<-factor(trat)
> #ANALISIS DE VARIANZA
> modelo<-aov(resp~trat)
> anova(modelo)
Analysis of Variance Table
Response: resp
Df Sum Sq Mean Sq F value Pr(>F)
trat

2 0.1448 0.072382 0.7177 0.4939

Residuals 41 4.1352 0.100858


> #resumen numerico
> tapply(resp,trat,mean)
1

3.935385 3.808750 3.810667


> tapply(resp,trat,var)
1

0.17754359 0.06126500 0.07754952


> tapply(resp,trat,sum)
1

51.16 60.94 57.16


> tapply(resp,trat,length)
1 2 3
13 16 15

> tapply(resp,trat,t.test,mu=3.84)
$`1`
One Sample t-test

data: X[[i]]
t = 0.8162, df = 12, p-value = 0.4303
alternative hypothesis: true mean is not equal to 3.84
95 percent confidence interval:
3.680760 4.190009
sample estimates:
mean of x
3.935385
$`2`
One Sample t-test
data: X[[i]]
t = -0.50501, df = 15, p-value = 0.6209
alternative hypothesis: true mean is not equal to 3.84
95 percent confidence interval:
3.676857 3.940643
sample estimates:
mean of x
3.80875
$`3`
One Sample t-test
data: X[[i]]
t = -0.40796, df = 14, p-value = 0.6895
alternative hypothesis: true mean is not equal to 3.84
95 percent confidence interval:
3.656451 3.964882
sample estimates:

mean of x
3.810667
> mean(resp)
[1] 3.846818
> shapiro.test(resp)
Shapiro-Wilk normality test
data: resp
W = 0.97206, p-value = 0.3571
> bartlett.test(resp~trat)
Bartlett test of homogeneity of variances
data: resp by trat
Bartlett's K-squared = 4.2319, df = 2, p-value = 0.1205
> boxplot(resp~trat,horizontal=TRUE,main="longitud estandar de las sardinas
azulitas")

longitud estandar de las sardinas azulitas

3.5

4.0

> #Aplicacin 5
> h1<-c(3.28,3.52,2.88,3.34);h1
[1] 3.28 3.52 2.88 3.34
> h2<-c(3.09,3.48,2.80,3.38);h2
[1] 3.09 3.48 2.80 3.38

4.5

> h3<-c(3.03,3.38,2.81,3.23);h3
[1] 3.03 3.38 2.81 3.23
> h4<-c(3.03,3.38,2.76,3.26);h4
[1] 3.03 3.38 2.76 3.26
> resp<-c(h1,h2,h3,h4);resp
[1] 3.28 3.52 2.88 3.34 3.09 3.48 2.80 3.38 3.03 3.38 2.81 3.23 3.03 3.38 2.76
[16] 3.26
> trat<-gl(4,4,labels=c("h1","h2","h3","h4"))
> #analisis de varianza
> modelo<-aov(resp~trat)
> anova(modelo)
Analysis of Variance Table

Response: resp
Df Sum Sq Mean Sq F value Pr(>F)
trat

3 0.05867 0.019556 0.2582 0.8541

Residuals 12 0.90893 0.075744


> #Resumen numerico
> tapply(resp,trat,mean)
h1

h2

h3

h4

3.2550 3.1875 3.1125 3.1075


> tapply(resp,trat,var)
h1

h2

h3

h4

0.07290000 0.09409167 0.06122500 0.07475833


> tapply(resp,trat,sum)
h1

h2

h3

h4

13.02 12.75 12.45 12.43


> tapply(resp,trat,length)
h1 h2 h3 h4
4 4 4 4

> tapply(resp,trat,t.test,mu=3.16)
$h1

One Sample t-test

data: X[[i]]
t = 0.7037, df = 3, p-value = 0.5323
alternative hypothesis: true mean is not equal to 3.16
95 percent confidence interval:
2.82537 3.68463
sample estimates:
mean of x
3.255

$h2

One Sample t-test

data: X[[i]]
t = 0.1793, df = 3, p-value = 0.8691
alternative hypothesis: true mean is not equal to 3.16
95 percent confidence interval:
2.699402 3.675598
sample estimates:
mean of x
3.1875

$h3

One Sample t-test

data: X[[i]]
t = -0.38394, df = 3, p-value = 0.7266
alternative hypothesis: true mean is not equal to 3.16
95 percent confidence interval:
2.718773 3.506227
sample estimates:
mean of x
3.1125

$h4

One Sample t-test

data: X[[i]]
t = -0.38402, df = 3, p-value = 0.7266
alternative hypothesis: true mean is not equal to 3.16
95 percent confidence interval:
2.672428 3.542572
sample estimates:
mean of x
3.1075

> mean(resp)
[1] 3.165625
> #prueba de normalidad

> shapiro.test(resp)

Shapiro-Wilk normality test

data: resp
W = 0.9177, p-value = 0.1549

> #prueba de homogeneidad de varizanzas


> bartlett.test(resp~trat)

Bartlett test of homogeneity of variances

data: resp by trat


Bartlett's K-squared = 0.12446, df = 3, p-value = 0.9887

> boxplot(resp~trat,horizontal=TRUE,main="lectura dehojas")

h1

h2

h3

h4

lectura dehojas

2.8

3.0

3.2

3.4

Vous aimerez peut-être aussi