1 Introduction

This is a project applying dimension reduction on the PRDECT-ID e-commerce dataset. PRDECT-ID Dataset is a collection of Indonesian product review data annotated with emotion and sentiment labels. The data were collected from one of the giant e-commerce in Indonesia named Tokopedia. The dataset contains product reviews from 29 product categories on Tokopedia that use the Indonesian language. We will apply multiple techniques including:

  • Principal Component Analysis (PCA)
  • Factor Analysis
  • Multidimensional Scaling (MDS)
  • t-SNE (t-Distributed Stochastic Neighbor Embedding)

1.1 Objectives

  1. Reduce dimensionality while preserving maximum variance
  2. Identify underlying latent factors
  3. Visualize complex relationships in lower dimensions
  4. Create a reduced dataset for further analysis

2 Package Installation and Loading

# List of required packages
required_packages <- c(
  "tidyverse",      
  "FactoMineR",    
  "factoextra", 
  "corrplot",
  "ggplot2",
  "psych",
  "gridExtra",
  "RColorBrewer",
  "MASS",
  "knitr",
  "kableExtra"
)

# Function to install missing packages
install_if_missing <- function(packages) {
  new_packages <- packages[!(packages %in% installed.packages()[,"Package"])]
  if(length(new_packages) > 0) {
    install.packages(new_packages, repos = "https://cran.r-project.org/")
  }
}

# Install missing packages
install_if_missing(required_packages)

# Load all packages
invisible(lapply(required_packages, library, character.only = TRUE))

# Verify package loading
cat("✓ All packages loaded successfully!\n")
## ✓ All packages loaded successfully!

3 Data Loading and Exploration

3.1 Load Dataset

The dataset can be downloaded here: data.mendeley.com/datasets/574v66hf2v/1

# Load the dataset
data <- read.csv("/Users/bayu/Desktop/STUDY/1st Year/Unsupervised Learning/Final Project/02. Dimension Reduction/PRDECT-ID Dataset.csv", stringsAsFactors = FALSE)

# Display basic information
cat("Dataset Dimensions:", nrow(data), "rows ×", ncol(data), "columns\n")
## Dataset Dimensions: 5400 rows × 11 columns

3.2 Data Structure

# Display structure
str(data)
## 'data.frame':    5400 obs. of  11 variables:
##  $ Category       : chr  "Computers and Laptops" "Computers and Laptops" "Computers and Laptops" "Computers and Laptops" ...
##  $ Product.Name   : chr  "Wireless Keyboard i8 Mini TouchPad Mouse 2.4G Handheld PC Android TV" "PAKET LISENSI WINDOWS 10 PRO DAN OFFICE 2019 ORIGINAL + BONUS" "SSD Midasforce 128 Gb - Tanpa Caddy" "ADAPTOR CHARGER MONITOR LCD LED TV LG merek LG 19V ORIGINAL" ...
##  $ Location       : chr  "Jakarta Utara" "Kota Tangerang Selatan" "Jakarta Barat" "Jakarta Timur" ...
##  $ Price          : int  53500 72000 213000 55000 55000 55000 85000 136500 136500 113777 ...
##  $ Overall.Rating : num  4.9 4.9 5 4.7 4.7 4.7 4.9 5 5 4.9 ...
##  $ Number.Sold    : int  5449 2359 12300 2030 2030 2030 1339 1201 1201 1630 ...
##  $ Total.Review   : int  2369 1044 3573 672 672 672 718 632 632 777 ...
##  $ Customer.Rating: int  5 5 5 5 5 5 5 5 5 5 ...
##  $ Customer.Review: chr  "Alhamdulillah berfungsi dengan baik. Packaging aman. Respon cepat dan ramah. Seller dan kurir amanah" "barang bagus dan respon cepat, harga bersaing dengan yg lain." "barang bagus, berfungsi dengan baik, seler ramah, pengiriman cepat" "bagus sesuai harapan penjual nya juga ramah. trimakasih pelapak ??" ...
##  $ Sentiment      : chr  "Positive" "Positive" "Positive" "Positive" ...
##  $ Emotion        : chr  "Happy" "Happy" "Happy" "Happy" ...

3.3 First Few Rows

# Display first 6 rows
head(data) %>%
  kable(caption = "First 6 Rows of the Dataset") %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"),
                full_width = FALSE)
First 6 Rows of the Dataset
Category Product.Name Location Price Overall.Rating Number.Sold Total.Review Customer.Rating Customer.Review Sentiment Emotion
Computers and Laptops Wireless Keyboard i8 Mini TouchPad Mouse 2.4G Handheld PC Android TV Jakarta Utara 53500 4.9 5449 2369 5 Alhamdulillah berfungsi dengan baik. Packaging aman. Respon cepat dan ramah. Seller dan kurir amanah Positive Happy
Computers and Laptops PAKET LISENSI WINDOWS 10 PRO DAN OFFICE 2019 ORIGINAL + BONUS Kota Tangerang Selatan 72000 4.9 2359 1044 5 barang bagus dan respon cepat, harga bersaing dengan yg lain. Positive Happy
Computers and Laptops SSD Midasforce 128 Gb - Tanpa Caddy Jakarta Barat 213000 5.0 12300 3573 5 barang bagus, berfungsi dengan baik, seler ramah, pengiriman cepat Positive Happy
Computers and Laptops ADAPTOR CHARGER MONITOR LCD LED TV LG merek LG 19V ORIGINAL Jakarta Timur 55000 4.7 2030 672 5 bagus sesuai harapan penjual nya juga ramah. trimakasih pelapak ?? Positive Happy
Computers and Laptops ADAPTOR CHARGER MONITOR LCD LED TV LG merek LG 19V ORIGINAL Jakarta Timur 55000 4.7 2030 672 5 Barang Bagus, pengemasan Aman, dapat Berfungsi dengan Baik Positive Happy
Computers and Laptops ADAPTOR CHARGER MONITOR LCD LED TV LG merek LG 19V ORIGINAL Jakarta Timur 55000 4.7 2030 672 5 barang bagus, seller ramah.. Positive Happy

