{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Monterey Bay Kelp PCA\n", "\n", "This example uses data from the supplementary material of:\n", "\n", "Graham, M. H. (2003), Confronting multicollinearity in ecological multiple regression. _Ecology_, 84: 2809–2815. doi:10.1890/02-3114 \n", "http://onlinelibrary.wiley.com/doi/10.1890/02-3114/abstract\n", "\n", "The details of observational methods can be found in an earlier paper:\n", "\n", "Graham, M. H. (1997) Factors determining the upper limit of giant kelp, _Macrocystis pyrifera_ Agardh, along the Monterey Peninsula, central California, USA, _J. Exp. Mar. Bio. Ecol._, 218, 127-149." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Key concept\n", "\n", "The final exercise in this notebook is:\n", "\n", "Which principal component is most highly correlated with kelp extent? What is your interpretation of the relationship between kelp extent and environmental variability?" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "scrolled": true }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "from scipy import linalg" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load data" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": true }, "outputs": [], "source": [ "df = pd.read_csv('data/Graham2003_Kelp/Originaldata.txt',delimiter=' ')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", " | Response | \n", "OD | \n", "BD | \n", "LTD | \n", "W | \n", "
---|---|---|---|---|---|
0 | \n", "3.241 | \n", "2.0176 | \n", "4.87 | \n", "-0.59 | \n", "-4.1 | \n", "
1 | \n", "3.032 | \n", "1.9553 | \n", "4.78 | \n", "-0.75 | \n", "4.7 | \n", "
2 | \n", "3.100 | \n", "1.8131 | \n", "3.14 | \n", "-0.38 | \n", "-4.9 | \n", "
3 | \n", "3.156 | \n", "2.5751 | \n", "3.28 | \n", "-0.16 | \n", "-3.2 | \n", "
4 | \n", "3.110 | \n", "2.2589 | \n", "3.28 | \n", "0.01 | \n", "5.6 | \n", "