You are on page 1of 6

> x1<-c(30,27,28,26,29,27,29)

> x2<-c(29,27,24,26,25,26,27)
> x3<-c(33,32,29,37,30,38,35)
> data<-c(x1,x2,x3)
> grup<-c(rep("x1",7),rep("x2",7),rep("x3",7))
> datagrup=data.frame(data,grup)
> ujiBartlett<-bartlett.test(data~grup)
> datagrup
data grup
1 30 x1
2 27 x1
3 28 x1
4 26 x1
5 29 x1
6 27 x1
7 29 x1
8 29 x2
9 27 x2
10 24 x2
11 26 x2
12 25 x2
13 26 x2
14 27 x2
15 33 x3
16 32 x3
17 29 x3
18 37 x3
19 30 x3
20 38 x3
21 35 x3
> ujiBartlett

Bartlett test of homogeneity of variances

data: data by grup


Bartlett's K-squared = 5.4029, df = 2, p-value = 0.06711
> x1<-c(5,4,5,4,5,3,4,3,5)
> x2<-c(8,8,9,6,9,8,7,8,7)
> x3<-c(7,8,8,9,8,8,9,8,9)
> data<-c(x1,x2,x3)
> grup<-c(rep("x1",9),rep("x2",9),rep("x3",9))
> datagrup=data.frame(data,grup)
> ujiBartlett<-bartlett.test(data~grup)
> datagrup
data grup
1 5 x1
2 4 x1
3 5 x1
4 4 x1
5 5 x1
6 3 x1
7 4 x1
8 3 x1
9 5 x1
10 8 x2
11 8 x2
12 9 x2
13 6 x2
14 9 x2
15 8 x2
16 7 x2
17 8 x2
18 7 x2
19 7 x3
20 8 x3
21 8 x3
22 9 x3
23 8 x3
24 8 x3
25 9 x3
26 8 x3
27 9 x3
> ujiBartlett

Bartlett test of homogeneity of variances

data: data by grup


Bartlett's K-squared = 1.052, df = 2, p-value = 0.591
> x1<-c(11,7,8,14,11,10,5)
> x2<-c(4,8,6,11,9,8)
> x3<-c(4,3,2,2,3,6)
> x4<-c(7,7,5,4,3,4,4,4)
> data<-c(x1,x2,x3,x4)
> grup<-c(rep("x1",7),rep("x2",6),rep("x3",6),rep("x4",8))
> datagrup=data.frame(data,grup)
> ujiBartlett<-bartlett.test(data~grup)
> datagrup
data grup
1 11 x1
2 7 x1
3 8 x1
4 14 x1
5 11 x1
6 10 x1
7 5 x1
8 4 x2
9 8 x2
10 6 x2
11 11 x2
12 9 x2
13 8 x2
14 4 x3
15 3 x3
16 2 x3
17 2 x3
18 3 x3
19 6 x3
20 7 x4
21 7 x4
22 5 x4
23 4 x4
24 3 x4
25 4 x4
26 4 x4
27 4 x4
> ujiBartlett

Bartlett test of homogeneity of variances

data: data by grup


Bartlett's K-squared = 4.0184, df = 3, p-value = 0.2595

You might also like