Understanding PCA Foundations
Introduction
Embark on an exciting journey through the world of Principal Component Analysis (PCA). In this lesson, we will explore the indispensable roles of eigenvalues and eigenvectors in understanding the PCA framework and dive into the computation of these mathematical constructs using R. Our adventure will cover the essential role of the covariance matrix and how to compute it. Ready? Set? Let's start!
Collecting Data
At the onset, we start with a dataset housing different physical measures: weight_lbs (in lbs), height_inches (in inches), and height_cm (in cm). We capture these in R using vectors and combine them into a data frame for easy manipulation:
Here, the data frame df represents our collected dataset.
Introduction to Standardization
Plotting Standardized Data
Let's standardize just the two height columns in our dataset using R's scale() function and visualize the standardized data using ggplot2:
Output:

After standardization, our data is now centered and scaled, making the variables more comparable.

