• Tidak ada hasil yang ditemukan

Data Summary for "datakanonik.xlsx" using R

N/A
N/A
20 - Ishmah Noer Choolisah Arif

Academic year: 2024

Membagikan " Data Summary for "datakanonik.xlsx" using R"

Copied!
4
0
0

Teks penuh

(1)

> library(readxl)

> library(car)

> library(CCA)

> library(candisc)

Loading required package: heplots Loading required package: broom Attaching package: ‘candisc’

The following object is masked from ‘package:stats’:

cancor

> data <- read_excel("datakanonik.xlsx")

> summary(data)

Y1 Y2 Y3 Y4 Y5 X1

Min. : 65.0 Min. : 510 Min. : 0.00 Min. : 6.0 Min. : 1.00 Min. : 12.00

1st Qu.:143.5 1st Qu.: 928 1st Qu.: 38.75 1st Qu.: 28.5 1st Qu.: 3.00 1st Qu.: 29.50 Median :211.0 Median :1349 Median : 73.50 Median : 96.5 Median : 9.50 Median : 47.50

Mean :264.7 Mean :1532 Mean :114.00 Mean :113.1 Mean : 16.08 Mean : 47.83

3rd Qu.:313.5 3rd Qu.:1634 3rd Qu.:155.50 3rd Qu.:161.0 3rd Qu.: 16.75 3rd Qu.:

59.25

Max. :888.0 Max. :5203 Max. :578.00 Max. :457.0 Max. :138.00 Max. :123.00 X2 X3

Min. :10.00 Min. : 8.00 1st Qu.:16.75 1st Qu.:16.75 Median :22.50 Median :24.50 Mean :25.46 Mean :27.67 3rd Qu.:30.00 3rd Qu.:34.00 Max. :64.00 Max. :64.00

> X <- (data[,1:5])

> Y <- (data[,6:8])

> dataCCA <- cbind(Y,X)

> CCA <- as.matrix(dataCCA)

> rata2 <- colMeans(CCA)

> n <- nrow(dataCCA)

> p <- ncol(dataCCA)

> kovarian <- cov(CCA)

> d <- mahalanobis(CCA,rata2,kovarian)

> qqplot(qchisq(ppoints(n),df=p),d, xlim=c(1,20),pch=20,col="black", + ylim=c(0, 30),main="QQ-Plot Data", ylab="Jarak Mahalanobis")

> abline(a=0,b=1,col="red")

> model=lm(Y1+Y2+Y3+Y4+Y5~X1+X2+X3,data=dataCCA)

> vif(model)

X1 X2 X3

1.510482 2.950806 2.558688

> korelasi <- matcor(X, Y)

> print(korelasi)

$Xcor

Y1 Y2 Y3 Y4 Y5

Y1 1.0000000 0.5396499 0.7159781 0.2882816 0.5960664 Y2 0.5396499 1.0000000 0.2575132 0.3143730 0.8092408 Y3 0.7159781 0.2575132 1.0000000 0.4051420 0.2354192

(2)

Y4 0.2882816 0.3143730 0.4051420 1.0000000 0.3155242 Y5 0.5960664 0.8092408 0.2354192 0.3155242 1.0000000

$Ycor

X1 X2 X3

X1 1.0000000 0.5791205 0.4832472 X2 0.5791205 1.0000000 0.7795204 X3 0.4832472 0.7795204 1.0000000

$XYcor

Y1 Y2 Y3 Y4 Y5 X1 X2 X3

Y1 1.0000000 0.5396499 0.7159781 0.2882816 0.5960664 0.5856479 0.7178298 0.5375613

Y2 0.5396499 1.0000000 0.2575132 0.3143730 0.8092408 0.2985924 0.5489339 0.4345682

Y3 0.7159781 0.2575132 1.0000000 0.4051420 0.2354192 0.2315573 0.4858632 0.2708149

Y4 0.2882816 0.3143730 0.4051420 1.0000000 0.3155242 0.1423312 0.3939374 0.4092346

