Skip to main content
QUICK REVIEW

[Paper Review] Tutorial on principal component analysis, with applications in R

Henk van Elst|arXiv (Cornell University)|Jan 1, 2021
Spectroscopy and Chemometric AnalysesChemistry1 citations
TL;DR

This tutorial presents a comprehensive, code-driven introduction to principal component analysis (PCA) using R, demonstrating data standardization, eigenvalue decomposition of the correlation matrix, and dimensionality reduction on a trivariate dataset of women's height, mass, and age. The key result shows that a single principal component captures 57.94% of the total variance, reducing the original three-dimensional data to a univariate representation with maximal explained variance and perfect negative correlations among variables.

ABSTRACT

This tutorial reviews the main steps of the principal component analysis of a multivariate data set and its subsequent dimensional reduction on the grounds of identified dominant principal components. The underlying computations are demonstrated and performed by means of a script written in the statistical software package R.

Motivation & Objective

  • To provide a clear, reproducible tutorial on principal component analysis (PCA) using the R programming language.
  • To demonstrate the practical implementation of PCA on a real-world multivariate dataset of height, mass, and age in adult women.
  • To illustrate how eigenvalue decomposition of the sample correlation matrix enables effective dimensionality reduction.
  • To show how standardized and reconstructed data can be visualized and interpreted in both original and transformed scales.
  • To support researchers and students in understanding PCA through transparent, executable R code and visualizations.

Proposed method

  • Loading and filtering a real dataset (n=187 women) from Howell (2001) to extract three metric variables: height [cm], mass [kg], and age [yr].
  • Performing descriptive statistics and visualizing the data using 3D scatter plots and scatter plot matrices to assess distributions and bivariate relationships.
  • Standardizing the data using z-scores via R’s scale() function to ensure equal weighting of variables in PCA.
  • Computing the sample correlation matrix and performing eigenvalue decomposition to identify principal components.
  • Selecting the dominant principal components based on explained variance and constructing a dimensionally reduced dataset.
  • Reconstructing the reduced data back to original measurement scales using inverse standardization for interpretation and comparison.

Experimental results

Research questions

  • RQ1How can principal component analysis be implemented step-by-step using R for a real multivariate dataset?
  • RQ2What proportion of total variance is explained by the first principal component in a trivariate dataset of height, mass, and age?
  • RQ3How do the correlations between variables change after dimensionality reduction via PCA?
  • RQ4To what extent can the original data be reconstructed from the reduced component space?
  • RQ5How do visualizations of the original and dimensionally reduced data compare in terms of structure and distribution?

Key findings

  • The first principal component alone explains 57.94% of the total variance in the original trivariate dataset.
  • The dimensionally reduced data set is effectively univariate, as the first component accounts for the majority of variation.
  • The pairwise correlations among the original variables in the reduced space are all exactly -1.000, indicating perfect negative linear relationships.
  • The reconstructed data in original units (XapproxCor) closely approximates the original data (X), with minimal reconstruction error.
  • Visualizations of the reduced data in standard and original scales show preserved structural patterns despite dimensionality reduction.
  • The tutorial successfully demonstrates a fully reproducible PCA workflow in R, from data loading to visualization and reconstruction.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.