3.4 Summary Statistics

# Summary statistics
summary(data) %>%
  kable(caption = "Summary Statistics") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Summary Statistics
Category Product.Name Location Price Overall.Rating Number.Sold Total.Review Customer.Rating Customer.Review Sentiment Emotion
Length:5400 Length:5400 Length:5400 Min. : 100 Min. :4.100 Min. : 9 Min. : 4 Min. :1.000 Length:5400 Length:5400 Length:5400
Class :character Class :character Class :character 1st Qu.: 20000 1st Qu.:4.800 1st Qu.: 1630 1st Qu.: 576 1st Qu.:1.000 Class :character Class :character Class :character
Mode :character Mode :character Mode :character Median : 59900 Median :4.900 Median : 3794 Median : 1192 Median :3.000 Mode :character Mode :character Mode :character
NA NA NA Mean : 238696 Mean :4.854 Mean : 15962 Mean : 2169 Mean :3.087 NA NA NA
NA NA NA 3rd Qu.: 150000 3rd Qu.:4.900 3rd Qu.: 9707 3rd Qu.: 2582 3rd Qu.:5.000 NA NA NA
NA NA NA Max. :15399000 Max. :5.000 Max. :1000000 Max. :24500 Max. :5.000 NA NA NA

3.5 Missing Values Check

# Check for missing values
missing_counts <- colSums(is.na(data))
missing_df <- data.frame(
  Variable = names(missing_counts),
  Missing_Count = missing_counts,
  Percentage = round(missing_counts / nrow(data) * 100, 2)
)

missing_df %>%
  kable(caption = "Missing Values Summary", row.names = FALSE) %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Missing Values Summary
Variable Missing_Count Percentage
Category 0 0
Product.Name 0 0
Location 0 0
Price 0 0
Overall.Rating 0 0
Number.Sold 0 0
Total.Review 0 0
Customer.Rating 0 0
Customer.Review 0 0
Sentiment 0 0
Emotion 0 0

4 Data Preprocessing

4.1 Extract Numerical Variables

# Define numerical variables
numerical_vars <- c("Price", "Overall.Rating", "Number.Sold", 
                    "Total.Review", "Customer.Rating")

# Extract numerical data
data_numeric <- data[, numerical_vars]

# Remove rows with missing values
data_numeric <- na.omit(data_numeric)

cat("Numerical variables extracted:", paste(numerical_vars, collapse = ", "), "\n")
## Numerical variables extracted: Price, Overall.Rating, Number.Sold, Total.Review, Customer.Rating
cat("Clean dataset dimensions:", nrow(data_numeric), "rows ×", 
    ncol(data_numeric), "columns\n")
## Clean dataset dimensions: 5400 rows × 5 columns

4.2 Summary of Numerical Variables

summary(data_numeric) %>%
  kable(caption = "Summary of Numerical Variables") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Summary of Numerical Variables
Price Overall.Rating Number.Sold Total.Review Customer.Rating
Min. : 100 Min. :4.100 Min. : 9 Min. : 4 Min. :1.000
1st Qu.: 20000 1st Qu.:4.800 1st Qu.: 1630 1st Qu.: 576 1st Qu.:1.000
Median : 59900 Median :4.900 Median : 3794 Median : 1192 Median :3.000
Mean : 238696 Mean :4.854 Mean : 15962 Mean : 2169 Mean :3.087
3rd Qu.: 150000 3rd Qu.:4.900 3rd Qu.: 9707 3rd Qu.: 2582 3rd Qu.:5.000
Max. :15399000 Max. :5.000 Max. :1000000 Max. :24500 Max. :5.000

5 Exploratory Data Analysis

5.1 Correlation Analysis

# Calculate correlation matrix
cor_matrix <- cor(data_numeric)

# Display correlation matrix
cor_matrix %>%
  round(3) %>%
  kable(caption = "Correlation Matrix") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Correlation Matrix
Price Overall.Rating Number.Sold Total.Review Customer.Rating
Price 1.000 0.149 -0.048 -0.072 0.091
Overall.Rating 0.149 1.000 0.011 0.092 0.201
Number.Sold -0.048 0.011 1.000 0.169 -0.061
Total.Review -0.072 0.092 0.169 1.000 -0.208
Customer.Rating 0.091 0.201 -0.061 -0.208 1.000

5.2 Correlation Heatmap

corrplot(cor_matrix, 
         method = "color", 
         type = "upper",
         addCoef.col = "black", 
         number.cex = 0.8,
         tl.col = "black", 
         tl.srt = 45,
         title = "Correlation Matrix of Numerical Variables",
         mar = c(0, 0, 2, 0))
