Persiapan dan Pembacaan Data

library(readr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(psych)

dataset_raw = read.csv(
  "dataset_Facebook.csv",
  sep = ";",
  header = TRUE
)

str(dataset_raw)
## 'data.frame':    500 obs. of  19 variables:
##  $ Page.total.likes                                                   : int  139441 139441 139441 139441 139441 139441 139441 139441 139441 139441 ...
##  $ Type                                                               : chr  "Photo" "Status" "Photo" "Photo" ...
##  $ Category                                                           : int  2 2 3 2 2 2 3 3 2 3 ...
##  $ Post.Month                                                         : int  12 12 12 12 12 12 12 12 12 12 ...
##  $ Post.Weekday                                                       : int  4 3 3 2 2 1 1 7 7 6 ...
##  $ Post.Hour                                                          : int  3 10 3 10 3 9 3 9 3 10 ...
##  $ Paid                                                               : int  0 0 0 1 0 0 1 1 0 0 ...
##  $ Lifetime.Post.Total.Reach                                          : int  2752 10460 2413 50128 7244 10472 11692 13720 11844 4694 ...
##  $ Lifetime.Post.Total.Impressions                                    : int  5091 19057 4373 87991 13594 20849 19479 24137 22538 8668 ...
##  $ Lifetime.Engaged.Users                                             : int  178 1457 177 2211 671 1191 481 537 1530 280 ...
##  $ Lifetime.Post.Consumers                                            : int  109 1361 113 790 410 1073 265 232 1407 183 ...
##  $ Lifetime.Post.Consumptions                                         : int  159 1674 154 1119 580 1389 364 305 1692 250 ...
##  $ Lifetime.Post.Impressions.by.people.who.have.liked.your.Page       : int  3078 11710 2812 61027 6228 16034 15432 19728 15220 4309 ...
##  $ Lifetime.Post.reach.by.people.who.like.your.Page                   : int  1640 6112 1503 32048 3200 7852 9328 11056 7912 2324 ...
##  $ Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post: int  119 1108 132 1386 396 1016 379 422 1250 199 ...
##  $ comment                                                            : int  4 5 0 58 19 1 3 0 0 3 ...
##  $ like                                                               : int  79 130 66 1572 325 152 249 325 161 113 ...
##  $ share                                                              : int  17 29 14 147 49 33 27 14 31 26 ...
##  $ Total.Interactions                                                 : int  100 164 80 1777 393 186 279 339 192 142 ...

Fungsi dplyr digunakan untuk pengolahan data, sedangkan psych digunakan untuk analisis multivariat seperti uji KMO, Bartlett, dan Factor Analysis. Fungsi str() digunakan untuk melihat struktur data awal, termasuk tipe variabel dan jumlah observasi.

Seleksi Variabel Kuantitatif

kolom_num = dataset_raw %>%
  select(
    Page.total.likes,
    Lifetime.Post.Total.Reach,
    Lifetime.Post.Total.Impressions,
    Lifetime.Engaged.Users,
    Lifetime.Post.Consumers,
    Lifetime.Post.Consumptions,
    Lifetime.Post.Impressions.by.people.who.have.liked.your.Page,
    Lifetime.Post.reach.by.people.who.like.your.Page,
    Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post,
    Total.Interactions
  )

sum(is.na(kolom_num))
## [1] 0
kolom_num = na.omit(kolom_num)
summary(kolom_num)
##  Page.total.likes Lifetime.Post.Total.Reach Lifetime.Post.Total.Impressions
##  Min.   : 81370   Min.   :   238            Min.   :    570                
##  1st Qu.:112676   1st Qu.:  3315            1st Qu.:   5695                
##  Median :129600   Median :  5281            Median :   9051                
##  Mean   :123194   Mean   : 13903            Mean   :  29586                
##  3rd Qu.:136393   3rd Qu.: 13168            3rd Qu.:  22086                
##  Max.   :139441   Max.   :180480            Max.   :1110282                
##  Lifetime.Engaged.Users Lifetime.Post.Consumers Lifetime.Post.Consumptions
##  Min.   :    9.0        Min.   :    9.0         Min.   :    9.0           
##  1st Qu.:  393.8        1st Qu.:  332.5         1st Qu.:  509.2           
##  Median :  625.5        Median :  551.5         Median :  851.0           
##  Mean   :  920.3        Mean   :  798.8         Mean   : 1415.1           
##  3rd Qu.: 1062.0        3rd Qu.:  955.5         3rd Qu.: 1463.0           
##  Max.   :11452.0        Max.   :11328.0         Max.   :19779.0           
##  Lifetime.Post.Impressions.by.people.who.have.liked.your.Page
##  Min.   :    567                                             
##  1st Qu.:   3970                                             
##  Median :   6256                                             
##  Mean   :  16766                                             
##  3rd Qu.:  14860                                             
##  Max.   :1107833                                             
##  Lifetime.Post.reach.by.people.who.like.your.Page
##  Min.   :  236                                   
##  1st Qu.: 2182                                   
##  Median : 3417                                   
##  Mean   : 6585                                   
##  3rd Qu.: 7989                                   
##  Max.   :51456                                   
##  Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post
##  Min.   :   9.0                                                     
##  1st Qu.: 291.0                                                     
##  Median : 412.0                                                     
##  Mean   : 610.0                                                     
##  3rd Qu.: 656.2                                                     
##  Max.   :4376.0                                                     
##  Total.Interactions
##  Min.   :   0.0    
##  1st Qu.:  71.0    
##  Median : 123.5    
##  Mean   : 212.1    
##  3rd Qu.: 228.5    
##  Max.   :6334.0

Pada tahap ini dipilih sepuluh variabel kuantitatif yang merepresentasikan kinerja interaksi konten Facebook, meliputi jangkauan, impresi, dan keterlibatan pengguna. Selanjutnya dilakukan pengecekan nilai hilang (missing values) dan penghapusan observasi yang mengandung nilai kosong. Statistik deskriptif ditampilkan untuk memberikan gambaran awal mengenai sebaran data masing-masing variabel.

Boxplot Kinerja Interaksi Konten Facebook

kolom_log = log10(kolom_num + 1)

boxplot(
  kolom_log,
  las = 2,
  main = "Boxplot Variabel Kinerja Interaksi Konten Facebook (Transformasi Log)",
  ylab = "Log10(Nilai Variabel)"
)

Visualisasi boxplot dilakukan setelah transformasi logaritma untuk menyeimbangkan skala antar variabel serta mengurangi kemencengan distribusi data. Boxplot digunakan untuk melihat pola sebaran data, variasi antar variabel, serta keberadaan nilai pencilan (outlier).

Uji Asumsi Analisis Multivariat

mat_corr = cor(kolom_num)
mat_corr
##                                                                     Page.total.likes
## Page.total.likes                                                          1.00000000
## Lifetime.Post.Total.Reach                                                -0.08324456
## Lifetime.Post.Total.Impressions                                          -0.10254034
## Lifetime.Engaged.Users                                                   -0.11192182
## Lifetime.Post.Consumers                                                  -0.14912886
## Lifetime.Post.Consumptions                                               -0.12824001
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page             -0.09610873
## Lifetime.Post.reach.by.people.who.like.your.Page                         -0.06051633
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post       0.03369900
## Total.Interactions                                                        0.04523052
##                                                                     Lifetime.Post.Total.Reach
## Page.total.likes                                                                  -0.08324456
## Lifetime.Post.Total.Reach                                                          1.00000000
## Lifetime.Post.Total.Impressions                                                    0.69492632
## Lifetime.Engaged.Users                                                             0.57062857
## Lifetime.Post.Consumers                                                            0.47790805
## Lifetime.Post.Consumptions                                                         0.32436208
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                       0.32225432
## Lifetime.Post.reach.by.people.who.like.your.Page                                   0.74305292
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post                0.40075580
## Total.Interactions                                                                 0.53859744
##                                                                     Lifetime.Post.Total.Impressions
## Page.total.likes                                                                         -0.1025403
## Lifetime.Post.Total.Reach                                                                 0.6949263
## Lifetime.Post.Total.Impressions                                                           1.0000000
## Lifetime.Engaged.Users                                                                    0.3685533
## Lifetime.Post.Consumers                                                                   0.3152011
## Lifetime.Post.Consumptions                                                                0.2260813
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                              0.8507872
## Lifetime.Post.reach.by.people.who.like.your.Page                                          0.6519332
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post                       0.3238426
## Total.Interactions                                                                        0.3433581
##                                                                     Lifetime.Engaged.Users
## Page.total.likes                                                                -0.1119218
## Lifetime.Post.Total.Reach                                                        0.5706286
## Lifetime.Post.Total.Impressions                                                  0.3685533
## Lifetime.Engaged.Users                                                           1.0000000
## Lifetime.Post.Consumers                                                          0.9682131
## Lifetime.Post.Consumptions                                                       0.6768398
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                     0.2603462
## Lifetime.Post.reach.by.people.who.like.your.Page                                 0.6120798
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post              0.8392785
## Total.Interactions                                                               0.5721595
##                                                                     Lifetime.Post.Consumers
## Page.total.likes                                                                 -0.1491289
## Lifetime.Post.Total.Reach                                                         0.4779080
## Lifetime.Post.Total.Impressions                                                   0.3152011
## Lifetime.Engaged.Users                                                            0.9682131
## Lifetime.Post.Consumers                                                           1.0000000
## Lifetime.Post.Consumptions                                                        0.7066658
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                      0.2229410
## Lifetime.Post.reach.by.people.who.like.your.Page                                  0.5038469
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post               0.8135102
## Total.Interactions                                                                0.3545015
##                                                                     Lifetime.Post.Consumptions
## Page.total.likes                                                                    -0.1282400
## Lifetime.Post.Total.Reach                                                            0.3243621
## Lifetime.Post.Total.Impressions                                                      0.2260813
## Lifetime.Engaged.Users                                                               0.6768398
## Lifetime.Post.Consumers                                                              0.7066658
## Lifetime.Post.Consumptions                                                           1.0000000
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                         0.1648134
## Lifetime.Post.reach.by.people.who.like.your.Page                                     0.3553886
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post                  0.5772625
## Total.Interactions                                                                   0.2380822
##                                                                     Lifetime.Post.Impressions.by.people.who.have.liked.your.Page
## Page.total.likes                                                                                                     -0.09610873
## Lifetime.Post.Total.Reach                                                                                             0.32225432
## Lifetime.Post.Total.Impressions                                                                                       0.85078719
## Lifetime.Engaged.Users                                                                                                0.26034615
## Lifetime.Post.Consumers                                                                                               0.22294095
## Lifetime.Post.Consumptions                                                                                            0.16481338
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                                                          1.00000000
## Lifetime.Post.reach.by.people.who.like.your.Page                                                                      0.58422465
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post                                                   0.30979987
## Total.Interactions                                                                                                    0.25008332
##                                                                     Lifetime.Post.reach.by.people.who.like.your.Page
## Page.total.likes                                                                                         -0.06051633
## Lifetime.Post.Total.Reach                                                                                 0.74305292
## Lifetime.Post.Total.Impressions                                                                           0.65193320
## Lifetime.Engaged.Users                                                                                    0.61207982
## Lifetime.Post.Consumers                                                                                   0.50384685
## Lifetime.Post.Consumptions                                                                                0.35538862
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                                              0.58422465
## Lifetime.Post.reach.by.people.who.like.your.Page                                                          1.00000000
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post                                       0.64870102
## Total.Interactions                                                                                        0.61792869
##                                                                     Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post
## Page.total.likes                                                                                                              0.0336990
## Lifetime.Post.Total.Reach                                                                                                     0.4007558
## Lifetime.Post.Total.Impressions                                                                                               0.3238426
## Lifetime.Engaged.Users                                                                                                        0.8392785
## Lifetime.Post.Consumers                                                                                                       0.8135102
## Lifetime.Post.Consumptions                                                                                                    0.5772625
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                                                                  0.3097999
## Lifetime.Post.reach.by.people.who.like.your.Page                                                                              0.6487010
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post                                                           1.0000000
## Total.Interactions                                                                                                            0.4925702
##                                                                     Total.Interactions
## Page.total.likes                                                            0.04523052
## Lifetime.Post.Total.Reach                                                   0.53859744
## Lifetime.Post.Total.Impressions                                             0.34335812
## Lifetime.Engaged.Users                                                      0.57215947
## Lifetime.Post.Consumers                                                     0.35450153
## Lifetime.Post.Consumptions                                                  0.23808220
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page                0.25008332
## Lifetime.Post.reach.by.people.who.like.your.Page                            0.61792869
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post         0.49257019
## Total.Interactions                                                          1.00000000
KMO(mat_corr)
## Kaiser-Meyer-Olkin factor adequacy
## Call: KMO(r = mat_corr)
## Overall MSA =  0.56
## MSA for each item = 
##                                                    Page.total.likes 
##                                                                0.27 
##                                           Lifetime.Post.Total.Reach 
##                                                                0.47 
##                                     Lifetime.Post.Total.Impressions 
##                                                                0.48 
##                                              Lifetime.Engaged.Users 
##                                                                0.62 
##                                             Lifetime.Post.Consumers 
##                                                                0.58 
##                                          Lifetime.Post.Consumptions 
##                                                                0.97 
##        Lifetime.Post.Impressions.by.people.who.have.liked.your.Page 
##                                                                0.38 
##                    Lifetime.Post.reach.by.people.who.like.your.Page 
##                                                                0.59 
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post 
##                                                                0.72 
##                                                  Total.Interactions 
##                                                                0.45
cortest.bartlett(mat_corr, n = nrow(kolom_num))
## $chisq
## [1] 6960.807
## 
## $p.value
## [1] 0
## 
## $df
## [1] 45

Matriks korelasi dihitung untuk melihat hubungan antar variabel. Uji Kaiser–Meyer–Olkin (KMO) digunakan untuk menilai kecukupan sampel, sedangkan Bartlett’s Test of Sphericity digunakan untuk menguji apakah matriks korelasi berbeda secara signifikan dari matriks identitas. Hasil kedua uji ini menunjukkan bahwa data layak dianalisis menggunakan metode PCA dan FA.

Principal Component Analysis (PCA)

pca_fb = prcomp(kolom_num, scale = TRUE)
summary(pca_fb)
## Importance of components:
##                           PC1    PC2    PC3     PC4     PC5     PC6     PC7
## Standard deviation     2.2549 1.2994 1.0477 0.89784 0.72909 0.62068 0.52550
## Proportion of Variance 0.5085 0.1689 0.1098 0.08061 0.05316 0.03852 0.02761
## Cumulative Proportion  0.5085 0.6773 0.7871 0.86770 0.92086 0.95939 0.98700
##                            PC8     PC9    PC10
## Standard deviation     0.33934 0.11706 0.03387
## Proportion of Variance 0.01151 0.00137 0.00011
## Cumulative Proportion  0.99851 0.99989 1.00000

Digunakan untuk melakukan Principal Component Analysis (PCA) terhadap data kinerja interaksi konten Facebook. Seluruh variabel dinormalisasi terlebih dahulu agar berada pada skala yang sama sehingga tidak ada variabel yang mendominasi analisis. Output summary() menampilkan nilai simpangan baku setiap komponen utama, proporsi varians yang dapat dijelaskan oleh masing-masing komponen, serta varians kumulatif. Informasi ini digunakan untuk menentukan jumlah komponen utama yang paling representatif dalam menjelaskan variasi data.

pca_fb$sdev^2
##  [1] 5.08462839 1.68855687 1.09772515 0.80612353 0.53157303 0.38524367
##  [7] 0.27614883 0.11514991 0.01370358 0.00114705

Digunakan untuk memperoleh nilai eigen dari setiap komponen utama. Nilai eigen menunjukkan besarnya variasi data yang dapat dijelaskan oleh masing-masing komponen. Komponen dengan nilai eigen yang lebih besar memiliki kontribusi yang lebih signifikan terhadap struktur data.

prop_var = pca_fb$sdev^2 / sum(pca_fb$sdev^2)
prop_var
##  [1] 0.508462839 0.168855687 0.109772515 0.080612353 0.053157303 0.038524367
##  [7] 0.027614883 0.011514991 0.001370358 0.000114705

Menghitung proporsi varians yang dijelaskan oleh setiap komponen utama dengan membandingkan nilai eigen terhadap total variasi data. Hasil ini memberikan gambaran kontribusi relatif tiap komponen dalam merepresentasikan data asli.

cumsum(prop_var)
##  [1] 0.5084628 0.6773185 0.7870910 0.8677034 0.9208607 0.9593851 0.9869999
##  [8] 0.9985149 0.9998853 1.0000000

Digunakan untuk menghasilkan varians kumulatif dari komponen utama. Varians kumulatif menunjukkan seberapa besar total variasi data yang dapat dijelaskan secara bersama-sama oleh sejumlah komponen pertama, sehingga membantu dalam menentukan jumlah komponen yang dipertahankan.

plot(pca_fb, type = "l", main = "Scree Plot PCA")

Digunakan untuk menghitung varians kumulatif dari komponen utama. Varians kumulatif menunjukkan seberapa besar total variasi data yang dapat dijelaskan secara bersama-sama oleh sejumlah komponen pertama, sehingga membantu dalam menentukan jumlah komponen yang dipertahankan.

pca_fb$rotation
##                                                                             PC1
## Page.total.likes                                                    -0.05282793
## Lifetime.Post.Total.Reach                                            0.33555342
## Lifetime.Post.Total.Impressions                                      0.30308173
## Lifetime.Engaged.Users                                               0.39733325
## Lifetime.Post.Consumers                                              0.36583098
## Lifetime.Post.Consumptions                                           0.28536367
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.24690992
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.37670355
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.36478323
## Total.Interactions                                                   0.28927364
##                                                                             PC2
## Page.total.likes                                                    -0.00532003
## Lifetime.Post.Total.Reach                                            0.20867359
## Lifetime.Post.Total.Impressions                                      0.50081823
## Lifetime.Engaged.Users                                              -0.29519674
## Lifetime.Post.Consumers                                             -0.35809995
## Lifetime.Post.Consumptions                                          -0.35687993
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.49602541
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.22031355
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post -0.25555031
## Total.Interactions                                                   0.05461624
##                                                                              PC3
## Page.total.likes                                                     0.842935395
## Lifetime.Post.Total.Reach                                            0.081323952
## Lifetime.Post.Total.Impressions                                     -0.123068707
## Lifetime.Engaged.Users                                              -0.001343523
## Lifetime.Post.Consumers                                             -0.125469496
## Lifetime.Post.Consumptions                                          -0.207524282
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page        -0.171893512
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.118951602
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.126319904
## Total.Interactions                                                   0.386310910
##                                                                             PC4
## Page.total.likes                                                    -0.46447935
## Lifetime.Post.Total.Reach                                            0.38166262
## Lifetime.Post.Total.Impressions                                     -0.18859813
## Lifetime.Engaged.Users                                               0.02396225
## Lifetime.Post.Consumers                                             -0.13009763
## Lifetime.Post.Consumptions                                          -0.26045104
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page        -0.45302070
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.13130261
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post -0.18702979
## Total.Interactions                                                   0.51013794
##                                                                             PC5
## Page.total.likes                                                     0.23498239
## Lifetime.Post.Total.Reach                                            0.63529937
## Lifetime.Post.Total.Impressions                                      0.20786857
## Lifetime.Engaged.Users                                              -0.04399251
## Lifetime.Post.Consumers                                              0.05462353
## Lifetime.Post.Consumptions                                           0.30961734
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page        -0.33114564
## Lifetime.Post.reach.by.people.who.like.your.Page                    -0.08363696
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post -0.33874701
## Total.Interactions                                                  -0.40716650
##                                                                             PC6
## Page.total.likes                                                    -0.02082746
## Lifetime.Post.Total.Reach                                            0.15691624
## Lifetime.Post.Total.Impressions                                     -0.01080941
## Lifetime.Engaged.Users                                               0.14997464
## Lifetime.Post.Consumers                                              0.29604887
## Lifetime.Post.Consumptions                                          -0.72323142
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page        -0.12221346
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.12314825
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.29728680
## Total.Interactions                                                  -0.47238183
##                                                                              PC7
## Page.total.likes                                                     0.061654055
## Lifetime.Post.Total.Reach                                           -0.003199795
## Lifetime.Post.Total.Impressions                                      0.281875535
## Lifetime.Engaged.Users                                               0.331062935
## Lifetime.Post.Consumers                                              0.307421304
## Lifetime.Post.Consumptions                                          -0.241733043
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.105461332
## Lifetime.Post.reach.by.people.who.like.your.Page                    -0.702522142
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post -0.268617730
## Total.Interactions                                                   0.278162534
##                                                                             PC8
## Page.total.likes                                                     0.10627172
## Lifetime.Post.Total.Reach                                           -0.12720345
## Lifetime.Post.Total.Impressions                                     -0.35153412
## Lifetime.Engaged.Users                                               0.28041218
## Lifetime.Post.Consumers                                              0.29473229
## Lifetime.Post.Consumptions                                          -0.05313467
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.22546328
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.41684919
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post -0.67289566
## Total.Interactions                                                  -0.05694256
##                                                                              PC9
## Page.total.likes                                                    -0.009886694
## Lifetime.Post.Total.Reach                                            0.496639385
## Lifetime.Post.Total.Impressions                                     -0.599592664
## Lifetime.Engaged.Users                                              -0.046383544
## Lifetime.Post.Consumers                                             -0.091756781
## Lifetime.Post.Consumptions                                           0.008850399
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.520993826
## Lifetime.Post.reach.by.people.who.like.your.Page                    -0.297640462
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.149850610
## Total.Interactions                                                  -0.024729033
##                                                                             PC10
## Page.total.likes                                                     0.007523391
## Lifetime.Post.Total.Reach                                            0.022575617
## Lifetime.Post.Total.Impressions                                     -0.027199252
## Lifetime.Engaged.Users                                              -0.734572224
## Lifetime.Post.Consumers                                              0.651798421
## Lifetime.Post.Consumptions                                          -0.006335798
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.015337426
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.010743913
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post -0.012733320
## Total.Interactions                                                   0.183585018

Output ini menampilkan matriks loading PCA, yang menunjukkan kontribusi masing-masing variabel terhadap setiap komponen utama. Nilai loading yang lebih besar menunjukkan bahwa variabel tersebut memiliki peran yang lebih dominan dalam membentuk komponen tertentu. Matriks ini digunakan sebagai dasar dalam interpretasi makna dari setiap komponen utama yang dihasilkan.

Factor Analisis (FA)

eigen(cor(kolom_num))$values
##  [1] 5.08462839 1.68855687 1.09772515 0.80612353 0.53157303 0.38524367
##  [7] 0.27614883 0.11514991 0.01370358 0.00114705

Cek Eigenvalue, digunakan untuk menentukan jumlah faktor yang dipertahankan dalam analisis faktor. Faktor dengan nilai eigen lebih besar dari satu dipilih berdasarkan kriteria Kaiser.

fa_awal = fa(kolom_num, 
             nfactors = 3, 
             rotate = "none", 
             fm = "pa")
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate, : An
## ultra-Heywood case was detected.  Examine the results carefully
print(fa_awal$loadings, cutoff = 0.3)
## 
## Loadings:
##                                                                     PA1   
## Page.total.likes                                                          
## Lifetime.Post.Total.Reach                                            0.709
## Lifetime.Post.Total.Impressions                                      0.702
## Lifetime.Engaged.Users                                               0.913
## Lifetime.Post.Consumers                                              0.847
## Lifetime.Post.Consumptions                                           0.595
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.531
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.831
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.793
## Total.Interactions                                                   0.618
##                                                                     PA2   
## Page.total.likes                                                          
## Lifetime.Post.Total.Reach                                                 
## Lifetime.Post.Total.Impressions                                      0.712
## Lifetime.Engaged.Users                                              -0.399
## Lifetime.Post.Consumers                                             -0.488
## Lifetime.Post.Consumptions                                          -0.339
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.560
## Lifetime.Post.reach.by.people.who.like.your.Page                          
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post       
## Total.Interactions                                                        
##                                                                     PA3   
## Page.total.likes                                                          
## Lifetime.Post.Total.Reach                                                 
## Lifetime.Post.Total.Impressions                                           
## Lifetime.Engaged.Users                                                    
## Lifetime.Post.Consumers                                                   
## Lifetime.Post.Consumptions                                                
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page              
## Lifetime.Post.reach.by.people.who.like.your.Page                          
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post       
## Total.Interactions                                                   0.512
## 
##                  PA1   PA2   PA3
## SS loadings    4.894 1.538 0.613
## Proportion Var 0.489 0.154 0.061
## Cumulative Var 0.489 0.643 0.705

Cek FA sebelum di rotasi, menggunakan metode Principal Axis Factoring tanpa rotasi untuk melihat struktur awal faktor. Matriks loading sebelum rotasi ditampilkan sebagai gambaran awal hubungan antara variabel dan faktor, meskipun struktur faktor masih belum optimal untuk diinterpretasikan.

fa_rotasi = fa(kolom_num, 
               nfactors = 3,
               rotate = "varimax", 
               fm = "pa")
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate, : An
## ultra-Heywood case was detected.  Examine the results carefully
print(fa_rotasi$loadings, cutoff = 0.3)
## 
## Loadings:
##                                                                     PA1   
## Page.total.likes                                                          
## Lifetime.Post.Total.Reach                                                 
## Lifetime.Post.Total.Impressions                                           
## Lifetime.Engaged.Users                                               0.887
## Lifetime.Post.Consumers                                              0.984
## Lifetime.Post.Consumptions                                           0.697
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page              
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.330
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.722
## Total.Interactions                                                        
##                                                                     PA2   
## Page.total.likes                                                          
## Lifetime.Post.Total.Reach                                            0.419
## Lifetime.Post.Total.Impressions                                      0.979
## Lifetime.Engaged.Users                                                    
## Lifetime.Post.Consumers                                                   
## Lifetime.Post.Consumptions                                                
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.785
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.484
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post       
## Total.Interactions                                                        
##                                                                     PA3   
## Page.total.likes                                                          
## Lifetime.Post.Total.Reach                                            0.572
## Lifetime.Post.Total.Impressions                                           
## Lifetime.Engaged.Users                                               0.436
## Lifetime.Post.Consumers                                                   
## Lifetime.Post.Consumptions                                                
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page              
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.686
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.415
## Total.Interactions                                                   0.767
## 
##                  PA1   PA2   PA3
## SS loadings    3.042 2.084 1.919
## Proportion Var 0.304 0.208 0.192
## Cumulative Var 0.304 0.513 0.705

Faktor Analisis menggunakan metode Principal Axis Factoring dengan jumlah faktor sebanyak tiga dan rotasi Varimax. Rotasi Varimax digunakan untuk memperoleh struktur faktor yang lebih sederhana sehingga hubungan antara variabel dan faktor menjadi lebih jelas. Output yang dihasilkan menampilkan matriks factor loading setelah rotasi dengan batas minimum 0,3, sehingga hanya hubungan yang cukup kuat antara variabel dan faktor yang ditampilkan. Selain itu, ditunjukkan pula nilai SS loadings, Proportion Var, dan Cumulative Var yang menggambarkan kontribusi masing-masing faktor dalam menjelaskan variasi data, di mana ketiga faktor secara kumulatif mampu menjelaskan sekitar 70,5% variasi total.

loadings_matrix = as.data.frame(unclass(fa_rotasi$loadings))
round(loadings_matrix, 3)
##                                                                        PA1
## Page.total.likes                                                    -0.130
## Lifetime.Post.Total.Reach                                            0.288
## Lifetime.Post.Total.Impressions                                      0.114
## Lifetime.Engaged.Users                                               0.887
## Lifetime.Post.Consumers                                              0.984
## Lifetime.Post.Consumptions                                           0.697
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.093
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.330
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.722
## Total.Interactions                                                   0.224
##                                                                        PA2
## Page.total.likes                                                    -0.139
## Lifetime.Post.Total.Reach                                            0.419
## Lifetime.Post.Total.Impressions                                      0.979
## Lifetime.Engaged.Users                                               0.129
## Lifetime.Post.Consumers                                              0.149
## Lifetime.Post.Consumptions                                           0.118
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page         0.785
## Lifetime.Post.reach.by.people.who.like.your.Page                     0.484
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post  0.141
## Total.Interactions                                                   0.093
##                                                                       PA3
## Page.total.likes                                                    0.102
## Lifetime.Post.Total.Reach                                           0.572
## Lifetime.Post.Total.Impressions                                     0.298
## Lifetime.Engaged.Users                                              0.436
## Lifetime.Post.Consumers                                             0.174
## Lifetime.Post.Consumptions                                          0.102
## Lifetime.Post.Impressions.by.people.who.have.liked.your.Page        0.179
## Lifetime.Post.reach.by.people.who.like.your.Page                    0.686
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post 0.415
## Total.Interactions                                                  0.767

Mengubah matriks faktor loading hasil rotasi ke dalam bentuk data frame dan membulatkan nilainya hingga tiga angka di belakang koma. Tujuan dari langkah ini adalah untuk mempermudah pembacaan dan interpretasi hasil, khususnya dalam mengidentifikasi cross loading serta menentukan faktor dominan bagi setiap variabel berdasarkan nilai loading terbesar.

fa_rotasi$communality
##                                                    Page.total.likes 
##                                                          0.04667544 
##                                           Lifetime.Post.Total.Reach 
##                                                          0.58486366 
##                                     Lifetime.Post.Total.Impressions 
##                                                          1.06055028 
##                                              Lifetime.Engaged.Users 
##                                                          0.99305584 
##                                             Lifetime.Post.Consumers 
##                                                          1.02123731 
##                                          Lifetime.Post.Consumptions 
##                                                          0.51094202 
##        Lifetime.Post.Impressions.by.people.who.have.liked.your.Page 
##                                                          0.65616065 
##                    Lifetime.Post.reach.by.people.who.like.your.Page 
##                                                          0.81319423 
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post 
##                                                          0.71231033 
##                                                  Total.Interactions 
##                                                          0.64637246

Output ini menampilkan nilai communality dari setiap variabel, yaitu proporsi varians variabel yang dapat dijelaskan oleh faktor-faktor yang terbentuk. Nilai communality yang relatif tinggi menunjukkan bahwa variabel tersebut dapat dijelaskan dengan baik oleh struktur faktor yang dihasilkan, sedangkan nilai yang rendah menunjukkan kontribusi faktor yang lebih terbatas.

apply(loadings_matrix, 1, which.max)
##                                                    Page.total.likes 
##                                                                   3 
##                                           Lifetime.Post.Total.Reach 
##                                                                   3 
##                                     Lifetime.Post.Total.Impressions 
##                                                                   2 
##                                              Lifetime.Engaged.Users 
##                                                                   1 
##                                             Lifetime.Post.Consumers 
##                                                                   1 
##                                          Lifetime.Post.Consumptions 
##                                                                   1 
##        Lifetime.Post.Impressions.by.people.who.have.liked.your.Page 
##                                                                   2 
##                    Lifetime.Post.reach.by.people.who.like.your.Page 
##                                                                   3 
## Lifetime.People.who.have.liked.your.Page.and.engaged.with.your.post 
##                                                                   1 
##                                                  Total.Interactions 
##                                                                   3

Digunakan untuk memperoleh nilai eigen dari setiap komponen utama. Nilai eigen menunjukkan besarnya variasi data yang dapat dijelaskan oleh masing-masing komponen. Komponen dengan nilai eigen yang lebih besar memiliki kontribusi yang lebih signifikan terhadap struktur data.

Seluruh tahapan analisis, mulai dari pembacaan data, uji asumsi, PCA, hingga FA, ditampilkan secara lengkap pada halaman ini. Penyajian output dalam bentuk RPubs bertujuan untuk memberikan transparansi proses analisis serta memudahkan penelusuran kembali hasil pengolahan data.