You are on page 1of 9

Tugas Mata Kuliah Analisis Multivariat Evan Susandi

Nama

: Evan Susandi

NPM

: 140720130003

Tugas Analisis Multivariat


1. MANOVA
2. MULTIVARIAT REGRESSION

1. Sebuah percobaan untuk membandingkan dua metode mengajar fisika yang berbeda yang
dilakukan pada Morning (pagi), Afternoon (siang), dan Evening (malam) menggunakan
pendekatan kuliah Traditional dan Discovery. Tabel berikut menyajikan nilai skor yang
diperoleh dari bidang mechanical (M), heat (H), the sound (S) untuk 24 siswa dalam
penelitian ini.

a. Menganalisis data, pengujian untuk (1) efek dari faktor, (2) pengaruh waktu, dan (3) efek
interaksi. Sertakan dalam analisis Anda tes kesetaraan matriks varians-kovarians dan
normalitas.
Analisis MANOVA dengan menggunakan R software:
#INPUT DATA VARIABEL DEPENDEN
M<-c(30,26,32,31,41,44,40,42,30,32,29,28,51,44,52,50,57,68,58,62,52,50,
50,53)
H<-c(131,126,134,137,104,105,102,102,74,71,69,67,140,145,141,142,120,
130,125,150,91,89,90,95)
S<-c(34,28,33,31,36,31,33,27,35,30,27,29,36,37,30,33,31,35,34,39,33,28,
28,41)
#INPUT DATA VARIABEL FAKTOR
METHOD<-factor(gl(2,12), labels=c("Traditional", "Discovery"))
TIME<-factor(gl(3, 4, len=24), labels=c("Morning", "Afternoon","Evening"))
D<-data.frame(M,H,S,METHOD,TIME)

Tugas Mata Kuliah Analisis Multivariat Evan Susandi


D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

M
30
26
32
31
41
44
40
42
30
32
29
28
51
44
52
50
57
68
58
62
52
50
50
53

H
131
126
134
137
104
105
102
102
74
71
69
67
140
145
141
142
120
130
125
150
91
89
90
95

S
34
28
33
31
36
31
33
27
35
30
27
29
36
37
30
33
31
35
34
39
33
28
28
41

METHOD
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Traditional
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery
Discovery

TIME
Morning
Morning
Morning
Morning
Afternoon
Afternoon
Afternoon
Afternoon
Evening
Evening
Evening
Evening
Morning
Morning
Morning
Morning
Afternoon
Afternoon
Afternoon
Afternoon
Evening
Evening
Evening
Evening

#MEMBUAT MATRIKS VARIABEL DEPENDEN


Y<-cbind(M,H,S)
Y
M
H S
[1,] 30 131 34
[2,] 26 126 28
[3,] 32 134 33
[4,] 31 137 31
[5,] 41 104 36
[6,] 44 105 31
[7,] 40 102 33
[8,] 42 102 27
[9,] 30 74 35
[10,] 32 71 30
[11,] 29 69 27
[12,] 28 67 29
[13,] 51 140 36
[14,] 44 145 37
[15,] 52 141 30
[16,] 50 142 33
[17,] 57 120 31
[18,] 68 130 35
[19,] 58 125 34
[20,] 62 150 39
[21,] 52 91 33
[22,] 50 89 28
[23,] 50 90 28
[24,] 53 95 41
#TABEL MANOVA
manova(Y~METHOD*TIME)
Call:
manova(Y ~ METHOD * TIME)

Tugas Mata Kuliah Analisis Multivariat Evan Susandi

Terms:
resp
resp
resp
Deg.

1
2
3
of Freedom

METHOD
TIME METHOD:TIME Residuals
2440.167
709.333
5.333
158.500
2320.667 13030.333
329.333
653.000
40.042
15.083
0.583
274.250
1
2
2
18

Residual standard error: 2.9674166.0231043.903346