Correlation Matrix Heatmap

Correlation Matrix Heatmap

Key Observations:

  • Strong correlations indicate potential for dimension reduction
  • Variables with correlation > 0.7 can be reduced effectively

5.3 Distribution Plots

# Create distribution plots
par(mfrow = c(2, 3))
for(var in names(data_numeric)) {
  hist(data_numeric[[var]], 
       main = paste("Distribution of", var),
       xlab = var, 
       col = "skyblue", 
       border = "white",
       las = 1)
}
par(mfrow = c(1, 1))
Distribution of Numerical Variables

Distribution of Numerical Variables

5.4 Pairwise Relationships

# Use sample for performance
set.seed(123)
sample_size <- min(1000, nrow(data_numeric))
data_sample <- data_numeric[sample(nrow(data_numeric), sample_size), ]

# Create pairs plot
pairs(data_sample, 
      main = "Pairwise Scatter Plots",
      pch = 16, 
      col = rgb(0, 0, 1, 0.3),
      las = 1)
Pairwise Scatter Plots (Sample of 1000 observations)

Pairwise Scatter Plots (Sample of 1000 observations)


6 Data Standardization

For PCA and other dimension reduction techniques, we need to standardize the data so all variables have mean = 0 and standard deviation = 1.

# Standardize the data
data_scaled <- scale(data_numeric)

# Verify standardization
standardization_check <- data.frame(
  Variable = colnames(data_scaled),
  Mean = round(colMeans(data_scaled), 6),
  SD = round(apply(data_scaled, 2, sd), 6)
)

standardization_check %>%
  kable(caption = "Standardization Verification (Mean ≈ 0, SD = 1)") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Standardization Verification (Mean ≈ 0, SD = 1)
Variable Mean SD
Price Price 0 1
Overall.Rating Overall.Rating 0 1
Number.Sold Number.Sold 0 1
Total.Review Total.Review 0 1
Customer.Rating Customer.Rating 0 1

7 Principal Component Analysis (PCA)

7.1 Perform PCA

# Perform PCA
pca_result <- prcomp(data_numeric, scale. = TRUE, center = TRUE)

# Summary of PCA
pca_summary <- summary(pca_result)
print(pca_summary)
## Importance of components:
##                           PC1    PC2    PC3    PC4    PC5
## Standard deviation     1.1755 1.0845 0.9627 0.9337 0.8022
## Proportion of Variance 0.2764 0.2352 0.1854 0.1744 0.1287
## Cumulative Proportion  0.2764 0.5116 0.6970 0.8713 1.0000

7.2 Variance Explained

# Calculate variance explained
variance_explained <- pca_result$sdev^2 / sum(pca_result$sdev^2)
cumulative_variance <- cumsum(variance_explained)

# Create summary table
variance_table <- data.frame(
  Component = paste0("PC", 1:length(variance_explained)),
  Standard_Deviation = round(pca_result$sdev, 4),
  Variance_Explained = round(variance_explained, 4),
  Variance_Percent = round(variance_explained * 100, 2),
  Cumulative_Percent = round(cumulative_variance * 100, 2)
)

variance_table %>%
  kable(caption = "PCA Variance Explained") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
PCA Variance Explained
Component Standard_Deviation Variance_Explained Variance_Percent Cumulative_Percent
PC1 1.1755 0.2764 27.64 27.64
PC2 1.0845 0.2352 23.52 51.16
PC3 0.9627 0.1854 18.54 69.70
PC4 0.9337 0.1744 17.44 87.13
PC5 0.8022 0.1287 12.87 100.00

Key Findings:

  • PC1 explains 27.6% of the total variance
  • First 2 PCs explain 51.2% of the total variance
  • To capture 80% of variance, we need 4 component(s)

7.3 Scree Plot

fviz_eig(pca_result, 
         addlabels = TRUE,
         ylim = c(0, max(variance_explained * 100) + 10),
         main = "Scree Plot",
         xlab = "Principal Component",
         ylab = "Percentage of Variance Explained",
         barfill = "steelblue",
         barcolor = "steelblue")
Scree Plot - Variance Explained by Each Principal Component

Scree Plot - Variance Explained by Each Principal Component

Interpretation:

  • PC1 explains the largest variance (27.6%), indicating the most dominant underlying structure in the data.
  • PC2 adds substantial information (23.5%), suggesting a second strong latent dimension.
  • Variance drops after PC2, with PC3 (18.5%) and PC4 (17.4%) contributing moderately.
  • PC5 explains the least variance (12.9%), adding relatively limited new information.
  • An elbow appears around PC2–PC3, indicating that 2–3 principal components may be sufficient for dimensionality reduction.
  • Using the first 3 PCs captures ~69.6% of total variance, balancing information retention and model simplicity.

7.4 PCA Loadings

# Display loadings (rotation matrix)
loadings_df <- as.data.frame(pca_result$rotation)
loadings_df$Variable <- rownames(loadings_df)
loadings_df <- loadings_df[, c("Variable", paste0("PC", 1:ncol(pca_result$rotation)))]

loadings_df %>%
  kable(caption = "PCA Loadings (Variable Contributions to Components)", 
        digits = 3) %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
