Mengaktifkan Packages yang Dibutuhkan

library(readxl)
## Warning: package 'readxl' was built under R version 4.4.3
library(MVN)
## Warning: package 'MVN' was built under R version 4.4.3
library(MVTests)
## Warning: package 'MVTests' was built under R version 4.4.3
## 
## Attaching package: 'MVTests'
## The following object is masked from 'package:datasets':
## 
##     iris
library(profileR)
## Warning: package 'profileR' was built under R version 4.4.3
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.4.3
## Loading required package: RColorBrewer
## Loading required package: reshape
## Warning: package 'reshape' was built under R version 4.4.3
## Loading required package: lavaan
## Warning: package 'lavaan' was built under R version 4.4.3
## This is lavaan 0.6-20
## lavaan is FREE software! Please report any bugs.

Input Data dari File Excel

data <- read_excel("C:/Users/rahmadilla/Documents/AnMul/data teaching methods.xlsx", sheet="Sheet1")
View(data)

Mengubah Variabel Dependen Menjadi Format Matriks

y1 <- as.matrix(data$EnglishScore, nrow=42, ncol=1)
y2 <- as.matrix(data$MathScore, nrow=42, ncol=1)
y3 <- as.matrix(data$ChemistryScore, nrow=42, ncol=1)
y4 <- as.matrix(data$PhysicsScore, nrow=42, ncol=1)
y5 <- as.matrix(data$BiologyScore, nrow=42, ncol=1)

Mengubah Variabel Independen Menjadi Format Matriks

perlakuan <- as.matrix(data$TeachingMethod, nrow=42, ncol=1)

Menggabungkan Semua Variabel Menjadi Satu Data Frame

datafix = data.frame(perlakuan,y1,y2,y3,y4,y5)
datafix
##                     perlakuan y1 y2 y3 y4 y5
## 1  Differentiated Instruction 85 88 90 87 89
## 2  Differentiated Instruction 87 90 92 89 91
## 3  Differentiated Instruction 89 85 88 86 88
## 4  Differentiated Instruction 84 87 85 88 87
## 5  Differentiated Instruction 88 89 90 90 89
## 6  Differentiated Instruction 90 92 91 91 92
## 7  Differentiated Instruction 85 86 87 85 86
## 8  Differentiated Instruction 87 88 89 87 88
## 9  Differentiated Instruction 88 85 86 88 87
## 10 Differentiated Instruction 86 87 88 86 89
## 11 Differentiated Instruction 89 88 90 89 90
## 12 Differentiated Instruction 87 89 91 87 88
## 13 Differentiated Instruction 85 90 92 90 91
## 14 Differentiated Instruction 88 87 89 86 87
## 15  Lecture-based Instruction 78 75 77 76 78
## 16  Lecture-based Instruction 76 77 79 75 77
## 17  Lecture-based Instruction 80 78 80 77 79
## 18  Lecture-based Instruction 77 76 78 76 78
## 19  Lecture-based Instruction 79 77 76 78 77
## 20  Lecture-based Instruction 75 79 77 75 76
## 21  Lecture-based Instruction 78 78 79 76 77
## 22  Lecture-based Instruction 80 75 78 77 78
## 23  Lecture-based Instruction 77 76 75 78 77
## 24  Lecture-based Instruction 79 78 76 75 78
## 25  Lecture-based Instruction 78 77 79 76 77
## 26  Lecture-based Instruction 76 78 77 75 78
## 27  Lecture-based Instruction 80 76 78 77 76
## 28  Lecture-based Instruction 77 75 79 76 78
## 29  Technology-based Learning 82 85 83 84 86
## 30  Technology-based Learning 84 87 85 83 85
## 31  Technology-based Learning 81 82 80 81 83
## 32  Technology-based Learning 83 86 84 85 84
## 33  Technology-based Learning 85 88 86 87 86
## 34  Technology-based Learning 86 89 87 88 87
## 35  Technology-based Learning 82 84 85 83 84
## 36  Technology-based Learning 83 85 84 86 83
## 37  Technology-based Learning 84 87 86 85 85
## 38  Technology-based Learning 85 88 87 87 86
## 39  Technology-based Learning 86 86 85 88 85
## 40  Technology-based Learning 82 87 84 85 86
## 41  Technology-based Learning 83 88 86 87 85
## 42  Technology-based Learning 84 89 87 88 86