Estimated effects may be unbalanced
#UJI MANOVA
summary(manova(Y~METHOD*TIME))
Df Pillai approx F num Df den Df
Pr(>F)
METHOD
1 0.94237
87.206
3
16 3.958e-10 ***
TIME
2 1.78667
47.459
6
34 4.141e-15 ***
METHOD:TIME 2 0.46699
1.726
6
34
0.1449
Residuals
18
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
summary(manova(Y~METHOD*TIME),test="W")
Df
Wilks approx F num Df den Df
Pr(>F)
METHOD
1 0.05763
87.206
3
16 3.958e-10 ***
TIME
2 0.00585
64.385
6
32 < 2.2e-16 ***
METHOD:TIME 2 0.54903
1.864
6
32
0.1178
Residuals
18
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
summary(manova(Y~METHOD*TIME),test="H")
Df Hotelling-Lawley approx F num Df den Df
Pr(>F)
METHOD
1
16.351
87.206
3
16 3.958e-10 ***
TIME
2
34.455
86.136
6
30 < 2.2e-16 ***
METHOD:TIME 2
0.792
1.981
6
30
0.09997 .
Residuals
18
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
summary(manova(Y~METHOD*TIME),test="R")
Df
Roy approx F num Df den Df
Pr(>F)
METHOD
1 16.3510
87.206
3
16 3.958e-10 ***
TIME
2 29.9296 169.601
3
17 7.262e-13 ***
METHOD:TIME 2 0.7535
4.270
3
17
0.02027 *
Residuals
18
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
#Profile Plots
interaction.plot(TIME,METHOD,M)
interaction.plot(TIME,METHOD,H)
interaction.plot(TIME,METHOD,S)

140

60

Tugas Mata Kuliah Analisis Multivariat Evan Susandi

METHOD

METHOD

130

Discovery
Traditional

110

mean of H

100

45

70

30

80

35

90

40

mean of M

50

120

55

Discovery
Traditional

Morning

Afternoon

Evening

Morning

Afternoon

TIME

METHOD

31

32

mean of S

33

34

Discovery
Traditional

Morning

Afternoon

Evening
TIME

Evening
TIME

#UJI NORMAL MULTIVARIAT


library(mvnormtest)
C <- t(D[1:3])
mshapiro.test(C)
Shapiro-Wilk normality test
data: Z
W = 0.956, p-value = 0.3642
#GRAFIK NORMAL MULTIVARIAT
center <- colMeans(Y) # centroid
n <- nrow(Y); p <- ncol(Y); cov <- cov(Y);
d <- mahalanobis(Y,center,cov) # distances
qqplot(qchisq(ppoints(n),df=p),d,
+
main="QQ Plot Assessing Multivariate Normality",
+
ylab="Mahalanobis D2")
abline(a=0,b=1)

Tugas Mata Kuliah Analisis Multivariat Evan Susandi

4
0

Mahalanobis D2

QQ Plot Assessing Multivariate Normality

10

qchisq(ppoints(n), df = p)

b. Tidak mungkin dilakukan trend analysis, karena tidak terdapat autocorrelation antar waktu.
c. Multivariat Analisis Varians dilakukan untuk membandingkan dua metode mengajar fisika
yang berbeda yang dilakukan pada Morning (pagi), Afternoon (siang), dan Evening
(malam) menggunakan pendekatan kuliah Traditional dan Discovery. Dengan melakukan
uji asumsi yaitu uji normalitas multivariate dan homogeneity of variances dan covariance.
Terdapat perbedaan yang signifikan dua metode mengajar fisika menggunakan pendekatan
kuliah Traditional dan Discovery terhadap nilai skor yang diperoleh dari bidang
mechanical (M), heat (H), the sound (S) untuk 24 siswa dalam penelitian ini,
F(3,16)=87.206, p<0.001. Dan juga terdapat perbedaan yang signifikan mengajar yang
dilakukan pada Morning (pagi), Afternoon (siang), dan Evening (malam);
F(6,32)=47.459, p<0.001. Tetapi interaksi antara kedua faktor tidak mempengaruhi variabel
dependennya.
2. Multivariat Regresi

PPVT<-c(68,82,82,91,82,100,100,96,63,91,87,105,87,76,66,74,68,98,63,94,82,
89,80,64,102,71,102,96,55,96,74,78)
RPMT<-c(15,11,13,18,13,15,13,12,10,18,10,21,14,16,14,15,13,16,15,16,18,
15,19,11,20,12,16,13,16,18,15,19)
SAT<-c(24,8,88,82,90,77,58,14,1,98,8,88,4,14,38,4,64,88,14,99,50,36,88,14,
24,24,24,50,8,98,98,50)