PCA Loadings (Variable Contributions to Components)
Variable PC1 PC2 PC3 PC4 PC5
Price Price 0.414 -0.271 0.682 -0.508 -0.178
Overall.Rating Overall.Rating 0.353 -0.658 -0.049 0.383 0.542
Number.Sold Number.Sold -0.348 -0.443 -0.441 -0.686 0.133
Total.Review Total.Review -0.473 -0.535 0.189 0.353 -0.574
Customer.Rating Customer.Rating 0.599 -0.105 -0.550 0.007 -0.573

Interpretation of Loadings:

  • High positive value: Variable increases with the PC
  • High negative value: Variable decreases with the PC
  • Near zero: Variable doesn’t contribute much to this PC

7.5 PCA Biplot

fviz_pca_biplot(pca_result, 
                repel = TRUE,
                col.var = "contrib",
                gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
                col.ind = "#696969",
                alpha.ind = 0.3,
                title = "PCA Biplot",
                labelsize = 4)
PCA Biplot - Variables and Observations

PCA Biplot - Variables and Observations

Biplot Interpretation:

  • Arrows (variables): Direction and length show contribution to PCs
  • Points (observations): Position in the reduced space
  • Arrow angle: Correlation between variables (small angle = high correlation)
  • Dim1 (27.6%) separates product popularity from perceived quality, with Number Sold and Total Reviews opposing Price and Ratings.
  • Dim2 (23.5%) captures rating intensity, strongly influenced by Overall Rating and Customer Rating.
  • Price points in a different direction from sales volume, indicating that higher-priced products are not necessarily high-selling.
  • Number Sold and Total Reviews are closely aligned, showing a strong positive relationship between sales and review volume.
  • Customer Rating and Overall Rating point in similar directions, suggesting consistent evaluation patterns across rating metrics.

7.6 Variables Factor Map

fviz_pca_var(pca_result, 
             col.var = "contrib",
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
             repel = TRUE,
             title = "PCA - Variables Factor Map",
             labelsize = 4)
PCA Variables Factor Map

PCA Variables Factor Map

7.7 Contribution to PC1

fviz_contrib(pca_result, 
             choice = "var", 
             axes = 1, 
             top = 10,
             fill = "steelblue",
             color = "steelblue",
             title = "Contribution of Variables to PC1")
Variable Contributions to PC1

Variable Contributions to PC1

7.8 Contribution to PC2

fviz_contrib(pca_result, 
             choice = "var", 
             axes = 2, 
             top = 10,
             fill = "coral",
             color = "coral",
             title = "Contribution of Variables to PC2")
Variable Contributions to PC2

Variable Contributions to PC2

7.9 Top Contributing Variables

7.9.1 Contributions to PC1

# Top contributors to PC1
pc1_contrib <- abs(pca_result$rotation[, 1])
top_pc1 <- sort(pc1_contrib, decreasing = TRUE)

pc1_table <- data.frame(
  Rank = 1:length(top_pc1),
  Variable = names(top_pc1),
  Contribution = round(top_pc1, 3)
)

pc1_table %>%
  kable(caption = "Top Contributing Variables to PC1") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Top Contributing Variables to PC1
Rank Variable Contribution
Customer.Rating 1 Customer.Rating 0.599
Total.Review 2 Total.Review 0.473
Price 3 Price 0.414
Overall.Rating 4 Overall.Rating 0.353
Number.Sold 5 Number.Sold 0.348

7.9.2 Contributions to PC2

# Top contributors to PC2
pc2_contrib <- abs(pca_result$rotation[, 2])
top_pc2 <- sort(pc2_contrib, decreasing = TRUE)

pc2_table <- data.frame(
  Rank = 1:length(top_pc2),
  Variable = names(top_pc2),
  Contribution = round(top_pc2, 3)
)

pc2_table %>%
  kable(caption = "Top Contributing Variables to PC2") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Top Contributing Variables to PC2
Rank Variable Contribution
Overall.Rating 1 Overall.Rating 0.658
Total.Review 2 Total.Review 0.535
Number.Sold 3 Number.Sold 0.443
Price 4 Price 0.271
Customer.Rating 5 Customer.Rating 0.105

8 Factor Analysis

Factor Analysis identifies underlying latent factors that explain correlations among observed variables.

8.1 Parallel Analysis

Parallel analysis helps determine the optimal number of factors.

fa.parallel(data_numeric, 
            fa = "fa",
            main = "Parallel Analysis - Factor Analysis",
            n.iter = 100)
Parallel Analysis for Factor Number Selection

Parallel Analysis for Factor Number Selection

## Parallel analysis suggests that the number of factors =  0  and the number of components =  NA

Interpretation:

  • Keep factors with eigenvalues above the simulated data line
  • This provides statistical justification for factor number

8.2 Perform Factor Analysis

# Determine number of factors (typically 2-3 for this dataset)
n_factors <- 2

# Perform Factor Analysis
fa_result <- fa(data_numeric, 
                nfactors = n_factors, 
                rotate = "varimax",
                scores = TRUE, 
                fm = "ml")