Mengecek Ketersediaan Fungsi mvn

exists("mvn", where = "package:MVN")
## [1] TRUE

Uji Normalitas Multivariat

norm.test = mvn(data = datafix, subset = "perlakuan", mvn_test = "mardia")
norm.test$multivariate_normality
##                        Group            Test Statistic p.value      MVN
## 1 Differentiated Instruction Mardia Skewness    41.490   0.209 ✓ Normal
## 2 Differentiated Instruction Mardia Kurtosis    -0.732   0.464 ✓ Normal
## 3  Lecture-based Instruction Mardia Skewness    45.791   0.105 ✓ Normal
## 4  Lecture-based Instruction Mardia Kurtosis    -0.517   0.605 ✓ Normal
## 5  Technology-based Learning Mardia Skewness    47.765   0.074 ✓ Normal
## 6  Technology-based Learning Mardia Kurtosis    -0.442   0.658 ✓ Normal

Uji Homogenitas Matriks Ragam Peragam

ujiboxm <- BoxM(data = datafix[,2:6], datafix$perlakuan)
summary(ujiboxm)
##        Box's M Test 
## 
## Chi-Squared Value = 42.95087 , df = 30  and p-value: 0.0592

Membangun Model MANOVA

ujimanova <- manova(cbind(y1,y2,y3,y4,y5) ~ perlakuan, data=datafix)

Pengujian MANOVA dengan Berbagai Statistik Uji

summary(ujimanova, test="Pillai")
##           Df Pillai approx F num Df den Df   Pr(>F)    
## perlakuan  2 1.4367   18.366     10     72 3.92e-16 ***
## Residuals 39                                           
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(ujimanova, test="Roy")
##           Df    Roy approx F num Df den Df    Pr(>F)    
## perlakuan  2 15.238   109.71      5     36 < 2.2e-16 ***
## Residuals 39                                            
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(ujimanova, test="Wilks")
##           Df    Wilks approx F num Df den Df    Pr(>F)    
## perlakuan  2 0.030896   32.824     10     70 < 2.2e-16 ***
## Residuals 39                                              
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(ujimanova, test="Hotelling-Lawley")
##           Df Hotelling-Lawley approx F num Df den Df    Pr(>F)    
## perlakuan  2           16.231   55.186     10     68 < 2.2e-16 ***
## Residuals 39                                                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pengujian ANOVA Setiap Variabel

summary.aov(ujimanova)
##  Response y1 :
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## perlakuan    2 597.33 298.667  108.71 < 2.2e-16 ***
## Residuals   39 107.14   2.747                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response y2 :
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## perlakuan    2 1029.33  514.67  160.85 < 2.2e-16 ***
## Residuals   39  124.79    3.20                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response y3 :
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## perlakuan    2 935.29  467.64  136.61 < 2.2e-16 ***
## Residuals   39 133.50    3.42                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response y4 :
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## perlakuan    2 1051.62  525.81  173.47 < 2.2e-16 ***
## Residuals   39  118.21    3.03                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response y5 :
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## perlakuan    2 928.90  464.45   261.7 < 2.2e-16 ***
## Residuals   39  69.21    1.77                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Plot Analisis Profil

profil <- pbg(datafix[,2:6], datafix[,1], profile.plot = TRUE)

Uji Analisis Profil

summary(profil)
## Call:
## pbg(data = datafix[, 2:6], group = datafix[, 1], profile.plot = TRUE)
## 
## Hypothesis Tests:
## $`Ho: Profiles are parallel`
##   Multivariate.Test Statistic  Approx.F num.df den.df      p.value
## 1             Wilks 0.3199533  6.911063      8     72 1.029239e-06
## 2            Pillai 0.8464523  6.787481      8     74 1.199769e-06
## 3  Hotelling-Lawley 1.6053625  7.023461      8     70 9.132202e-07
## 4               Roy 1.1551069 10.684739      4     37 7.394009e-06
## 
## $`Ho: Profiles have equal levels`
##             Df Sum Sq Mean Sq F value Pr(>F)    
## group        2  890.2   445.1   259.7 <2e-16 ***
## Residuals   39   66.8     1.7                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## $`Ho: Profiles are flat`
##          F df1 df2     p-value
## 1 3.931507   4  36 0.009500572