Tugas Mata Kuliah Analisis Multivariat Evan Susandi

Gr<-c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
N<-c(0,7,7,6,20,4,6,5,3,16,5,2,1,11,0,5,1,1,0,4,4,1,5,4,5,9,4,5,4,4,2,5)
S<-c(10,3,9,11,7,11,7,2,5,12,3,11,4,5,0,8,6,9,13,6,5,6,8,5,7,4,17,8,7,
7,6,10)
NS<-c(8,21,17,16,21,18,17,11,14,16,17,10,14,18,3,11,19,12,13,14,16,15,14,
11,17,8,21,20,19,10,14,18)
NT<-c(21,28,31,27,28,32,26,22,24,27,25,26,25,27,16,12,28,30,19,27,21,23,
25,16,26,16,27,28,20,23,25,27)
SS<-c(22,21,30,25,16,29,23,23,20,30,24,22,19,22,11,15,23,18,16,19,24,28,
24,22,15,14,31,26,13,19,17,26)
D<-data.frame(PPVT,RPMT,SAT,Gr,N,S,NS,NT,SS)
D
PPVT RPMT SAT Gr N S NS NT SS
1
68
15 24 1 0 10 8 21 22
2
82
11
8 1 7 3 21 28 21
3
82
13 88 1 7 9 17 31 30
4
91
18 82 1 6 11 16 27 25
5
82
13 90 1 20 7 21 28 16
6
100
15 77 1 4 11 18 32 29
7
100
13 58 1 6 7 17 26 23
8
96
12 14 1 5 2 11 22 23
9
63
10
1 1 3 5 14 24 20
10
91
18 98 1 16 12 16 27 30
11
87
10
8 1 5 3 17 25 24
12 105
21 88 1 2 11 10 26 22
13
87
14
4 1 1 4 14 25 19
14
76
16 14 1 11 5 18 27 22
15
66
14 38 1 0 0 3 16 11
16
74
15
4 1 5 8 11 12 15
17
68
13 64 1 1 6 19 28 23
18
98
16 88 1 1 9 12 30 18
19
63
15 14 1 0 13 13 19 16
20
94
16 99 1 4 6 14 27 19
21
82
18 50 1 4 5 16 21 24
22
89
15 36 1 1 6 15 23 28
23
80
19 88 1 5 8 14 25 24
24
64
11 14 1 4 5 11 16 22
25 102
20 24 1 5 7 17 26 15
26
71
12 24 1 9 4 8 16 14
27 102
16 24 1 4 17 21 27 31
28
96
13 50 1 5 8 20 28 26
29
55
16
8 1 4 7 19 20 13
30
96
18 98 1 4 7 10 23 19
31
74
15 98 1 2 6 14 25 17
32
78
19 50 1 5 10 18 27 26

a. R2y1,y3 ~ x1+x2+x3
# Multivariat Linear Regression
fit_a <- lm(cbind(PPVT,SAT)~Gr+N+S, data=D)
summary(fit_a) # show results
Response PPVT :
Call:
lm(formula = PPVT ~ Gr + N + S, data = D)

Tugas Mata Kuliah Analisis Multivariat Evan Susandi

Residuals:
Min
1Q
-27.6164 -8.7124

Median
0.2078

3Q
12.0739

Max
19.0511

Coefficients: (1 not defined because of


Estimate Std. Error t value
(Intercept) 73.4419
6.1473 11.947
Gr
NA
NA
NA
N
0.3325
0.5669
0.587
S
1.1207
0.6976
1.606
--Signif. codes: 0 *** 0.001 ** 0.01

singularities)
Pr(>|t|)
1.01e-12 ***
NA
0.562
0.119
* 0.05 . 0.1 1

Residual standard error: 13.59 on 29 degrees of freedom


Multiple R-squared: 0.09405,
Adjusted R-squared: 0.03157
F-statistic: 1.505 on 2 and 29 DF, p-value: 0.2388
Response SAT :
Call:
lm(formula = SAT ~ Gr + N + S, data = D)
Residuals:
Min
1Q
-51.997 -26.904

Median
-0.661

3Q
22.414