# Display results
print(fa_result)
## Factor Analysis using method =  ml
## Call: fa(r = data_numeric, nfactors = n_factors, rotate = "varimax", 
##     scores = TRUE, fm = "ml")
## Standardized loadings (pattern matrix) based upon correlation matrix
##                   ML1   ML2    h2   u2 com
## Price            0.22 -0.09 0.054 0.95 1.3
## Overall.Rating   0.76  0.16 0.600 0.40 1.1
## Number.Sold     -0.03  0.22 0.051 0.95 1.0
## Total.Review    -0.04  0.75 0.569 0.43 1.0
## Customer.Rating  0.32 -0.26 0.170 0.83 1.9
## 
##                        ML1  ML2
## SS loadings           0.73 0.72
## Proportion Var        0.15 0.14
## Cumulative Var        0.15 0.29
## Proportion Explained  0.50 0.50
## Cumulative Proportion 0.50 1.00
## 
## Mean item complexity =  1.3
## Test of the hypothesis that 2 factors are sufficient.
## 
## df null model =  10  with the objective function =  0.17 with Chi Square =  909.26
## df of  the model are 1  and the objective function was  0 
## 
## The root mean square of the residuals (RMSR) is  0.01 
## The df corrected root mean square of the residuals is  0.02 
## 
## The harmonic n.obs is  5400 with the empirical chi square  5.46  with prob <  0.019 
## The total n.obs was  5400  with Likelihood Chi Square =  3.16  with prob <  0.076 
## 
## Tucker Lewis Index of factoring reliability =  0.976
## RMSEA index =  0.02  and the 90 % confidence intervals are  0 0.047
## BIC =  -5.44
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy             
##                                                    ML1  ML2
## Correlation of (regression) scores with factors   0.79 0.78
## Multiple R square of scores with factors          0.62 0.60
## Minimum correlation of possible factor scores     0.23 0.21

8.3 Factor Loadings

# Extract and display loadings
loadings_fa <- fa_result$loadings
loadings_fa_df <- as.data.frame(unclass(loadings_fa))
loadings_fa_df$Variable <- rownames(loadings_fa_df)
loadings_fa_df <- loadings_fa_df[, c("Variable", paste0("ML", 1:n_factors))]

loadings_fa_df %>%
  kable(caption = "Factor Loadings (values > 0.3 are significant)", 
        digits = 3) %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Factor Loadings (values > 0.3 are significant)
Variable ML1 ML2
Price Price 0.215 -0.089
Overall.Rating Overall.Rating 0.758 0.158
Number.Sold Number.Sold -0.034 0.223
Total.Review Total.Review -0.035 0.754
Customer.Rating Customer.Rating 0.319 -0.260

Interpretation:

  • Loadings > 0.3 are typically considered meaningful
  • Each variable’s relationship with underlying factors
  • Groups of variables loading on same factor represent a common construct

8.4 Factor Diagram

fa.diagram(fa_result, 
           main = "Factor Analysis Diagram",
           simple = FALSE)
Factor Analysis Loadings Diagram

Factor Analysis Loadings Diagram

8.5 Factor Scores (First 10 Observations)

# Display first 10 factor scores
factor_scores_df <- as.data.frame(fa_result$scores)
factor_scores_df <- head(factor_scores_df, 10)
factor_scores_df$Observation <- 1:10

factor_scores_df %>%
  kable(caption = "Factor Scores for First 10 Observations", 
        digits = 3) %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Factor Scores for First 10 Observations
ML1 ML2 Observation
0.447 -0.045 1
0.477 -0.366 2
1.103 0.359 3
-0.847 -0.686 4
-0.847 -0.686 5
-0.847 -0.686 6
0.485 -0.446 7
1.158 -0.353 8
1.158 -0.353 9
0.487 -0.433 10

9 Multidimensional Scaling (MDS)

MDS creates a low-dimensional representation that preserves distances between observations.

9.1 Classical MDS

# Calculate distance matrix
dist_matrix <- dist(data_scaled)

# Perform Classical MDS
mds_result <- cmdscale(dist_matrix, k = 2, eig = TRUE)

