0% found this document useful (0 votes)
64 views2 pages

Uji Bartlett Materi 11 Latihan

The document describes performing Bartlett's test of homogeneity of variances on different datasets grouped into variables to test if the variances are equal. Bartlett's test is run on four different examples with multiple groups of data and the output of each test is displayed, including the test statistic, degrees of freedom, and p-value.

Uploaded by

Nur Halimah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views2 pages

Uji Bartlett Materi 11 Latihan

The document describes performing Bartlett's test of homogeneity of variances on different datasets grouped into variables to test if the variances are equal. Bartlett's test is run on four different examples with multiple groups of data and the output of each test is displayed, including the test statistic, degrees of freedom, and p-value.

Uploaded by

Nur Halimah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

R version 4.3.

1 (2023-06-16) -- "Beagle Scouts"


Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

During startup - Warning messages:


1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_MONETARY failed, using "C"
[R.app GUI 1.79 (8238) x86_64-apple-darwin20]

WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work.
Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system preferences accordingly.
[Workspace restored from /Users/admin/.RData]
[History restored from /Users/admin/.Rapp.history]

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


> x2<-c(29, 27, 24, 26, 25, 26, 27)
> x3<-c(33, 32, 29, 27, 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 27 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 = 6.6608, df = 2, p-value = 0.03578

> 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

2023-10-17 10:50:18.055 R[1995:62684] allowedContentsTypes : UTType pdf does not have a valid preferredFilenameExtension and will be ignored when validating the file name
>

You might also like