Y5 0.5960664 0.8092408 0.2354192 0.3155242 1.0000000 0.3689140 0.6537535 0.4997001

X1 0.5856479 0.2985924 0.2315573 0.1423312 0.3689140 1.0000000 0.5791205 0.4832472

X2 0.7178298 0.5489339 0.4858632 0.3939374 0.6537535 0.5791205 1.0000000 0.7795204

X3 0.5375613 0.4345682 0.2708149 0.4092346 0.4997001 0.4832472 0.7795204 1.0000000

> img.matcor(korelasi, type=2)

> analisis <- candisc::cancor(X,Y)

> summary(analisis)

Canonical correlation analysis of:

5 X variables: Y1, Y2, Y3, Y4, Y5 with 3 Y variables: X1, X2, X3

CanR CanRSQ Eigen percent cum scree

1 0.7954 0.63258 1.7217 80.463 80.46 ******************************

2 0.4897 0.23976 0.3154 14.739 95.20 *****

3 0.3051 0.09311 0.1027 4.798 100.00 **

Test of H0: The canonical correlations in the current row and all that follow are zero

CanR LR test stat approx F numDF denDF Pr(> F) 1 0.79535 0.25332 1.91487 15 44.57 0.04759 * 2 0.48965 0.68946 0.86842 8 34.00 0.55202 3 0.30514 0.90689 0.61600 3 18.00 0.61351 ---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Raw canonical coefficients

X variables:

Xcan1 Xcan2 Xcan3

(3)

Y1 -4.0841e-03 -8.2260e-03 -0.0016459 Y2 7.8961e-05 5.1029e-05 0.0002600 Y3 1.1874e-03 1.2070e-02 -0.0037115 Y4 -1.7914e-03 -2.6658e-03 0.0086697 Y5 -1.2633e-02 3.4341e-02 -0.0022221 Y variables:

Ycan1 Ycan2 Ycan3

X1 -0.0093331 -0.039276 -0.025936 X2 -0.0644868 0.108298 -0.048554 X3 -0.0019821 -0.055750 0.098150

> hasil <- cc(X,Y)

> plot(hasil$cor,type="b")

> hasil$cor

[1] 0.7953504 0.4896528 0.3051361

> hasil$xcoef

[,1] [,2] [,3]

Y1 -4.084071e-03 -8.225976e-03 -0.0016458793 Y2 7.896097e-05 5.102865e-05 0.0002599966 Y3 1.187422e-03 1.207023e-02 -0.0037115439 Y4 -1.791388e-03 -2.665799e-03 0.0086697020 Y5 -1.263297e-02 3.434097e-02 -0.0022221024

> hasil$ycoef

[,1] [,2] [,3]

X1 -0.009333094 -0.03927584 -0.02593574 X2 -0.064486769 0.10829757 -0.04855435 X3 -0.001982099 -0.05575015 0.09814991

> hasil$scores

$xscores

[,1] [,2] [,3]

[1,] 0.9340792 0.84959615 -0.79072712 [2,] -2.0385283 0.24169856 -2.31599465 [3,] 0.6784625 -0.62209133 0.24343649 [4,] 0.2739619 -0.60135207 0.08971677 [5,] 0.7566707 0.62066107 0.71560416 [6,] -0.7652235 1.60904901 2.20942739 [7,] 0.3043312 -0.19636217 -0.42455603 [8,] -0.4253247 0.11330384 2.03476002 [9,] -0.3271384 -1.25438233 1.10863586 [10,] 0.6006510 -0.50097226 -0.51318714 [11,] -0.4148288 -1.09622087 -0.70754686 [12,] 0.1405033 0.27953574 0.14459784 [13,] -0.7618419 -0.11414626 -0.22225701 [14,] -0.1898865 -1.67924073 0.22002598 [15,] -0.1309194 -1.88206852 -0.50169983 [16,] 0.2895659 -0.72647515 1.32533055 [17,] 0.5765901 -0.01677423 -0.50754546 [18,] 1.1189861 1.76156742 -0.65043674 [19,] 0.7264865 1.68138994 -0.96998641 [20,] 0.1234639 -0.68993446 -0.13938513 [21,] 0.6808177 -0.13784059 -0.70210689 [22,] -3.3593234 1.08455922 0.02553784 [23,] 0.5006042 0.74288830 0.84277514 [24,] 0.7078408 0.53361168 -0.51441877