# Display eigenvalues
cat("MDS Eigenvalues:\n")
## MDS Eigenvalues:
print(round(mds_result$eig, 4))
##    [1] 7460.636 6349.655 5004.055 4706.602 3474.052    0.000    0.000    0.000
##    [9]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [17]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [25]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [33]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [41]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [49]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [57]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [65]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [73]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [81]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [89]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##   [97]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [105]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [113]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [121]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [129]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [137]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [145]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [153]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [161]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [169]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [177]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [185]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [193]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [201]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [209]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [217]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [225]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [233]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [241]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [249]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [257]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [265]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [273]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [281]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [289]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [297]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [305]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [313]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [321]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [329]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [337]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [345]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [353]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [361]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [369]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [377]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [385]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [393]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [401]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [409]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [417]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [425]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [433]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [441]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [449]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [457]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [465]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [473]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [481]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [489]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [497]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [505]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [513]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [521]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [529]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [537]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [545]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [553]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [561]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [569]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [577]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [585]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [593]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [601]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [609]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [617]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [625]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [633]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [641]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [649]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [657]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [665]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [673]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [681]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [689]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [697]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [705]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [713]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [721]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [729]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [737]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [745]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [753]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [761]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [769]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [777]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [785]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [793]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [801]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [809]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [817]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [825]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [833]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [841]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [849]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [857]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [865]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [873]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [881]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [889]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [897]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [905]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [913]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [921]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [929]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [937]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [945]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [953]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [961]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [969]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [977]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [985]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
##  [993]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1001]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1009]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1017]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1025]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1033]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1041]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1049]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1057]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1065]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1073]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1081]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1089]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1097]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1105]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1113]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1121]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1129]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1137]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1145]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1153]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1161]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1169]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1177]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1185]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1193]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1201]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1209]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1217]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1225]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1233]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1241]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1249]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1257]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1265]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1273]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1281]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1289]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1297]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1305]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1313]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1321]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1329]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1337]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1345]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1353]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1361]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1369]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1377]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1385]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1393]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1401]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1409]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1417]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1425]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1433]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1441]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1449]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1457]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1465]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1473]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1481]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1489]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1497]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1505]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1513]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1521]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1529]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1537]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1545]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1553]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1561]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1569]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1577]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1585]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1593]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1601]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1609]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1617]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1625]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1633]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1641]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1649]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1657]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1665]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1673]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1681]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1689]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1697]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1705]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1713]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1721]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1729]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1737]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1745]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1753]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1761]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1769]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1777]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1785]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1793]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1801]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1809]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1817]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1825]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1833]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1841]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1849]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1857]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1865]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1873]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1881]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1889]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1897]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1905]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1913]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1921]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1929]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1937]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1945]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1953]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1961]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1969]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1977]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1985]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [1993]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2001]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2009]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2017]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2025]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2033]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2041]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2049]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2057]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2065]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2073]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2081]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2089]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2097]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2105]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2113]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2121]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2129]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2137]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2145]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2153]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2161]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2169]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2177]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2185]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2193]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2201]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2209]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2217]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2225]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2233]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2241]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2249]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2257]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2265]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2273]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2281]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2289]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2297]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2305]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2313]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2321]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2329]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2337]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2345]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2353]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2361]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2369]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2377]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2385]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2393]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2401]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2409]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2417]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2425]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2433]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2441]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2449]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2457]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2465]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2473]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2481]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2489]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2497]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2505]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2513]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2521]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2529]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2537]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2545]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2553]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2561]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2569]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2577]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2585]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2593]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2601]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2609]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2617]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2625]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2633]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2641]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2649]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2657]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2665]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2673]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2681]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2689]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2697]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2705]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2713]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2721]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2729]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2737]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2745]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2753]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2761]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2769]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2777]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2785]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2793]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2801]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2809]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2817]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2825]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2833]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2841]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2849]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2857]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2865]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2873]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2881]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2889]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2897]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2905]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2913]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2921]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2929]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2937]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2945]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2953]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2961]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2969]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2977]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2985]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [2993]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3001]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3009]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3017]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3025]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3033]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3041]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3049]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3057]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3065]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3073]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3081]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3089]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3097]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3105]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3113]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3121]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3129]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3137]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3145]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3153]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3161]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3169]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3177]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3185]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3193]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3201]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3209]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3217]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3225]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3233]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3241]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3249]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3257]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3265]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3273]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3281]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3289]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3297]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3305]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3313]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3321]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3329]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3337]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3345]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3353]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3361]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3369]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3377]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3385]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3393]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3401]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3409]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3417]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3425]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3433]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3441]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3449]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3457]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3465]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3473]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3481]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3489]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3497]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3505]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3513]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3521]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3529]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3537]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3545]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3553]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3561]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3569]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3577]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3585]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3593]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3601]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3609]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3617]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3625]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3633]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3641]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3649]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3657]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3665]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3673]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3681]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3689]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3697]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3705]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3713]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3721]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3729]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3737]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3745]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3753]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3761]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3769]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3777]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3785]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3793]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3801]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3809]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3817]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3825]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3833]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3841]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3849]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3857]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3865]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3873]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3881]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3889]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3897]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3905]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3913]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3921]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3929]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3937]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3945]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3953]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3961]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3969]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3977]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3985]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [3993]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4001]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4009]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4017]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4025]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4033]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4041]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4049]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4057]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4065]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4073]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4081]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4089]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4097]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4105]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4113]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4121]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4129]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4137]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4145]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4153]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4161]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4169]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4177]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4185]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4193]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4201]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4209]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4217]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4225]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4233]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4241]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4249]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4257]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4265]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4273]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4281]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4289]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4297]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4305]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4313]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4321]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4329]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4337]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4345]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4353]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4361]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4369]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4377]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4385]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4393]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4401]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4409]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4417]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4425]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4433]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4441]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4449]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4457]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4465]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4473]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4481]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4489]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4497]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4505]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4513]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4521]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4529]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4537]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4545]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4553]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4561]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4569]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4577]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4585]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4593]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4601]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4609]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4617]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4625]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4633]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4641]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4649]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4657]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4665]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4673]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4681]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4689]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4697]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4705]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4713]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4721]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4729]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4737]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4745]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4753]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4761]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4769]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4777]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4785]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4793]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4801]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4809]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4817]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4825]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4833]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4841]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4849]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4857]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4865]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4873]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4881]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4889]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4897]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4905]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4913]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4921]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4929]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4937]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4945]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4953]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4961]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4969]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4977]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4985]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [4993]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5001]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5009]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5017]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5025]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5033]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5041]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5049]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5057]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5065]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5073]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5081]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5089]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5097]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5105]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5113]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5121]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5129]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5137]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5145]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5153]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5161]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5169]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5177]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5185]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5193]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5201]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5209]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5217]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5225]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5233]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5241]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5249]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5257]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5265]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5273]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5281]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5289]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5297]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5305]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5313]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5321]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5329]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5337]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5345]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5353]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5361]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5369]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5377]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5385]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
## [5393]    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
cat("\nGoodness of Fit:\n")
## 
## Goodness of Fit:
print(round(mds_result$GOF, 4))
## [1] 0.5116 0.5116

