Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Dilan Vergara.

Actividad 21-11-2014

BANANAS
> #tratamiento empaques
> pok<-c(14.1,9.4,9.3,10.9,6.3);pok
[1] 14.1

9.4

9.3 10.9

6.3

> pol<-c(10.0,7.1,14.2,14.8,18.9);pol
[1] 10.0

7.1 14.2 14.8 18.9

> saco<-c(18.3,17.5,14.4,16.2,23.1);saco
[1] 18.3 17.5 14.4 16.2 23.1
> nada<-c(21,18,17.3,16.8,21.9)nada
nada<-c(21,18,17.3,16.8,21.9)nada
> spaq<-c(21.0,18.0,17.3,16.8,21.9);spaq
[1] 21.0 18.0 17.3 16.8 21.9
> resp<-c(pok,pol,saco,spaq)
> mean(resp)
20

[1] 14.975

> sd(resp)

15
10

[1] 23.48092

resp

> var(resp)

[1] 4.845712
> boxplot(resp)

3
trat

> trat<-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4);trat
[1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
> datos<-data.frame(trat,resp);datos
trat resp

1 14.1

9.4

9.3

1 10.9

2 10.0

2 14.2

2 14.8

10

2 18.9

11

3 18.3

12

3 17.5

13

3 14.4

14

3 16.2

15

3 23.1

16

4 21.0

17

4 18.0

18

4 17.3

19

4 16.8

20

4 21.9

6.3

7.1

> tapply(resp,trat,summary)
$`1`
Min. 1st Qu.
6.3

Median

9.3

9.4

Min. 1st Qu.

Median

Mean 3rd Qu.

Max.

10.0

10.9

14.1

Mean 3rd Qu.

Max.

$`2`

7.1

10.0

14.2

Min. 1st Qu.

Median

13.0

14.8

18.9

Mean 3rd Qu.

Max.

17.9

18.3

23.1

Mean 3rd Qu.

Max.

19.0

21.9

$`3`

14.4

16.2

17.5

Min. 1st Qu.

Median

$`4`

16.8

17.3

18.0

21.0

> tapply(resp,trat,var)
1

8.040 20.825 10.625

5.285

> tapply(resp,trat,mean)
1

10.0 13.0 17.9 19.0


> t.test(pok,mu=15)

One Sample t-test

data:

pok

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

> t.test(pol,mu=15)

One Sample t-test

data:

pol

t = -0.98, 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

> t.test(saco,mu=15)

One Sample t-test

data:

saco

t = 1.9894, df = 4, p-value = 0.1175


alternative hypothesis: true mean is not equal to 15
95 percent confidence interval:
13.85267 21.94733
sample estimates:
mean of x
17.9

> t.test(spaq,mu=15)

One Sample t-test

data:

spaq

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

> #analisis de varianza


> trat<-factor(trat)
> mod<-aov(resp~trat,data=datos);mod
Call:
aov(formula = resp ~ trat, data = datos)

Terms:
trat Residuals
Sum of Squares
Deg. of Freedom

254.4025

191.7350

18

Residual standard error: 3.263732


Estimated effects may be unbalanced

> anova(mod)
Analysis of Variance Table

Response: resp
Df Sum Sq Mean Sq F value
trat

1 254.40 254.403

Residuals 18 191.74

Pr(>F)

23.883 0.0001186 ***

10.652

--Signif. codes:

0 *** 0.001 ** 0.01 * 0.05 . 0.1 1

> #boxplot de los tratamientos


> plot(resp~trat)
>
>
> #Kruskal Wallis
> comparacion<-kruskal(resp,trat,group=TRUE, main="Empaques")

Study: Empaques
Kruskal-Wallis test's
Ties or no Ties

Value: 11.48
degrees of freedom: 3
Pvalue chisq

trat,

: 0.00939431

means of the ranks

resp replication

4.2

8.4

3 14.0

4 15.4

t-Student: 2.119905
Alpha

: 0.05

LSD

: 5.437877

Means with the same letter are not significantly different

Groups, Treatments and mean of the ranks


a

15.4

14

8.4

4.2

You might also like