(4)

$yscores

[,1] [,2] [,3]

[1,] 0.99380722 0.38485872 0.05534032 [2,] -1.42956356 0.96102095 -0.45206138 [3,] 0.35573796 0.35742492 -0.80325481 [4,] -0.02839086 -0.16666722 0.54471478 [5,] -0.46140679 2.18710232 -0.18137755 [6,] -0.40934758 1.45679674 -0.84328593 [7,] 0.53498881 0.40102019 2.20964665 [8,] -1.08682653 -1.15474258 2.51524811 [9,] -0.35168718 -0.81483589 0.97117215 [10,] 0.03188182 0.27620944 -0.66233704 [11,] -1.74803630 -2.51419581 -0.51210349 [12,] 0.57292343 -0.05686189 0.78288167 [13,] 0.47337871 -0.76062430 0.16829295 [14,] -0.11294851 0.04680342 0.02575358 [15,] 0.57949682 -1.35905723 -2.05589861 [16,] 1.22798669 0.08909477 0.62513177 [17,] -0.27132603 0.32929578 -0.56769771 [18,] 1.33575213 0.30515099 0.48297932 [19,] 0.39108823 0.45877813 -0.60136196 [20,] 0.60716133 -0.48249070 0.20209762 [21,] 0.41086679 1.06431184 0.23318641 [22,] -2.97444697 0.72539670 -0.18966774 [23,] 0.88606662 -0.68565784 -0.81632985 [24,] 0.47284374 -1.04813143 -1.13106925

$corr.X.xscores

[,1] [,2] [,3]

Y1 -0.9351888 -0.05131952 -0.2777144 Y2 -0.6711181 0.22952094 0.2196279 Y3 -0.5801530 0.45400903 -0.2531046 Y4 -0.4634341 0.15545861 0.7580257 Y5 -0.8026378 0.27480794 0.1512506

$corr.Y.xscores

[,1] [,2] [,3]

X1 -0.5786750 -0.28894644 -0.10676056 X2 -0.7798014 0.08761879 0.02497243 X3 -0.6226831 -0.09912212 0.17950768

$corr.X.yscores

[,1] [,2] [,3]

Y1 -0.7438028 -0.02512875 -0.08474070 Y2 -0.5337741 0.11238557 0.06701639 Y3 -0.4614250 0.22230680 -0.07723136 Y4 -0.3685925 0.07612074 0.23130102 Y5 -0.6383783 0.13456048 0.04615203

$corr.Y.yscores

[,1] [,2] [,3]

X1 -0.7275723 -0.5901047 -0.34987850 X2 -0.9804501 0.1789407 0.08184029 X3 -0.7829041 -0.2024335 0.58828723

Referensi

Dokumen terkait

Smart Anti–Abduct System (Theme Park) Using Radio Frequency Identification (RFID) is data based system that using a Visual Studio 2006 script as the programming language

At this stage the process is carried out using the PHP program where the sorting of the data is sorted using the PHP programming language which provides a sort function to sort

For our first step, we’ll perform some transformations on the raw input data using the code shown below in an Azure ML Execute R Script module:.. ## This file contains the code for

Our system expresses the data insights with separate categories like summary text, graphical response view which contains chart visuals and document related visuals differentiated by

This paper surveys and classifies data mining articles using the following eight categories – publication year, citation, document type, country/ter- ritory, institute name, language,

The document explores various aspects of Python programming, including data manipulation, functions, input handling, and string

This document contains the data of a sample doped D2O, including the selective band center and width of different

This document presents a new approach for predicting student performance in a blended learning environment using learning management system interaction