Goodness of Fit:

  • GOF[1] (R²): Proportion of variance explained
  • GOF[2] (Stress): Measure of distortion (lower is better)
  • Values closer to 1 for GOF[1] indicate better fit

9.2 MDS Visualization

# Extract coordinates
mds_coords <- as.data.frame(mds_result$points)
colnames(mds_coords) <- c("Dim1", "Dim2")

# Create plot
ggplot(mds_coords, aes(x = Dim1, y = Dim2)) +
  geom_point(alpha = 0.4, color = "steelblue", size = 2) +
  labs(title = "Multidimensional Scaling (MDS)",
       subtitle = "2D Representation of High-Dimensional Data",
       x = "Dimension 1", 
       y = "Dimension 2") +
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 16),
        plot.subtitle = element_text(hjust = 0.5, size = 12),
        panel.grid.minor = element_blank())
Classical Multidimensional Scaling (MDS) - 2D Representation

Classical Multidimensional Scaling (MDS) - 2D Representation

Interpretation:

  • Points close together represent similar observations
  • Distance between points reflects dissimilarity
  • Clusters indicate groups of similar products

10 t-SNE Analysis

t-SNE is excellent for visualizing high-dimensional data and discovering clusters.

# Load Rtsne package
if(!require("Rtsne")) {
  install.packages("Rtsne", repos = "https://cran.r-project.org/")
  library(Rtsne)
}

10.1 Perform t-SNE

# Set seed for reproducibility
set.seed(42)

# Use sample for computational efficiency (t-SNE is intensive)
tsne_sample_size <- min(2000, nrow(data_scaled))
tsne_indices <- sample(nrow(data_scaled), tsne_sample_size)
tsne_sample <- data_scaled[tsne_indices, ]

cat("Running t-SNE on", tsne_sample_size, "observations...\n")
## Running t-SNE on 2000 observations...
# Perform t-SNE
tsne_result <- Rtsne(tsne_sample, 
                     dims = 2, 
                     perplexity = 30,
                     verbose = FALSE, 
                     max_iter = 500,
                     check_duplicates = FALSE)

cat("✓ t-SNE completed successfully!\n")
## ✓ t-SNE completed successfully!

10.2 t-SNE Visualization

# Extract coordinates
tsne_coords <- as.data.frame(tsne_result$Y)
colnames(tsne_coords) <- c("tSNE1", "tSNE2")

# Create plot
ggplot(tsne_coords, aes(x = tSNE1, y = tSNE2)) +
  geom_point(alpha = 0.5, color = "coral", size = 2) +
  labs(title = "t-SNE Visualization",
       subtitle = "Non-linear Dimension Reduction",
       x = "t-SNE Dimension 1", 
       y = "t-SNE Dimension 2") +
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 16),
        plot.subtitle = element_text(hjust = 0.5, size = 12),
        panel.grid.minor = element_blank())
t-SNE Visualization - Non-linear Dimension Reduction

t-SNE Visualization - Non-linear Dimension Reduction

Interpretation:

  • Clusters indicate groups with similar characteristics
  • t-SNE preserves local structure (nearby points are similar)
  • Global distances are NOT meaningful
  • Different runs may produce different visualizations

11 Creating Reduced Dataset

11.1 Extract Principal Components

# Create reduced dataset with first 2 PCs
data_pca_reduced <- as.data.frame(pca_result$x[, 1:2])
colnames(data_pca_reduced) <- c("PC1", "PC2")

# Add original categorical variables if available
if(nrow(data_pca_reduced) <= nrow(data)) {
  # Match the rows (accounting for any NA removals)
  original_indices <- as.numeric(rownames(data_numeric))
  data_pca_reduced$Category <- data$Category[original_indices]
  data_pca_reduced$Sentiment <- data$Sentiment[original_indices]
  data_pca_reduced$Emotion <- data$Emotion[original_indices]
}

cat("Reduced dataset dimensions:", nrow(data_pca_reduced), "rows ×", 
    ncol(data_pca_reduced), "columns\n")
## Reduced dataset dimensions: 5400 rows × 5 columns

11.2 Preview Reduced Dataset

head(data_pca_reduced, 10) %>%
  kable(caption = "First 10 Rows of Reduced Dataset", digits = 3) %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
First 10 Rows of Reduced Dataset
PC1 PC2 Category Sentiment Emotion
0.719 -0.303 Computers and Laptops Positive Happy
0.958 -0.047 Computers and Laptops Positive Happy
0.899 -1.226 Computers and Laptops Positive Happy
0.359 1.244 Computers and Laptops Positive Happy
0.359 1.244 Computers and Laptops Positive Happy
0.359 1.244 Computers and Laptops Positive Happy
1.022 0.014 Computers and Laptops Positive Happy
1.389 -0.594 Computers and Laptops Positive Happy
1.389 -0.594 Computers and Laptops Positive Happy
1.026 -0.008 Computers and Laptops Positive Happy

11.3 Save Reduced Dataset

# Save to CSV
write.csv(data_pca_reduced, 
          "data_pca_reduced.csv", 
          row.names = FALSE)