Max
59.123

Coefficients: (1 not defined because of singularities)


Estimate Std. Error t value Pr(>|t|)
(Intercept)
17.064
15.309
1.115
0.2742
Gr
NA
NA
NA
NA
N
1.723
1.412
1.220
0.2322
S
3.061
1.737
1.762
0.0886 .
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Residual standard error: 33.83 on 29 degrees of freedom
Multiple R-squared: 0.1417,
Adjusted R-squared: 0.08248
F-statistic: 2.393 on 2 and 29 DF, p-value: 0.1091

b. R2y1,y2 ~ x1+x3+x4
fit_b <- lm(cbind(PPVT,RPMT)~Gr+S+NS, data=D)
summary(fit_a) # show results
Response PPVT :
Call:
lm(formula = PPVT ~ Gr + N + S, data = D)
Residuals:
Min
1Q
-27.6164 -8.7124

Median
0.2078

3Q
12.0739

Max
19.0511

Coefficients: (1 not defined because of singularities)


Estimate Std. Error t value Pr(>|t|)
(Intercept) 73.4419
6.1473 11.947 1.01e-12 ***
Gr
NA
NA
NA
NA
N
0.3325
0.5669
0.587
0.562
S
1.1207
0.6976
1.606
0.119
---

Tugas Mata Kuliah Analisis Multivariat Evan Susandi


Signif. codes:

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

Residual standard error: 13.59 on 29 degrees of freedom


Multiple R-squared: 0.09405,
Adjusted R-squared: 0.03157
F-statistic: 1.505 on 2 and 29 DF, p-value: 0.2388
Response SAT :
Call:
lm(formula = SAT ~ Gr + N + S, data = D)
Residuals:
Min
1Q
-51.997 -26.904

Median
-0.661

3Q
22.414

Max
59.123

Coefficients: (1 not defined because of singularities)


Estimate Std. Error t value Pr(>|t|)
(Intercept)
17.064
15.309
1.115
0.2742
Gr
NA
NA
NA
NA
N
1.723
1.412
1.220
0.2322
S
3.061
1.737
1.762
0.0886 .
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Residual standard error: 33.83 on 29 degrees of freedom
Multiple R-squared: 0.1417,
Adjusted R-squared: 0.08248
F-statistic: 2.393 on 2 and 29 DF, p-value: 0.1091

c. R2y1,y3 ~ x1+x2+x3+x4+x5+x6
fit_c <- lm(cbind(PPVT,SAT)~Gr+N+S+NS+NT+SS, data=D)
summary(fit_a) # show results
Response PPVT :
Call:
lm(formula = PPVT ~ Gr + N + S, data = D)
Residuals:
Min
1Q
-27.6164 -8.7124

Median
0.2078

3Q
12.0739

Max
19.0511

Coefficients: (1 not defined because of


Estimate Std. Error t value
(Intercept) 73.4419
6.1473 11.947
Gr
NA
NA
NA
N
0.3325
0.5669
0.587
S
1.1207
0.6976
1.606
--Signif. codes: 0 *** 0.001 ** 0.01

singularities)
Pr(>|t|)
1.01e-12 ***
NA
0.562
0.119
* 0.05 . 0.1 1

Residual standard error: 13.59 on 29 degrees of freedom


Multiple R-squared: 0.09405,
Adjusted R-squared: 0.03157
F-statistic: 1.505 on 2 and 29 DF, p-value: 0.2388
Response SAT :
Call:
lm(formula = SAT ~ Gr + N + S, data = D)
Residuals:

Tugas Mata Kuliah Analisis Multivariat Evan Susandi


Min
1Q
-51.997 -26.904

Median
-0.661

3Q
22.414

Max
59.123

Coefficients: (1 not defined because of singularities)


Estimate Std. Error t value Pr(>|t|)
(Intercept)
17.064
15.309
1.115
0.2742
Gr
NA
NA
NA
NA
N
1.723
1.412
1.220
0.2322
S
3.061
1.737
1.762
0.0886 .
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Residual standard error: 33.83 on 29 degrees of freedom
Multiple R-squared: 0.1417,
Adjusted R-squared: 0.08248
F-statistic: 2.393 on 2 and 29 DF, p-value: 0.1091

You might also like