cat("✓ Reduced dataset saved as 'data_pca_reduced.csv'\n")
## ✓ Reduced dataset saved as 'data_pca_reduced.csv'

12 PCA with Categorical Variables

12.1 PCA by Sentiment

if("Sentiment" %in% colnames(data_pca_reduced)) {
  ggplot(data_pca_reduced, aes(x = PC1, y = PC2, color = Sentiment)) +
    geom_point(alpha = 0.5, size = 2) +
    labs(title = "PCA by Sentiment",
         subtitle = paste0("PC1: ", round(variance_explained[1]*100, 1), 
                          "% | PC2: ", round(variance_explained[2]*100, 1), "%"),
         x = paste0("PC1 (", round(variance_explained[1]*100, 1), "% variance)"),
         y = paste0("PC2 (", round(variance_explained[2]*100, 1), "% variance)")) +
    theme_minimal() +
    theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 16),
          plot.subtitle = element_text(hjust = 0.5, size = 12),
          legend.position = "right") +
    scale_color_brewer(palette = "Set1")
} else {
  cat("Sentiment variable not available in the dataset.\n")
}
PCA: First Two Principal Components Colored by Sentiment

PCA: First Two Principal Components Colored by Sentiment

12.2 PCA by Emotion

if("Emotion" %in% colnames(data_pca_reduced)) {
  ggplot(data_pca_reduced, aes(x = PC1, y = PC2, color = Emotion)) +
    geom_point(alpha = 0.5, size = 2) +
    labs(title = "PCA by Emotion",
         subtitle = paste0("PC1: ", round(variance_explained[1]*100, 1), 
                          "% | PC2: ", round(variance_explained[2]*100, 1), "%"),
         x = paste0("PC1 (", round(variance_explained[1]*100, 1), "% variance)"),
         y = paste0("PC2 (", round(variance_explained[2]*100, 1), "% variance)")) +
    theme_minimal() +
    theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 16),
          plot.subtitle = element_text(hjust = 0.5, size = 12),
          legend.position = "right") +
    scale_color_brewer(palette = "Dark2")
} else {
  cat("Emotion variable not available in the dataset.\n")
}
PCA: First Two Principal Components Colored by Emotion

PCA: First Two Principal Components Colored by Emotion


13 Summary and Key Findings

13.1 Variance Explained Summary

# Number of components for different variance thresholds
n_comp_70 <- which(cumulative_variance >= 0.70)[1]
n_comp_80 <- which(cumulative_variance >= 0.80)[1]
n_comp_90 <- which(cumulative_variance >= 0.90)[1]

summary_table <- data.frame(
  Variance_Threshold = c("70%", "80%", "90%", "95%"),
  Components_Needed = c(
    n_comp_70,
    n_comp_80,
    n_comp_90,
    which(cumulative_variance >= 0.95)[1]
  ),
  Actual_Variance = c(
    round(cumulative_variance[n_comp_70] * 100, 2),
    round(cumulative_variance[n_comp_80] * 100, 2),
    round(cumulative_variance[n_comp_90] * 100, 2),
    round(cumulative_variance[which(cumulative_variance >= 0.95)[1]] * 100, 2)
  )
)

summary_table %>%
  kable(caption = "Components Needed for Different Variance Thresholds") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Components Needed for Different Variance Thresholds
Variance_Threshold Components_Needed Actual_Variance
70% 4 87.13
80% 4 87.13
90% 5 100.00
95% 5 100.00

13.2 Key Findings

13.2.1 PCA Results

  1. Variance Explained:
    • PC1 explains 27.6% of total variance
    • First 2 PCs explain 51.2% of total variance
    • 4 component(s) needed to explain 80% of variance
  2. Component Interpretation:

PC1 is primarily driven by:

pc1_top <- head(sort(abs(pca_result$rotation[, 1]), decreasing = TRUE), 3)
pc1_df <- data.frame(
  Variable = names(pc1_top),
  Loading = round(pca_result$rotation[names(pc1_top), 1], 3),
  Abs_Loading = round(pc1_top, 3)
)
pc1_df %>%
  kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Variable Loading Abs_Loading
Customer.Rating Customer.Rating 0.599 0.599
Total.Review Total.Review -0.473 0.473
Price Price 0.414 0.414

PC2 is primarily driven by:

pc2_top <- head(sort(abs(pca_result$rotation[, 2]), decreasing = TRUE), 3)
pc2_df <- data.frame(
  Variable = names(pc2_top),
  Loading = round(pca_result$rotation[names(pc2_top), 2], 3),
  Abs_Loading = round(pc2_top, 3)
)
pc2_df %>%
  kable() %>%
  kable_styling(bootstrap_options = c("striped", "hover"),
                full_width = FALSE)
Variable Loading Abs_Loading
Overall.Rating Overall.Rating -0.658 0.658
Total.Review Total.Review -0.535 0.535
Number.Sold Number.Sold -0.443 0.443

13.2.2 Factor Analysis Results

  • Number of factors: 2
  • Factor analysis identified underlying constructs in the data
  • Loadings show which variables group together

13.2.3 MDS Results

  • Goodness of fit: 0.512
  • 2D representation preserves 51.2% of original distances

13.2.4 t-SNE Results

  • Successfully reduced 2000 observations to 2 dimensions
  • Reveals local structure and potential clusters
  • Useful for exploratory visualization